Skip to content

Documentation / @ripl/core / Queryable

Interface: Queryable

Defined in: packages/core/src/core/query.ts:24

The structural contract the CSS-like query engine operates on, implemented by every Element. Container elements (Group) additionally provide children and a flattened descendant graph so combinators can traverse the scene tree. Typing the engine against this interface (rather than the concrete classes) lets Element, Group, and the engine live in separate modules without import cycles.

Properties

PropertyTypeDescriptionDefined in
children?Queryable[]Present on container elements (e.g. Group): a snapshot of direct children.packages/core/src/core/query.ts:34
classListSet<string>The set of CSS-like class names assigned to the element.packages/core/src/core/query.ts:30
idstringThe element's unique id.packages/core/src/core/query.ts:28
parent?QueryableThe element's parent container, if attached.packages/core/src/core/query.ts:32
typestringThe element's type name (e.g. 'circle', 'group').packages/core/src/core/query.ts:26

Methods

graph()?

optional graph(includeGroups?): Queryable[]

Defined in: packages/core/src/core/query.ts:36

Present on container elements (e.g. Group): the flattened descendant graph.

Parameters

ParameterType
includeGroups?boolean

Returns

Queryable[]