kernl API
    Preparing search index...

    Function createKernl

    • Compose the shell with kernl's opinions: createKernel over kernlModules() when the host names no modules, built from the options it passes (D-061), or over the modules it names. A host that names its own and wants nothing else bundled imports createKernel from @kernlize/core/kernel instead.

      Type Parameters

      Parameters

      • options: KernelBaseOptions & KernlModuleOptions & { modules?: readonly AnyKernlModule[] } & {
            modules: M;
        }

        Host hooks, optional pre-built parts, and kernl's modules' options or the host's own modules.

        • Optional Readonlymodules?: readonly AnyKernlModule[]

          The opinions this shell loads (D-061). kernlModules() by default; a module left out is not offered to applets. Fixed once the shell is composed, because the firewall admits an applet's domains before its code runs (D-056).

        • Readonlymodules: M

      Returns Kernel & ModuleApis<M>

      The shell.

      const kernl = createKernl({ host });
      window.addEventListener('message', (event) => kernl.handleWindowMessage(event));
      const summary = await kernl.resolve(kernl.decodePointer(address));
      const handle = kernl.mount(await kernl.plan(summary), iframe);
    • Compose the shell with kernl's opinions: createKernel over kernlModules() when the host names no modules, built from the options it passes (D-061), or over the modules it names. A host that names its own and wants nothing else bundled imports createKernel from @kernlize/core/kernel instead.

      Parameters

      • options: KernlOptions

        Host hooks, optional pre-built parts, and kernl's modules' options or the host's own modules.

      Returns Kernl

      The shell.

      const kernl = createKernl({ host });
      window.addEventListener('message', (event) => kernl.handleWindowMessage(event));
      const summary = await kernl.resolve(kernl.decodePointer(address));
      const handle = kernl.mount(await kernl.plan(summary), iframe);