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

    Interface WebviewCollection<TUses>

    Records webview views contributed in package.json.

    The registration happens at activation; the callback runs when the user first reveals or recreates the view, which is when VS Code asks for its content. Declared dependencies are resolved once through the Application container during Module binding and reused by each resolve callback. A disposable transient dependency is therefore Application-owned, not per-view; create per-view state inside resolve.

    The dependency-declaring overload is listed first: overload resolution takes the first match, and the no-dependency shape would otherwise absorb the call.

    interface WebviewCollection<TUses extends ServiceMap = Record<never, never>> {
        addView<
            TMap extends Readonly<Record<string, ServiceToken<unknown>>>,
            TView = unknown,
        >(
            definition: {
                id: string;
                inject: TMap;
                options?: WebviewViewRequest;
                resolve: (
                    view: TView,
                    injected: Injected<TUses & TMap>,
                ) => void | Promise<void>;
            },
        ): void;
        addView<TView = unknown>(
            definition: {
                id: string;
                options?: WebviewViewRequest;
                resolve: (view: TView, injected: Injected<TUses>) => void | Promise<void>;
            },
        ): void;
        restorePanel<
            TMap extends Readonly<Record<string, ServiceToken<unknown>>>,
            TPanel = unknown,
            TState = unknown,
        >(
            definition: {
                inject: TMap;
                restore: (
                    panel: TPanel,
                    state: TState,
                    injected: Injected<TUses & TMap>,
                ) => void | Promise<void>;
                viewType: string;
            },
        ): void;
        restorePanel<TPanel = unknown, TState = unknown>(
            definition: {
                restore: (
                    panel: TPanel,
                    state: TState,
                    injected: Injected<TUses>,
                ) => void | Promise<void>;
                viewType: string;
            },
        ): void;
    }

    Type Parameters

    Index
    • Restores a panel of viewType when a window reopens with one still in its tab layout. Without this the tab is discarded on reload. Dependencies are resolved once through the Application container during Module binding and reused for each restoration.

      Type Parameters

      • TMap extends Readonly<Record<string, ServiceToken<unknown>>>
      • TPanel = unknown
      • TState = unknown

      Parameters

      • definition: {
            inject: TMap;
            restore: (
                panel: TPanel,
                state: TState,
                injected: Injected<TUses & TMap>,
            ) => void | Promise<void>;
            viewType: string;
        }

      Returns void

    • Restores a panel needing only the module's ambient set.

      Type Parameters

      • TPanel = unknown
      • TState = unknown

      Parameters

      • definition: {
            restore: (
                panel: TPanel,
                state: TState,
                injected: Injected<TUses>,
            ) => void | Promise<void>;
            viewType: string;
        }

      Returns void