@dxos/react-ui-list
    Preparing search index...

    Interface StaticTreeModel<T>

    interface StaticTreeModel<T extends { id: string }> {
        childIds: (parentId?: string) => Atom<string[]>;
        childIdsAtom: (parentId?: string) => Writable<string[]>;
        item: (id: string) => Atom<undefined | T>;
        itemCurrent: (path: string[]) => Atom<boolean>;
        itemOpen: (path: string[]) => Atom<boolean>;
        itemProps: (path: string[]) => Atom<TreeItemDataProps>;
        refresh: (set: <A>(atom: Writable<A>, value: A) => void) => void;
        rootId: string;
        stateAtom: (path: string[]) => Writable<TreeNodeState>;
    }

    Type Parameters

    • T extends { id: string }

    Hierarchy (View Summary)

    Index

    Properties

    childIds: (parentId?: string) => Atom<string[]>

    Atom family: outbound child IDs for a parent ID (topology). Undefined = root.

    childIdsAtom: (parentId?: string) => Writable<string[]>

    Writable child ordering, so a drop can push a new order for one parent.

    item: (id: string) => Atom<undefined | T>

    Atom family: resolve item by ID (content).

    itemCurrent: (path: string[]) => Atom<boolean>

    Atom family: current (selected) state keyed by path.

    itemOpen: (path: string[]) => Atom<boolean>

    Atom family: open state keyed by path.

    itemProps: (path: string[]) => Atom<TreeItemDataProps>

    Atom family: display props for an item at a given path (path includes item's own ID at end).

    refresh: (set: <A>(atom: Writable<A>, value: A) => void) => void

    Re-derives every child ordering from the source tree, for callers that mutate it in place (pragmatic-drag-and-drop reorders the array rather than producing a new tree). Takes the setter rather than a registry so the model stays independent of the React binding.

    rootId: string

    Id of the synthetic root; childIds(undefined) resolves to this node's children.

    stateAtom: (path: string[]) => Writable<TreeNodeState>

    Writable per-path state, for wiring the tree's onOpenChange / selection callbacks.