CanvasStorageDeclaration

The storage an environment asks for, in its definition's storage field.

@internote/canvas-sdkInterface
On this page
import { CanvasStorageDeclaration } from '@internote/canvas-sdk';

#Fields

initState
Returns the session state a freshly mounted environment starts with.
() => unknown
serializeForContinue
Shapes the state handed to a continue: successor. Absent hands it over unchanged.
(state: unknown) => unknown
tiersRequired
Whether the environment gets the database tier as well as the session tier.
sessionsession+db

#Example

storage: {
    tiers: 'session',
    initState: () => ({ waves: 0 }),
    serializeForContinue: (state) => ({ ...(state as GreetingState), log: [] }),
},

Declared in packages/canvas-sdk/src/storage/index.ts:48.

Last updated