Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WorkspaceAppEventScriptArguments<TData>

Arguments for (workspace) an app script event.

Type parameters

  • TData

Hierarchy

Index

Properties

Optional button

button: StatusBarItem

The underlying button (if available).

clearTemp

clearTemp: function

Clears the '.temp' sub folder.

returns

Temp folder has been cleared or not.

Type declaration

    • (): boolean
    • Returns boolean

Optional data

data: TData

The data.

event

event: string

The name of the event.

exists

exists: function

Checks if a file or folder exists, relative to '.data' sub folder.

param

The path of the file / folder to check.

returns

Indicates if file / folder exists or not.

Type declaration

    • (path: string): boolean
    • Parameters

      • path: string

      Returns boolean

extension

extension: ExtensionContext

The underlying extension context.

getAllWorkspaces

getAllWorkspaces: function

Returns the list of all workspaces.

returns

The list of workspaces.

Type declaration

getFileResourceUri

getFileResourceUri: function

Returns an URI from the 'resources' directory.

param

The (relative) path.

param

Return as string or object. Default: (true)

returns

The URI.

Type declaration

    • (path: string, asString?: boolean): Uri | string
    • Parameters

      • path: string
      • Optional asString: boolean

      Returns Uri | string

globalState

globalState: KeyValuePairs

Gets the global state object.

globalStore

globalStore: Store

The global store.

globals

globals: any
inheritdoc

logger

logger: Logger

The logger.

options

options: any

Options for running the script.

output

output: OutputChannel

The output channel.

post

post: function

Posts a command to the web view.

param

The name of the command.

param

The data for the command.

returns

A promise that indicates if operation was successful or not.

Type declaration

    • (command: string, data?: any): Promise<boolean>
    • Parameters

      • command: string
      • Optional data: any

      Returns Promise<boolean>

readFile

readFile: function

Reads a file, relative to '.data' sub folder.

param

The path of the file.

returns

The read data.

Type declaration

    • (path: string): Buffer
    • Parameters

      • path: string

      Returns Buffer

readTextFile

readTextFile: function

Reads a file as text, relative to '.data' sub folder.

param

The path of the file.

param

The custom encoding. Default: utf8

returns

The read data.

Type declaration

    • (path: string, enc?: string): string
    • Parameters

      • path: string
      • Optional enc: string

      Returns string

remove

remove: function

Reads a file or folder, relative to '.data' sub folder.

param

The path of the file / folder.

Type declaration

    • (path: string): void
    • Parameters

      • path: string

      Returns void

render

render: function

Renders an 'ejs' template.

param

The (template) source.

param

The data for the template.

returns

string The rendered template.

Type declaration

    • (source: string, data?: Data): string
    • Parameters

      • source: string
      • Optional data: Data

      Returns string

renderFile

renderFile: function

Renders an 'ejs' template from a file.

param

The path to the file with the (template) source.

param

The data for the template.

returns

string The rendered template.

Type declaration

    • (file: string, data?: Data): string
    • Parameters

      • file: string
      • Optional data: Data

      Returns string

replaceValues

replaceValues: function

Handles a value as string and replaces placeholders.

param

The input value.

returns

The output value.

Type declaration

    • (val: any): string
    • Parameters

      • val: any

      Returns string

require

require: function

Imports a module from the extension's context.

param

The ID of the module.

returns

The module.

Type declaration

    • (id: string): any
    • Parameters

      • id: string

      Returns any

stat

stat: function

Returns file system information of a file or folder, relative to the '.data' sub folder.

param

The path of the item.

param

Use 'fs.lstat()' instead of 'fs.stat()'. Default: (true)

returns

The information or (false) if not found.

Type declaration

    • (path: string, lstat?: boolean): Stats | false
    • Parameters

      • path: string
      • Optional lstat: boolean

      Returns Stats | false

state

state: any

Provides a property to save data permanently while the current (extension) session.

store

store: Store

The user store for the underlying script.

tempFile

tempFile: function

Creates a new temp file, inside the '.temp' sub folder.

returns

The full path of the new file.

Type declaration

    • (): string
    • Returns string

toDataPath

toDataPath: function

Returns a full path, relative to the '.data' sub folder.

param

The input path.

returns

The full path.

Type declaration

    • (path: string): string
    • Parameters

      • path: string

      Returns string

workspaces

workspaces: WorkspaceList

The list of workspaces, grouped by name.

writeFile

writeFile: function

Write data to a file, relative to '.data' sub folder.

param

The path of the file.

param

The data write.

Type declaration

    • (path: string, data: any): void
    • Parameters

      • path: string
      • data: any

      Returns void

Generated using TypeDoc