Documentation navigation

Published API · 0.1.0-rc.1

foldkit · model-preservation

Published foldkit API declarations for model-preservation.

./model-preservation

@wsagency/wseffect-foldkit · MIT · source · MIT license · WS-AGENCY-NOTICE · THIRD-PARTY-NOTICES

This entry point is published in @wsagency/wseffect-foldkit@0.1.0-rc.1. Import it from the package subpath shown below; the signatures and documentation are read from the installed package declarations.

import * as Wseffect from '@wsagency/wseffect-foldkit/model-preservation'

Exported declarations

PreserveModelMessage

Browser → plugin: the runtime preserves its current Model under a stable id.

export type PreserveModelMessage = typeof PreserveModelMessage.Type;

PreserveModelMessage

Browser → plugin: the runtime preserves its current Model under a stable id so it can be restored after a full reload. `isReloadFlush` is set by the runtime when flushing on `vite:beforeFullReload` to mark the entry as eligible for restoration; absent or `false` for ordinary debounced preserves.

PreserveModelMessage: Schema.Struct<{
    readonly id: Schema.String;
    readonly model: Schema.Unknown;
    readonly isReloadFlush: Schema.optional<Schema.Boolean>;
}>

RequestModelMessage

Browser → plugin: the runtime requests its previously-preserved Model on startup.

export type RequestModelMessage = typeof RequestModelMessage.Type;

RequestModelMessage

Browser → plugin: the runtime requests its previously-preserved Model on startup, scoped by id.

RequestModelMessage: Schema.Struct<{
    readonly id: Schema.String;
}>

RestoreModelMessage

Plugin → browser: the plugin returns the preserved Model for a given runtime id.

export type RestoreModelMessage = typeof RestoreModelMessage.Type;

RestoreModelMessage

Plugin → browser: the plugin returns the preserved Model for a given runtime id. `model` is omitted when nothing is preserved (cold start, manual refresh).

RestoreModelMessage: Schema.Struct<{
    readonly id: Schema.String;
    readonly model: Schema.optional<Schema.Unknown>;
}>