Options
All
  • Public
  • Public/Protected
  • All
Menu

A basic web view.

Hierarchy

Index

Constructors

constructor

  • new WebViewBase(options?: EventEmitterOptions): WebViewBase

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.

Private _panel

_panel: WebviewPanel

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

panel

  • get panel(): WebviewPanel

view

  • get view(): Webview

Methods

addListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns WebViewBase

Protected cleanupIntervals

  • cleanupIntervals(): void
  • Cleansup all timeouts.

    Returns void

Protected cleanupTimeouts

  • cleanupTimeouts(): void
  • Cleansup all timeouts.

    Returns void

close

  • close(): Promise<boolean>
  • Closes the web view.

    Returns Promise<boolean>

    A promise that indicates if operation was successful or not.

dispose

  • dispose(): void
  • inheritdoc

    Returns void

emit

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

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

    Returns boolean

eventNames

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

Protected generateHtml

  • generateHtml(): string

Protected Abstract generateHtmlBody

  • generateHtmlBody(): string
  • Generate the HTML header for the view.

    Returns string

    The HTML.

Protected generateHtmlFooter

  • generateHtmlFooter(): string
  • Generate the HTML footer for the view.

    Returns string

    The HTML footer.

Protected generateHtmlHeader

  • generateHtmlHeader(): string
  • Generate the HTML header for the view.

    Returns string

    The HTML header.

Protected getFileResourceUri

  • getFileResourceUri(p: string): Uri
  • Returns an URI from the 'resources' directory.

    Parameters

    • p: string

      The (relative) path.

    Returns Uri

    The URI.

getMaxListeners

  • getMaxListeners(): number

Protected getOptions

Protected getResourceUris

  • getResourceUris(): Uri[]
  • Returns the URIs for the web view's resources.

    Returns Uri[]

    The list of resources.

Protected Abstract getTitle

  • getTitle(): string
  • Returns the title for the web view.

    Returns string

    The title.

Protected Abstract getType

  • getType(): string
  • Returns the type of the web view.

    Returns string

    The type.

Protected getViewColumns

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

off

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

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

          • Rest ...args: any[]

          Returns void

    Returns WebViewBase

on

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

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

          • Rest ...args: any[]

          Returns void

    Returns WebViewBase

Protected onDispose

  • onDispose(): void

Protected onLoaded

  • onLoaded(): Promise<void>
  • Is invoked after the page inside the web view has been loaded.

    Returns Promise<void>

Protected onLog

Protected onWebViewDisposed

  • onWebViewDisposed(): Promise<void>
  • Is invoked, after the web view (panel) has been disposed.

    Returns Promise<void>

Protected onWebViewMessage

  • Handles a custom web view message.

    Parameters

    Returns Promise<boolean>

    The promise that indicates if message has been handled or not,

Protected onWebViewVisibilityChanged

  • onWebViewVisibilityChanged(isVisible: boolean): Promise<void>
  • Is invoked after the visibility of the web view has been changed.

    Parameters

    • isVisible: boolean

      Content is currently visible or not.

    Returns Promise<void>

once

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

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

          • Rest ...args: any[]

          Returns void

    Returns WebViewBase

open

  • open(): Promise<boolean>
  • Opens the web view.

    Returns Promise<boolean>

    A promise that indicates if operation was successful or not.

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): WebViewBase
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns WebViewBase

prependOnceListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns WebViewBase

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): WebViewBase

removeListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns WebViewBase

setMaxListeners

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