@camera.ui/sdk / storage / JsonBaseSchema
Interface: JsonBaseSchema<T>
Defined in: storage/index.ts:96
Base schema with callbacks - full schema interface. Adds storage and callback options for dynamic behavior.
Example
// Persisted number with onSet hook for live re-config:
{ type: 'number', key: 'pollSec', title: 'Poll (seconds)', description: '',
defaultValue: 30, minimum: 5, maximum: 300, step: 5, store: true,
onSet: async (newValue, oldValue) => this.reschedule(newValue) }
// Action button (no value stored, just fires on click):
{ type: 'button', key: 'reset', title: 'Reset to defaults', description: '',
color: 'danger', onSet: async () => this.resetDefaults() }Extends
Extended by
Type Parameters
T
T extends string | string[] | number | number[] | boolean | boolean[] = any
Properties
condition?
optionalcondition?:SchemaCondition|SchemaCondition[]
Defined in: storage/index.ts:77
Condition for conditional field visibility. Array = all must be true (AND).
Inherited from
JsonBaseSchemaWithoutCallbacks.condition
defaultValue?
optionaldefaultValue?:T
Defined in: storage/index.ts:75
Default value when not set
Inherited from
JsonBaseSchemaWithoutCallbacks.defaultValue
description
description:
string
Defined in: storage/index.ts:56
Field description/help text
Inherited from
JsonBaseSchemaWithoutCallbacks.description
group?
optionalgroup?:string
Defined in: storage/index.ts:58
Optional group name for organizing fields
Inherited from
JsonBaseSchemaWithoutCallbacks.group
hidden?
optionalhidden?:boolean
Defined in: storage/index.ts:67
Hide field from UI
Inherited from
JsonBaseSchemaWithoutCallbacks.hidden
key
key:
string
Defined in: storage/index.ts:52
Unique field identifier
Inherited from
JsonBaseSchemaWithoutCallbacks.key
onGet?
optionalonGet?: () =>Promise<any>
Defined in: storage/index.ts:102
Callback to get computed value
Returns
Promise<any>
onSet?
optionalonSet?: (newValue,oldValue) =>Promise<void>
Defined in: storage/index.ts:100
Callback when value changes
Parameters
newValue
any
oldValue
any
Returns
Promise<void>
placeholder?
optionalplaceholder?:string
Defined in: storage/index.ts:73
Placeholder text for empty fields
Inherited from
JsonBaseSchemaWithoutCallbacks.placeholder
readonly?
optionalreadonly?:boolean
Defined in: storage/index.ts:71
Make field read-only
Inherited from
JsonBaseSchemaWithoutCallbacks.readonly
required?
optionalrequired?:boolean
Defined in: storage/index.ts:69
Mark field as required
Inherited from
JsonBaseSchemaWithoutCallbacks.required
store?
optionalstore?:boolean
Defined in: storage/index.ts:98
Whether to persist this field to storage
title
title:
string
Defined in: storage/index.ts:54
Display title
Inherited from
JsonBaseSchemaWithoutCallbacks.title
type
type:
JsonSchemaType
Defined in: storage/index.ts:50
Field type