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';Members8
- __@runtimeContractInput@15821optional
TValue- id
StateDeclarationIdIdentifier, unique within the mod.
- initial
TValueValue used the first time this state is registered.
- kind
'state-declaration'- scope
ModStateScopeWhether the value persists per workspace or per profile.
- sensitivity
DataSensitivityHow freely the host may share the value.
- stability
DataStabilityCompatibility promise you are making to readers of this state.
- titleoptional
stringHuman-readable label shown where the host lists mod state.