Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AppWebViewBase

A webview for a custom (workspace) app.

Hierarchy

Index

Constructors

constructor

Properties

Protected Readonly _DISPOSABLES

_DISPOSABLES: Disposable[]

Stores disposable sub objects.

Protected Readonly _INTERVALS

_INTERVALS: Timer[]

Stores intervals.

Protected _QUEUE

_QUEUE: default<default, DefaultAddOptions> = ...

The underlying queue.

Protected Readonly _TIMEOUTS

_TIMEOUTS: Timer[]

Stores timeouts.

Readonly extension

extension: ExtensionContext

Static Readonly captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Accessors

isDisposed

  • get isDisposed(): boolean
  • Gets if object has been disposed or not.

    Returns boolean

isDisposing

  • get isDisposing(): boolean
  • Gets if the 'dispose()' method is currently executed or not.

    Returns boolean

isInFinalizeState

  • get isInFinalizeState(): boolean
  • Gets if the object is disposed or currently disposing.

    Returns boolean

Abstract module

panel

  • get panel(): WebviewPanel

Abstract scriptFile

  • get scriptFile(): string
  • Get the full path of the script file.

    Returns string

view

  • get view(): Webview

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): AppWebViewBase
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns AppWebViewBase

Protected cleanupIntervals

  • cleanupIntervals(): void

Protected cleanupTimeouts

  • cleanupTimeouts(): void

Protected clearTempDir

  • clearTempDir(): boolean
  • Clears the '.temp' sub folder.

    Returns boolean

    Temp folder has been cleared or not.

close

  • close(): Promise<boolean>

Protected Abstract createScriptArguments

  • Creates arguments for an event function.

    Parameters

    • eventName: string

      The name of the event.

    • Optional data: any

    Returns AppEventScriptArguments<any>

    The created arguments.

Protected createTempFile

  • createTempFile(): string
  • Creates a new temp file, inside the '.temp' sub folder.

    Returns string

    The full path of the new file.

dispose

  • dispose(): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]

Protected fileSystemItemExists

  • fileSystemItemExists(p: string): boolean
  • Checks if a file or folder exists, relative to '.data' sub folder.

    Parameters

    • p: string

      The path of the file / folder to check.

    Returns boolean

    Indicates if file / folder exists or not.

Protected fileSystemItemStat

  • fileSystemItemStat(p: string, lstat?: boolean): false | Stats
  • Returns file system information of a file or folder, relative to the '.data' sub folder.

    Parameters

    • p: string

      The path of the item.

    • Optional lstat: boolean

    Returns false | Stats

    The information or (false) if not found.

Protected generateHtml

  • generateHtml(): string

Protected generateHtmlBody

  • generateHtmlBody(): string

Protected generateHtmlFooter

  • generateHtmlFooter(): string

Protected generateHtmlHeader

  • generateHtmlHeader(): string

Protected getAllWorkspaces

Protected getEventFunction

Protected getFileResourceUri

  • getFileResourceUri(p: string): Uri

getMaxListeners

  • getMaxListeners(): number

Protected getOptions

Protected getResourceUris

  • getResourceUris(): Uri[]

Protected getTempDir

  • getTempDir(): string
  • Returns the full path of the temp directory.

    Returns string

    The temp directory.

Protected getTitle

  • getTitle(): string

Protected getType

  • getType(): string

Protected getViewColumns

listenerCount

  • listenerCount(event: string | symbol): number

listeners

  • listeners(event: string | symbol): Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): AppWebViewBase
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns AppWebViewBase

on

  • on(event: string | symbol, listener: (...args: any[]) => void): AppWebViewBase
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns AppWebViewBase

Protected onDispose

  • onDispose(): void

Protected onLoaded

  • onLoaded(): Promise<void>

Protected onLog

Protected onWebViewDisposed

  • onWebViewDisposed(): Promise<void>

Protected onWebViewMessage

Protected onWebViewVisibilityChanged

  • onWebViewVisibilityChanged(isVisible: boolean): Promise<void>

once

  • once(event: string | symbol, listener: (...args: any[]) => void): AppWebViewBase
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns AppWebViewBase

open

  • open(): Promise<boolean>

postMessage

  • postMessage<TData>(command: string, data?: TData): Promise<boolean>
  • Sends a message to the web view.

    Type parameters

    • TData = any

    Parameters

    • command: string

      The command to send.

    • Optional data: TData

    Returns Promise<boolean>

    The promise that indicates if operation was successful or not.

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): AppWebViewBase
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns AppWebViewBase

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): AppWebViewBase

rawListeners

  • rawListeners(event: string | symbol): Function[]

Protected readFile

  • readFile(p: string): Buffer
  • Reads a file, relative to '.data' sub folder.

    Parameters

    • p: string

      The path of the file.

    Returns Buffer

    The read data.

removeAllListeners

Protected removeFileOrFolder

  • removeFileOrFolder(p: string): void
  • Reads a file or folder, relative to '.data' sub folder.

    Parameters

    • p: string

      The path of the file / folder.

    Returns void

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): AppWebViewBase
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns AppWebViewBase

setMaxListeners

Protected toFullDataPath

  • toFullDataPath(p: string): string
  • Returns a full path, relative to '.data' sub directory.

    Parameters

    • p: string

      The input path.

    Returns string

    The full path.

Protected writeFile

  • writeFile(p: string, data: any): void
  • Write data to a file, relative to '.data' sub folder.

    Parameters

    • p: string

      The path of the file.

    • data: any

      The data write.

    Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc