Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HTTPRequestBase

A basic HTTP request.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected _DISPOSABLES

_DISPOSABLES: vscode.Disposable[]

Stores disposable sub objects.

Protected _INTERVALS

_INTERVALS: Timer[]

Stores intervals.

Protected _TIMEOUTS

_TIMEOUTS: Timer[]

Stores timeouts.

Protected _html

_html: string | false = false

Stores the HTML for the WebView.

Private _panel

_panel: vscode.WebviewPanel

Private _startOptions

_startOptions: StartNewRquestOptions

Private _styleChangedListener

_styleChangedListener: function

Type declaration

    • (uri: vscode.Uri): void
    • Parameters

      • uri: vscode.Uri

      Returns void

id

id: any

Gets the ID of that instance.

isDisposed

isDisposed: boolean

Gets if object has been disposed or not.

isDisposing

isDisposing: boolean

Gets if the 'dispose()' method is currently executed or not.

isInFinalizeState

isInFinalizeState: boolean

Gets if the object is disposed or currently disposing.

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

panel

  • get panel(): vscode.WebviewPanel
  • Gets the underlying panel.

    Returns vscode.WebviewPanel

resourceRoots

  • get resourceRoots(): string[]
  • Gets the root directories for the web view's resources.

    Returns string[]

startOptions

view

  • get view(): vscode.Webview
  • Gets the underlying web view.

    Returns vscode.Webview

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

applyRequest

  • applyRequest(requestData: RequestData): Promise<boolean>

Protected cleanupIntervals

  • cleanupIntervals(): void
  • Cleansup all timeouts.

    Returns void

Protected cleanupTimeouts

  • cleanupTimeouts(): void
  • Cleansup all timeouts.

    Returns void

dispose

  • dispose(): void
  • Dispose this object.

    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)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getResourceUri

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

    Parameters

    • p: string

      The (relative) path.

    Returns vscode.Uri

    The URI.

initialize

  • initialize(): Promise<void>
  • Initializes the request.

    Returns Promise<void>

Protected invokeForCancellationTokenSource

  • invokeForCancellationTokenSource<TResult>(cancelTokenSrc: vscode.CancellationTokenSource, action: function, ...args: any[]): Promise<any>
  • Invokes an action for a cancellation token source.

    Type parameters

    • TResult

    Parameters

    • cancelTokenSrc: vscode.CancellationTokenSource

      The token source.

    • action: function

      The action to invoke.

        • (...args: any[]): TResult | PromiseLike<TResult>
        • Parameters

          • Rest ...args: any[]

          Returns TResult | PromiseLike<TResult>

    • Rest ...args: any[]

    Returns Promise<any>

    The promise with the result of the action.

listenerCount

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

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

onDidChangeVisibility

  • onDidChangeVisibility(listener: function): this
  • inheritdoc

    Parameters

    • listener: function
        • (isVisible: any): void | PromiseLike<void>
        • Parameters

          • isVisible: any

          Returns void | PromiseLike<void>

    Returns this

Protected onDidDispose

  • onDidDispose(): Promise<void>
  • Is invoked after the underlying panel has been disposed.

    Returns Promise<void>

Protected onDidReceiveMessage

  • Is invoked when the web view received a message from the browser.

    Parameters

    Returns Promise<void>

Protected onDispose

  • onDispose(): void
  • inheritdoc

    Returns void

Protected Abstract onInitialize

  • onInitialize(): any
  • The logic to intialize the request.

    Returns any

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

postMessage

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

    Parameters

    • command: string
    • Optional data: any

    Returns Promise<boolean>

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Protected showError

  • showError(err: any): Promise<string>
  • Shows an error.

    Parameters

    • err: any

      The error to show.

    Returns Promise<string>

start

  • Opens the view to start a request.

    Parameters

    Returns Promise<boolean>

    The promise that indicates if operation was successful or not.

Static listenerCount

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

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc