kernl API
    Preparing search index...

    Interface KernlModule<Id, Api>

    One opinion of the shell, which a host loads, leaves out or replaces (D-061).

    const clock: KernlModule<'clock', { now(): number }> = {
    id: 'clock',
    setup: () => ({ api: { now: () => Date.now() } }),
    };
    const kernl = createKernl({ host, modules: [...kernlModules(), clock] });
    kernl.clock.now();
    interface KernlModule<Id extends string = string, Api = void> {
        asks?: readonly (keyof AskKinds)[];
        id: Id;
        requires?: readonly string[];
        setup(context: KernelContext): ModuleInstance<Api>;
    }

    Type Parameters

    • Id extends string = string
    • Api = void
    Index
    asks?: readonly (keyof AskKinds)[]

    The kinds of question this module may put to the person through KernelContext.ask (D-067).

    id: Id
    requires?: readonly string[]

    Ids of modules or kernel parts that must be loaded with this one.