@intisy/bayonet
    Preparing search index...

    Interface HostSurface

    The object createPluginHost returns.

    supports and verifyActivation are | null rather than | undefined, because a check that ran and found nothing wrong is a stated answer and the adapter genuinely returns null. service is | undefined, because a missing service is an absent map entry rather than an answer. markBroken takes the same PluginErrorShape for its error argument, since a caller passes back exactly what pluginError produced.

    interface HostSurface {
        descriptor: HostDescriptorShape;
        ledger: LedgerFacadeShape;
        capability(id: string): CapabilityRecordShape[];
        contextFor(manifest: unknown, runtime: PluginRuntimeShape): ContextSurface;
        markBroken(pluginId: string, error: PluginErrorShape): void;
        provideService(id: string, service: unknown): void;
        release(pluginId: string): void;
        service(id: string): unknown;
        supports(manifest: unknown): PluginErrorShape | null;
        verifyActivation(manifest: unknown): PluginErrorShape | null;
    }
    Index

    What every plugin is told about this host.

    The record of what each plugin declared and provided.

    • Every implementation of one capability, in activation order.

      Parameters

      • id: string

        the capability id to look up

      Returns CapabilityRecordShape[]

      the providing plugins' records, or empty when no plugin provides it

    • Quarantines a plugin, dropping its registrations and recording why.

      Parameters

      • pluginId: string

        the id of the plugin to quarantine

      • error: PluginErrorShape

        the problem that caused the quarantine

      Returns void

    • Offers a service the host itself implements, for every plugin to reach.

      Parameters

      • id: string

        the service id to register under

      • service: unknown

        the value every plugin's context.services.get(id) then receives

      Returns void

      How a plugin gets behaviour belonging to a library it may not link: the host links it once and hands over a typed handle, rather than every plugin carrying a private copy. Call it before starting plugins, so a plugin asking during activate finds it.

    • Drops a stopped plugin's registrations without marking it broken.

      Parameters

      • pluginId: string

        the id of the plugin to release

      Returns void

    • The service registered under an id, or undefined when nothing is.

      Parameters

      • id: string

        the service id to look up

      Returns unknown

      the registered service, or undefined when none is registered

    • Why this host cannot load the manifest, or null when it can.

      Parameters

      • manifest: unknown

        the parsed plugin.json object to check

      Returns PluginErrorShape | null

      the problem found, or null when the host can load this manifest

    • Why what the plugin provided disagrees with what it declared, or null when they agree.

      Parameters

      • manifest: unknown

        the parsed plugin.json object of the plugin being verified

      Returns PluginErrorShape | null

      the disagreement found, or null when the plugin honored its declaration