Appearance
Type Alias: StateSchema
ts
type StateSchema = Record<string, Record<string, StateValueInfo>>;Schemas for all available state values, keyed by component id and then by state key. The keys match StateValues. Each entry contains:
schema: a JSON Schema draft 2020-12 fragment describing the accepted value.writable: whether the component accepts API updates to this key.
JavaScript embeds return this object from getStateSchema(). Iframes send it in ridge:ready and in replies to ridge:getStateSchema.
Example
ts
const stateSchema: StateSchema = {
"region-menu": {
filter: {
schema: { type: "string", enum: ["EMEA", "APAC", "AMER"] },
writable: true
}
}
};