@web-engine-dev/resources / ResourceSchema
Interface: ResourceSchema
Full schema for a serializable scene resource.
Provides everything needed to serialize, deserialize, migrate, and render an editor UI for a resource type.
Remarks
All properties are readonly. Schema objects are defined once at module scope and shared across the application.
Properties
displayName?
readonlyoptionaldisplayName:string
Human-readable display name for the editor.
displayOrder?
readonlyoptionaldisplayOrder:number
Numeric display order for this resource section in the editor Scene panel.
Lower numbers appear first. Resources without an explicit displayOrder are placed after those with one (treated as Infinity). Resources with equal displayOrder are sorted alphabetically by typeId.
fields
readonlyfields:Readonly<Record<string,ResourceFieldDescriptor>>
Field descriptors keyed by field name.
icon?
readonlyoptionalicon:string
Icon identifier for the editor UI (e.g. 'sun', 'volume').
migrations?
readonlyoptionalmigrations:Readonly<Record<number,SchemaMigration>>
Migration functions keyed by source version number.
migrations[n] transforms data from version n to version n + 1. The runtime applies them sequentially from storedVersion to currentVersion.
sectionOrder?
readonlyoptionalsectionOrder: readonlystring[]
Ordered list of category names for controlling section display order in the editor. Categories not listed here appear after those that are, in alphabetical order.
typeId
readonlytypeId:string
Stable type identifier, PascalCase by convention (e.g. 'FogSettings').
This ID is stored in serialized scene data and must never change once published. Renaming requires a migration.
version
readonlyversion:number
Schema version number. Starts at 1 and increments with each breaking change to the field set or semantics.