StateDeclaration
interfaceOne piece of state your mod owns, declared at author time. This is the declaration, not the data. You list it in `defineMod`'s `state` slot and keep the value around to pass to `ctx.state(declaration)`, which is what hands you a live OwnedState handle you can read and write.
Import
import { StateDeclaration } from '@modular/sdk/state';Members9
- [runtimeContractCompilerValue]
GeneratedRuntimeContract- [runtimeContractType]
RuntimeContract<TValue>- id
string & $brand<'StateDeclarationId'>Identifier, unique within the mod.
- initial
TValueValue used the first time this state is registered.
- kind
'state-declaration'- scope
'profile' | 'workspace'Whether the value persists per workspace or per profile.
- sensitivity
'workspace' | 'private' | 'public' | 'secret'How freely the host may share the value, defaulting to `private`.
- stabilityoptional
'internal' | 'experimental' | 'stable'Compatibility promise you are making to readers of this state.
- titleoptional
stringHuman-readable label shown where the host lists mod state.
Notes
- category
- State