Skip to content

@web-engine-dev/resources


@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?

readonly optional displayName: string

Human-readable display name for the editor.


displayOrder?

readonly optional displayOrder: 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

readonly fields: Readonly<Record<string, ResourceFieldDescriptor>>

Field descriptors keyed by field name.


icon?

readonly optional icon: string

Icon identifier for the editor UI (e.g. 'sun', 'volume').


migrations?

readonly optional migrations: 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?

readonly optional sectionOrder: readonly string[]

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

readonly typeId: 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

readonly version: number

Schema version number. Starts at 1 and increments with each breaking change to the field set or semantics.

Proprietary software. All rights reserved.