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

    Interface ServiceToken<T>

    Identifies a service in the container.

    Container identity is the token object itself, never the string id: the id is only used in diagnostics. There is deliberately no global symbol registry, so two independently created tokens with the same id stay distinct.

    export interface ProjectRepository {
    refresh(signal: AbortSignal): Promise<number>;
    }

    export const ProjectRepository = serviceToken<ProjectRepository>('projects.repository');
    interface ServiceToken<T> {
        id: string;
        resolves?: () => T;
    }

    Type Parameters

    • T
    Index
    id: string

    Human-readable id, used in errors, diagnostics and inspect output.

    resolves?: () => T

    Phantom carrier for the service type. Never present at runtime.

    Declared as () => T so the token is covariant in T: that keeps ServiceToken<Concrete> assignable to ServiceToken<unknown>, which the dependency-map constraint relies on.