Skip to content

API

ogygia/plugin/client

A plugin's browser realm.

On this page

This page is generated from the package’s own .d.ts files on every build, so the signatures, descriptions and examples below always match the source.

import { … } from 'ogygia/plugin/client';

Exports defineClient · ClientBootContext · ClientPlugin · ClientRegion

defineClient

function

Typed identity: a plugin's browser half.

function defineClient(plugin: ClientPlugin): ClientPlugin;

ClientBootContext

interface

What boot is told about the page.

interface ClientBootContext {/*…*/}

ClientBootContext.kitPage

A page Kit hydrates (csr = true): ogygia's runtime does not boot there and no region hook fires; the realm boots on its own (dev only).

readonly kitPage: boolean;

ClientPlugin

interface

A plugin's browser half.

interface ClientPlugin {/*…*/}

ClientPlugin.boot

Once, as the runtime boots: after core's features, before the first region wakes.

boot?(ctx: ClientBootContext): void;

ClientPlugin.regionMount

A region's component started (hydrated, or mounted live). urls: the files it runs from.

regionMount?(el: Element, region: ClientRegion & {
    readonly urls: readonly string[];
  }): void;

ClientPlugin.regionUnmount

A region's component left the page.

regionUnmount?(el: Element, region: ClientRegion): void;

ClientRegion

interface

A region whose component runs in the browser, as the region hooks see it.

interface ClientRegion {/*…*/}

ClientRegion.entry

The region's entry (its component's stable module URL).

readonly entry: string;