weasel API - v0.8.0
    Preparing search index...

    Interface SelectionContextValueExperimental

    interface SelectionContextValue {
        kinds?: readonly (string | undefined)[];
        selection: readonly NodeId[];
        publishSelection(
            ids: readonly NodeId[],
            kinds?: readonly (string | undefined)[],
        ): void;
    }
    Index

    Properties

    kinds?: readonly (string | undefined)[]

    Optional per-id kind label, parallel to selection. Publishers that know their domain populate it (e.g. 'rectangle', 'path', 'group') so consumers can render type-aware copy. Sparse entries (undefined) are allowed; consumers should treat the kinds array as best-effort.

    See docs/TODO.md (Tier 1.5 → "Typed scene-object references") for the longer-term direction toward a proper id+kind value type.

    selection: readonly NodeId[]

    The most-recently-published selection. Empty array when no canvas has published or when the active canvas's selection is empty.

    Methods

    • Experimental

      Publish the calling canvas's selection. Idempotent — calling with the same array (by content equality) does not trigger a re-render of the consumer tree.

      Parameters

      • ids: readonly NodeId[]
      • Optionalkinds: readonly (string | undefined)[]

      Returns void