json-dom
    Preparing search index...

    Type Alias TraitDefinition

    What a trait is at runtime: which properties it puts on an item, and whether they belong in json.

    type TraitDefinition = {
        defaults?: () => Record<string, unknown>;
        keys: string[];
        serializable?: boolean;
    }
    Index
    defaults?: () => Record<string, unknown>

    The data a new item gets when it is given the trait.

    keys: string[]

    The properties the trait puts on an item.

    serializable?: boolean

    False for properties which only make sense where the item lives (an element): they are left out of json.