@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Interface FakeWebviews

    In-memory webview capability for tests.

    interface FakeWebviews {
        panels: readonly FakeWebviewPanel[];
        serializers: readonly FakeWebviewSerializer[];
        views: readonly FakeWebviewView[];
        _addFile(path: string, contents: string): void;
        createPanel(request: WebviewPanelRequest): WebviewPanelSurface;
        readExtensionFile(extensionRelativePath: string): Promise<string>;
        registerPanelSerializer(
            viewType: string,
            restore: (
                surface: WebviewPanelSurface,
                state: unknown,
            ) => void | Promise<void>,
        ): PlatformRegistration;
        registerViewProvider(
            viewId: string,
            resolve: (surface: WebviewViewSurface) => void | Promise<void>,
            options: WebviewViewRequest,
        ): PlatformRegistration;
    }

    Hierarchy

    • WebviewCapability
      • FakeWebviews
    Index
    panels: readonly FakeWebviewPanel[]

    Every panel opened, in order, including closed ones.

    serializers: readonly FakeWebviewSerializer[]

    Every panel restorer registered, in order.

    views: readonly FakeWebviewView[]

    Every view provider registered, in order.

    • Adds a file the extension can read as a template.

      Parameters

      • path: string
      • contents: string

      Returns void

    • Reads a file shipped with the extension, as text.

      Goes through the platform rather than Node's fs so templates load in remote and web extension hosts too.

      Parameters

      • extensionRelativePath: string

      Returns Promise<string>

    • Registers the restorer for a panel of viewType.

      Called when a window reopens with a panel of this kind still in its tab layout. Without one, the tab is discarded on reload -- so this is what makes a panel survive a window restart, not an optimisation. The returned registration is Application-owned and must be disposed on shutdown.

      Parameters

      • viewType: string
      • restore: (surface: WebviewPanelSurface, state: unknown) => void | Promise<void>

      Returns PlatformRegistration