@adobe/ecs - v0.2.1
    Preparing search index...

    Interface Traits<N>

    The value each trait allows on the component or resource N. Augment it, with this exact type parameter, to define a trait, keyed by a Symbol() constant of the same module, which the build registers. A trait that doesn't apply to N resolves to never. An allowed value may look at N's own traits and at the one component a declared value names, never map over every component, or checking grows with the square of the component count.

    interface Traits<N extends Component.Key | Resource.Key> {
        derived: N extends never
            ? Components[N<N>] extends { shared: true } ? never : true
            : never;
        reduce: N extends keyof Resources
            ? [Resource<N<N>>] extends [boolean]
                ? "&" | "|" | "^"
                : Structs[N<N>] extends true ? Reduction : never
            : never;
        reference: N extends never
            ? Components[N<N>] extends { derived: true } | { shared: true }
                ? never
                : [Component<N<N>>] extends [Entity] ? "owner" | "weak" : never
            : never;
        shared: N extends never
            ? Components[N<N>] extends { derived: true } | { reference: unknown }
                ? never
                : IsComparable<Component<N<N>>> extends true ? true : never
            : never;
        thread: Structs[N] extends true
        | "string"
            ? never
            : N extends never
                ? Components[N<N>] extends { shared: true }
                    ? never
                    : IsNode<ValueOf<N<N>>> extends true ? "main" : Thread
                : IsNode<ValueOf<N>> extends true ? "main" : Thread;
        transfer: IsTransferable<ValueOf<N>> extends true ? true : never;
        type: unknown;
        within: N extends never
            ? Components[N<N>] extends { derived: true } | { within: N<N> }
                ? never
                : never
            : never;
    }

    Type Parameters

    Index

    Properties

    derived: N extends never
        ? Components[N<N>] extends { shared: true } ? never : true
        : never

    Present only while a rule deriving it matches, so commands never add or remove it. Not on a shared component.

    reduce: N extends keyof Resources
        ? [Resource<N<N>>] extends [boolean]
            ? "&" | "|" | "^"
            : Structs[N<N>] extends true ? Reduction : never
        : never

    On a resource, the operator systems reduce into it with: each run that a contributor runs in starts it at the operator's identity and leaves it holding the fold of every contribution. Booleans fold bitwise.

    reference: N extends never
        ? Components[N<N>] extends { derived: true } | { shared: true }
            ? never
            : [Component<N<N>>] extends [Entity] ? "owner" | "weak" : never
        : never

    On an entity-valued component: when its target despawns, owner despawns the holder and weak removes the component. Not on a derived component, whose target only a command could set.

    shared: N extends never
        ? Components[N<N>] extends { derived: true } | { reference: unknown }
            ? never
            : IsComparable<Component<N<N>>> extends true ? true : never
        : never

    On a component of comparable data (numbers, booleans, strings, arrays and plain objects of those): each archetype holds one value of it for every entity it holds, so entities of equal values share an archetype. Rows read it as their archetype's value; commands.add with another value moves the entity. Not on a derived component or a reference, and it has no thread: every thread reads it.

    thread: Structs[N] extends true
    | "string"
        ? never
        : N extends never
            ? Components[N<N>] extends { shared: true }
                ? never
                : IsNode<ValueOf<N<N>>> extends true ? "main" : Thread
            : IsNode<ValueOf<N>> extends true ? "main" : Thread

    The logical thread an object lives on, "world" without it. Not on a struct or a string, which live in shared memory. A DOM Node lives on "main", and says so.

    transfer: IsTransferable<ValueOf<N>> extends true ? true : never

    The value may be moved, never copied, to its thread: only a Transferable value.

    type: unknown

    The value type: declared as a TypeScript type, registered as a schema for it when it's data.

    within: N extends never
        ? Components[N<N>] extends { derived: true } | { within: N<N> }
            ? never
            : never
        : never

    Exists only while its host component does, and is removed with it. Not on a derived component, which its rule covers.