CanvasStorageDeclaration
The storage an environment asks for, in its definition's storage field.
@internote/canvas-sdkimport { CanvasStorageDeclaration } from '@internote/canvas-sdk';#Fields
initStateReturns the session state a freshly mounted environment starts with.
() => unknownserializeForContinueShapes the state handed to a
continue: successor. Absent hands it over unchanged.(state: unknown) => unknowntiersWhether 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.