types
Import from bear/engine/types.
Interfaces
AncestorNode
Defined in: bear/engine/types.ts:281
Minimal ancestor-chain shape every node satisfies structurally. Helpers that only walk upward (context lookup, world transforms) accept this.
Extended by
Properties
| Property | Modifier | Type |
|---|---|---|
context? | readonly | ContextMap |
parent | readonly | AncestorNode | null |
transform? | readonly | TransformMatrix |
AssemblyNode
Defined in: bear/engine/types.ts:336
An assembly. Publishes the reference planes its refs prop states and
spans its children; an empty assembly has no extents.
Extends
TreeNodeBase<P>
Type Parameters
Properties
| Property | Modifier | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|---|
assemblies | readonly | readonly AssemblyFn<Record<string, unknown>>[] | Assembly components whose expansion produced this node, innermost first. Assemblies are transparent (they create no nodes of their own), so this is how a node remembers which components it came from; q(Wall) matches against it. | - | TreeNodeBase.assemblies |
authoredSegment | readonly | string | The authored name before sibling FQN deduplication renamed it. | - | TreeNodeBase.authoredSegment |
children | readonly | readonly TreeNode<Record<string, unknown>>[] | - | - | TreeNodeBase.children |
context? | readonly | ContextMap | Context values provided by this node for descendant lookup. Set from the context prop during collection. Descendants call getContext(node, ctx) to walk the ancestor chain. | - | TreeNodeBase.context |
extents? | readonly | ReferenceExtents | - | - | - |
fqn | readonly | string | - | - | TreeNodeBase.fqn |
kind | readonly | "assembly" | - | TreeNodeBase.kind | - |
model? | readonly | ModelView | The model this node landed in, set when materialize() seals the converged tree. Graph hops from a bare node read its edges here. Absent on a tree that was only collected (a pass that did not converge, or collect() called directly). | - | TreeNodeBase.model |
parent | readonly | TreeNode<Record<string, unknown>> | null | - | - | TreeNodeBase.parent |
props | readonly | Readonly<P> | - | - | TreeNodeBase.props |
refs | readonly | Readonly<Record<string, Surface>> | - | - | - |
relationDecls | readonly | readonly RelationDecl[] | Relation declarations this element authored, landed at collect and resolved into the model's edges at the end of the pass. | - | TreeNodeBase.relationDecls |
resolved | readonly | ResolvedRefs | - | - | TreeNodeBase.resolved |
rides? | readonly | Readonly<Record<string, string>> | The solvable anchor each of this node's refs rides, by ref key, when it is not the enclosing solvable's first anchor: a span's end plane rides end. From the rides prop. A dim to a ref moves the anchor the ref rides. | - | TreeNodeBase.rides |
source | readonly | readonly SourceLocation[] | Call sites that produced this node, innermost first: the node's own JSX expression, then each enclosing element on the collection path (assembly call sites included, even though assemblies create no nodes). Empty when the code was compiled without call-site emission. | - | TreeNodeBase.source |
transform | readonly | TransformMatrix | Local to the parent: authored, placed from connections, or identity. | - | TreeNodeBase.transform |
type | readonly | PartDef<any> | - | - | TreeNodeBase.type |
BearElement
Defined in: bear/engine/types.ts:555
What createElement returns — a lightweight description of what to build.
P is the part's props; a bare BearElement is an element of any part.
Type Parameters
Properties
| Property | Type | Description |
|---|---|---|
children | BearElement<object>[] | - |
props | P & ElementProps | - |
source? | SourceLocation | JSX call site, present when compiled with dev JSX (jsxDEV). |
type | | string | symbol | PartDef<any, string, string> | AssemblyFn<any> | - |
ConstructionNode
Defined in: bear/engine/types.ts:348
A construction node carries constraint intent (dims, chains), no geometry. Its Ref props stay symbolic for solve.
Extends
TreeNodeBase<P>
Type Parameters
Properties
| Property | Modifier | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|---|
assemblies | readonly | readonly AssemblyFn<Record<string, unknown>>[] | Assembly components whose expansion produced this node, innermost first. Assemblies are transparent (they create no nodes of their own), so this is how a node remembers which components it came from; q(Wall) matches against it. | - | TreeNodeBase.assemblies |
authoredSegment | readonly | string | The authored name before sibling FQN deduplication renamed it. | - | TreeNodeBase.authoredSegment |
children | readonly | readonly TreeNode<Record<string, unknown>>[] | - | - | TreeNodeBase.children |
context? | readonly | ContextMap | Context values provided by this node for descendant lookup. Set from the context prop during collection. Descendants call getContext(node, ctx) to walk the ancestor chain. | - | TreeNodeBase.context |
extents? | readonly | undefined | - | - | - |
fqn | readonly | string | - | - | TreeNodeBase.fqn |
kind | readonly | "construction" | - | TreeNodeBase.kind | - |
model? | readonly | ModelView | The model this node landed in, set when materialize() seals the converged tree. Graph hops from a bare node read its edges here. Absent on a tree that was only collected (a pass that did not converge, or collect() called directly). | - | TreeNodeBase.model |
parent | readonly | TreeNode<Record<string, unknown>> | null | - | - | TreeNodeBase.parent |
props | readonly | Readonly<P> | - | - | TreeNodeBase.props |
refs? | readonly | undefined | - | - | - |
relationDecls | readonly | readonly RelationDecl[] | Relation declarations this element authored, landed at collect and resolved into the model's edges at the end of the pass. | - | TreeNodeBase.relationDecls |
resolved | readonly | ResolvedRefs | - | - | TreeNodeBase.resolved |
rides? | readonly | Readonly<Record<string, string>> | The solvable anchor each of this node's refs rides, by ref key, when it is not the enclosing solvable's first anchor: a span's end plane rides end. From the rides prop. A dim to a ref moves the anchor the ref rides. | - | TreeNodeBase.rides |
source | readonly | readonly SourceLocation[] | Call sites that produced this node, innermost first: the node's own JSX expression, then each enclosing element on the collection path (assembly call sites included, even though assemblies create no nodes). Empty when the code was compiled without call-site emission. | - | TreeNodeBase.source |
transform | readonly | TransformMatrix | Local to the parent: authored, placed from connections, or identity. | - | TreeNodeBase.transform |
type | readonly | PartDef<any> | - | - | TreeNodeBase.type |
Diagnostic
Defined in: bear/engine/types.ts:149
A non-fatal problem found by a phase, about the node it names. Plain data (no node reference) so it serializes across the sandbox boundary.
Properties
| Property | Type | Description |
|---|---|---|
blockedBy? | readonly string[] | Unavailable inputs responsible for this finding, when all are blocked by a failed build. |
fqn | string | The node the finding is about. |
message | string | - |
related? | readonly (readonly SourceLocation[])[] | Call sites of related elements (e.g. the conflicting dims). |
severity | "error" | "warning" | - |
source | readonly SourceLocation[] | Call sites of the element that produced this diagnostic. |
EffectiveDim
Defined in: bear/engine/types.ts:167
A dim's fully resolved intent, produced by solve (see ResolvedDim on
the model). Nothing re-derives chain inheritance. Lengths are
project units.
Properties
| Property | Type | Description |
|---|---|---|
derived? | boolean | True when value was filled in by solve rather than authored. |
direction | "y" | "x" | "z" | - |
eq? | EqGroup | Eq-group token identity, if any. |
from | string | Ref | - |
fromLabel | string | Human-readable endpoint names ("@A", "W.coreExt"), resolved by solve. |
max? | number | - |
measured? | number | The measured span between the resolved planes, when both resolved. |
min? | number | - |
priority | "required" | "strong" | - |
to | string | Ref | - |
toLabel | string | - |
value? | number | Authored value; for a valueless chain link, solve fills in the measured span. |
ElementProps
Defined in: bear/engine/types.ts:535
The props the engine reads on any element, whatever its part.
Extends
Extended by
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
bearsOn? | RelationPropValue | - | RelationProps.bearsOn |
carries? | RelationPropValue | - | RelationProps.carries |
context? | ContextMap | Context values this element provides to its descendants. | - |
cutBy? | RelationPropValue | - | RelationProps.cutBy |
cuts? | RelationPropValue | - | RelationProps.cuts |
fastenedTo? | RelationPropValue | - | RelationProps.fastenedTo |
fedBy? | RelationPropValue | - | RelationProps.fedBy |
feeds? | RelationPropValue | - | RelationProps.feeds |
hosts? | HostedChildren | Collect typed member declarations before building host-owned children. | - |
label? | string | - | - |
name? | string | FQN segment for this element. Falls back to label, then the part name. | - |
refs? | Readonly<Record<string, Surface>> | Named reference planes this element publishes, in its local frame. | - |
rides? | Readonly<Record<string, string>> | The solvable anchor a published ref rides, by ref key. See NodeBase.rides. | - |
transform? | TransformMatrix | This element's pose in its parent frame. | - |
EqGroup
Defined in: bear/engine/types.ts:102
Identity token for an equality group. Dims sharing a token are constrained pairwise equal with no authored value.
Properties
Geometry
Defined in: bear/engine/types.ts:408
A part's solid and how to shade it, built once per model for consumers.
A solid made of several materials tags each source solid with its own
Manifold original ID (reserveIDs, asOriginal) and maps that ID in
materials. Unions and cuts keep each triangle's ID, so the table holds
through them. material shades every triangle whose ID has no entry.
Properties
| Property | Type |
|---|---|
manifold? | Manifold |
material? | MaterialDescriptor |
materials? | Readonly<Record<number, MaterialDescriptor>> |
GeometryNode
Defined in: bear/engine/types.ts:324
A part. Its size is type.extents(props); a part that declares no
extents has none. Its solid lives on the model (geometryOf).
Publishes the planes its type.planes(props) states, beyond the six
box faces every part has.
Extends
TreeNodeBase<P>
Type Parameters
Properties
| Property | Modifier | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|---|
assemblies | readonly | readonly AssemblyFn<Record<string, unknown>>[] | Assembly components whose expansion produced this node, innermost first. Assemblies are transparent (they create no nodes of their own), so this is how a node remembers which components it came from; q(Wall) matches against it. | - | TreeNodeBase.assemblies |
authoredSegment | readonly | string | The authored name before sibling FQN deduplication renamed it. | - | TreeNodeBase.authoredSegment |
children | readonly | readonly TreeNode<Record<string, unknown>>[] | - | - | TreeNodeBase.children |
context? | readonly | ContextMap | Context values provided by this node for descendant lookup. Set from the context prop during collection. Descendants call getContext(node, ctx) to walk the ancestor chain. | - | TreeNodeBase.context |
extents? | readonly | ReferenceExtents | - | - | - |
fqn | readonly | string | - | - | TreeNodeBase.fqn |
kind | readonly | "geometry" | - | TreeNodeBase.kind | - |
model? | readonly | ModelView | The model this node landed in, set when materialize() seals the converged tree. Graph hops from a bare node read its edges here. Absent on a tree that was only collected (a pass that did not converge, or collect() called directly). | - | TreeNodeBase.model |
parent | readonly | TreeNode<Record<string, unknown>> | null | - | - | TreeNodeBase.parent |
props | readonly | Readonly<P> | - | - | TreeNodeBase.props |
refs? | readonly | Readonly<Record<string, Surface>> | - | - | - |
relationDecls | readonly | readonly RelationDecl[] | Relation declarations this element authored, landed at collect and resolved into the model's edges at the end of the pass. | - | TreeNodeBase.relationDecls |
resolved | readonly | ResolvedRefs | - | - | TreeNodeBase.resolved |
rides? | readonly | Readonly<Record<string, string>> | The solvable anchor each of this node's refs rides, by ref key, when it is not the enclosing solvable's first anchor: a span's end plane rides end. From the rides prop. A dim to a ref moves the anchor the ref rides. | - | TreeNodeBase.rides |
source | readonly | readonly SourceLocation[] | Call sites that produced this node, innermost first: the node's own JSX expression, then each enclosing element on the collection path (assembly call sites included, even though assemblies create no nodes). Empty when the code was compiled without call-site emission. | - | TreeNodeBase.source |
transform | readonly | TransformMatrix | Local to the parent: authored, placed from connections, or identity. | - | TreeNodeBase.transform |
type | readonly | PartDef<any> | - | - | TreeNodeBase.type |
MaterialDescriptor
Defined in: bear/engine/types.ts:34
Lightweight POJO describing a material. Maps directly to MeshStandardMaterial properties. Actual Three.js material instantiation is handled by the 3D consumer.
Properties
| Property | Type | Description |
|---|---|---|
color? | number | - |
map? | TextureRef | - |
metalness? | number | - |
normalMap? | TextureRef | - |
opacity? | number | 1 (the default) is opaque; glass is less. |
roughness? | number | - |
NamedNode
Defined in: bear/engine/types.ts:291
Structural node shape for scoped name resolution: ancestry, identity, and a named subtree.
Extends
Properties
| Property | Modifier | Type | Overrides | Inherited from |
|---|---|---|---|---|
authoredSegment | readonly | string | - | - |
children | readonly | readonly NamedNode[] | - | - |
context? | readonly | ContextMap | - | AncestorNode.context |
extents? | readonly | ReferenceExtents | - | - |
fqn | readonly | string | - | - |
kind | readonly | NodeKind | - | - |
parent | readonly | NamedNode | null | AncestorNode.parent | - |
refs? | readonly | Readonly<Record<string, Surface>> | - | - |
rides? | readonly | Readonly<Record<string, string>> | - | - |
transform? | readonly | TransformMatrix | - | AncestorNode.transform |
NodeBase
Defined in: bear/engine/types.ts:215
What collection decides about a node's identity.
Type Parameters
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
assemblies | readonly | readonly AssemblyFn<Record<string, unknown>>[] | Assembly components whose expansion produced this node, innermost first. Assemblies are transparent (they create no nodes of their own), so this is how a node remembers which components it came from; q(Wall) matches against it. |
authoredSegment | readonly | string | The authored name before sibling FQN deduplication renamed it. |
context? | readonly | ContextMap | Context values provided by this node for descendant lookup. Set from the context prop during collection. Descendants call getContext(node, ctx) to walk the ancestor chain. |
fqn | readonly | string | - |
kind | readonly | NodeKind | - |
model? | readonly | ModelView | The model this node landed in, set when materialize() seals the converged tree. Graph hops from a bare node read its edges here. Absent on a tree that was only collected (a pass that did not converge, or collect() called directly). |
props | readonly | Readonly<P> | - |
relationDecls | readonly | readonly RelationDecl[] | Relation declarations this element authored, landed at collect and resolved into the model's edges at the end of the pass. |
rides? | readonly | Readonly<Record<string, string>> | The solvable anchor each of this node's refs rides, by ref key, when it is not the enclosing solvable's first anchor: a span's end plane rides end. From the rides prop. A dim to a ref moves the anchor the ref rides. |
source | readonly | readonly SourceLocation[] | Call sites that produced this node, innermost first: the node's own JSX expression, then each enclosing element on the collection path (assembly call sites included, even though assemblies create no nodes). Empty when the code was compiled without call-site emission. |
type | readonly | PartDef<any> | - |
PartDef()
Defined in: bear/engine/types.ts:518
A part definition created by part().
The call signature exists for JSX compatibility — TypeScript requires JSX
element types to be callable. At runtime, the JSX transform calls
jsx(type, props) rather than type(props).
Extends
PartSpec<P,Roles,Refs>
Type Parameters
| Type Parameter | Default type |
|---|---|
P extends object | Record<string, unknown> |
Roles extends string | string |
Refs extends string | string |
PartDef(props): BearElement<P>;Defined in: bear/engine/types.ts:523
A part definition created by part().
The call signature exists for JSX compatibility — TypeScript requires JSX
element types to be callable. At runtime, the JSX transform calls
jsx(type, props) rather than type(props).
Parameters
| Parameter | Type |
|---|---|
props | P & ElementProps |
Returns
BearElement<P>
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
[BEAR_PART] | true | - | - |
bom? | BomDef | BOM aggregation metadata. If omitted, defaults to { unit: "ea" }. | PartSpec.bom |
check? | (roles, node) => readonly string[] | Physical fit against the resolved roles, read in the same frame place gets. Each returned string becomes a warning on the node, so a connector that does not suit its members says so instead of rendering a plausible lie. Runs whether or not place did. | PartSpec.check |
columns? | (node, geometry) => PartColumn[] | Generate specification columns for the parts list. | PartSpec.columns |
connects? | Record<Roles, ConnectRole> | Connection roles: each key is a prop accepting a relation target, lowered through the role's registered relation spelling. Role props stay on the node (unlike global relation props), so Ref targets resolve when the node is collected. See ConnectRole in relations.ts. | PartSpec.connects |
division | string | CSI MasterFormat division code (e.g. "06 16 00"). | PartSpec.division |
drawing? | (node) => DrawingHints | Provide drawing hints for 2D representation in architectural drawings. | PartSpec.drawing |
extents? | (props, resolved) => Box | The part's bounding box in its local frame, from its props alone (resolved holds the Surfaces its Ref props name). | PartSpec.extents |
geometry? | (props, resolved, loaded?) => Geometry | The part's solid and material, from its props and what load fetched. Defaults to the extents box, unshaded. Synchronous: the materialize that calls it owns every handle it makes. | PartSpec.geometry |
hosted? | Hosted<P> | A part that sits in a host: the faces it reads and the planes that pose it (mate.ts). | PartSpec.hosted |
kind | NodeKind | - | - |
load? | (props) => Promise<Manifold | undefined> | Fetch the solid this part is made from (a cached mesh). Awaited for the converged tree before any geometry is built, so geometry can stay synchronous; resolves to a handle the caller owns. | PartSpec.load |
loadKey? | (props) => string | What load reads from the props. Props with the same key are one shape: loaded once, shared between instances and kept across builds (shapes.ts). Without it every instance loads its own solid. | PartSpec.loadKey |
panelSize? | (props) => readonly [number, number] | Stock face dimensions in project units (U, V), before clipping to a placement. | PartSpec.panelSize |
place? | (roles, node) => TransformMatrix | Derive the part's pose in its parent frame from its resolved connection roles (given in that same frame). Runs when the part is collected and nothing authored a transform; a throw becomes a diagnostic. | PartSpec.place |
planes? | (props, resolved) => Readonly<Record<Refs, Surface>> | The named reference planes a geometry part publishes, in its local frame, keyed by the names in refs (a hanger's seat, a tee's ports). The six box faces need no entry. | PartSpec.planes |
refs? | readonly Refs[] | Named refs this part publishes (e.g. ["top"], ["ext", "int"]). | PartSpec.refs |
PartSpec
Defined in: bear/engine/types.ts:430
What a part definition declares, defined once: PartDef is a built one
and part()'s PartDefInput is the authoring shape, both extending this.
Everything a part knows about itself is a function of its props. extents
is the one the engine consumes (default reference faces, assembly spans,
connector roles); geometry is for consumers that need a solid.
Roles and Refs are the part's interface contract, stated in its type:
a PartDef<P, "header" | "joist", "seat"> is a part whose connects has
exactly those roles, whose place/check read exactly those roles, and
whose planes publishes exactly those names. An assembly can then demand
the contract rather than the vendor (see JoistHangerPart in
blueprints/connectors/types.ts), and a part missing a role is a compile
error at the site that builds it.
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
P | Record<string, unknown> |
Roles extends string | string |
Refs extends string | string |
Properties
| Property | Type | Description |
|---|---|---|
bom? | BomDef | BOM aggregation metadata. If omitted, defaults to { unit: "ea" }. |
check? | (roles, node) => readonly string[] | Physical fit against the resolved roles, read in the same frame place gets. Each returned string becomes a warning on the node, so a connector that does not suit its members says so instead of rendering a plausible lie. Runs whether or not place did. |
columns? | (node, geometry) => PartColumn[] | Generate specification columns for the parts list. |
connects? | Record<Roles, ConnectRole> | Connection roles: each key is a prop accepting a relation target, lowered through the role's registered relation spelling. Role props stay on the node (unlike global relation props), so Ref targets resolve when the node is collected. See ConnectRole in relations.ts. |
division | string | CSI MasterFormat division code (e.g. "06 16 00"). |
drawing? | (node) => DrawingHints | Provide drawing hints for 2D representation in architectural drawings. |
extents? | (props, resolved) => Box | The part's bounding box in its local frame, from its props alone (resolved holds the Surfaces its Ref props name). |
geometry? | (props, resolved, loaded?) => Geometry | The part's solid and material, from its props and what load fetched. Defaults to the extents box, unshaded. Synchronous: the materialize that calls it owns every handle it makes. |
hosted? | Hosted<P> | A part that sits in a host: the faces it reads and the planes that pose it (mate.ts). |
load? | (props) => Promise<Manifold | undefined> | Fetch the solid this part is made from (a cached mesh). Awaited for the converged tree before any geometry is built, so geometry can stay synchronous; resolves to a handle the caller owns. |
loadKey? | (props) => string | What load reads from the props. Props with the same key are one shape: loaded once, shared between instances and kept across builds (shapes.ts). Without it every instance loads its own solid. |
panelSize? | (props) => readonly [number, number] | Stock face dimensions in project units (U, V), before clipping to a placement. |
place? | (roles, node) => TransformMatrix | Derive the part's pose in its parent frame from its resolved connection roles (given in that same frame). Runs when the part is collected and nothing authored a transform; a throw becomes a diagnostic. |
planes? | (props, resolved) => Readonly<Record<Refs, Surface>> | The named reference planes a geometry part publishes, in its local frame, keyed by the names in refs (a hanger's seat, a tee's ports). The six box faces need no entry. |
refs? | readonly Refs[] | Named refs this part publishes (e.g. ["top"], ["ext", "int"]). |
SourceLocation
Defined in: bear/engine/types.ts:208
A JSX call site, injected by the compiler's dev JSX transform. Line and column are 1-based, in the original (pre-compile) source.
Properties
Type Aliases
AssemblyFn
type AssemblyFn<P> = (props) => BearElement;Defined in: bear/engine/types.ts:532
An assembly function — like React's FC<P>. Generic over props; defaults to Record<string, unknown>.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
props | P |
Returns
ContextMap
type ContextMap = Map<symbol, unknown>;Defined in: bear/engine/types.ts:19
A map of context values keyed by unique symbols from BearContext objects.
ErasedProps
type ErasedProps = Readonly<Record<string, unknown>> & ElementProps;Defined in: bear/engine/types.ts:565
Props with the part's own erased: the bag the engine's phases iterate.
NodeKind
type NodeKind = "geometry" | "assembly" | "construction";Defined in: bear/engine/types.ts:192
Discriminant for node types.
Ref
type Ref = object;Defined in: bear/engine/types.ts:65
A lightweight pointer to a named reference plane on another element. Faces are the common kind of ref; centerlines and other construction planes use the same mechanism. Resolved during collection.
Properties
| Property | Modifier | Type |
|---|---|---|
[BEAR_REF] | readonly | true |
key | readonly | string |
source | readonly | BearElement |
ResolvedRefs
type ResolvedRefs = Readonly<Record<string, Surface>>;Defined in: bear/engine/types.ts:307
Prop keys whose JSX value was a Ref, resolved to Surfaces in the node's parent frame when collected. Props themselves are frozen and never mutated; consumers read resolved values from here.
TextureRef
type TextureRef =
| {
filename: string;
source: "bucket";
}
| {
options?: ImageTransformOptions;
source: "project";
uri: string;
};Defined in: bear/engine/types.ts:25
Texture reference — a lightweight pointer to a texture asset. Actual loading is deferred to the 3D consumer.
TreeNode
type TreeNode<P> =
| GeometryNode<P>
| AssemblyNode<P>
| ConstructionNode<P>;Defined in: bear/engine/types.ts:357
A node of the model: geometry, assembly, or construction.
Type Parameters
Variables
BEAR_PART
const BEAR_PART: typeof BEAR_PART;Defined in: bear/engine/types.ts:45
Marker symbol for part defs.
BEAR_REF
const BEAR_REF: typeof BEAR_REF;Defined in: bear/engine/types.ts:58
Marker symbol for references.
EQ_GROUP
const EQ_GROUP: typeof EQ_GROUP;Defined in: bear/engine/types.ts:96
Marker symbol for eq-group tokens.
Functions
elementProps()
function elementProps(element): ErasedProps;Defined in: bear/engine/types.ts:568
An element's props, erased.
Parameters
| Parameter | Type |
|---|---|
element | BearElement |
Returns
getRef()
function getRef(element, key): Ref;Defined in: bear/engine/types.ts:81
Extract a named Ref from an element.
Parameters
| Parameter | Type |
|---|---|
element | BearElement |
key | string |
Returns
isAssemblyNode()
function isAssemblyNode<N>(node): node is N & { kind: "assembly" };Defined in: bear/engine/types.ts:374
Narrow a node to its assembly variant.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
node | N |
Returns
node is N & { kind: "assembly" }
isConstructionNode()
function isConstructionNode<N>(node): node is N & { kind: "construction" };Defined in: bear/engine/types.ts:381
Narrow a node to its construction variant.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
node | N |
Returns
node is N & { kind: "construction" }
isEqGroup()
function isEqGroup(value): value is EqGroup;Defined in: bear/engine/types.ts:107
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
value is EqGroup
isGeometryNode()
function isGeometryNode<N>(node): node is N & { kind: "geometry" };Defined in: bear/engine/types.ts:367
Narrow a node to its geometry variant.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
node | N |
Returns
node is N & { kind: "geometry" }
isPartDef()
function isPartDef(type): type is PartDef<Record<string, unknown>, string, string>;Defined in: bear/engine/types.ts:48
Narrow an element type to a PartDef (vs assembly function / host element).
Parameters
| Parameter | Type |
|---|---|
type | unknown |
Returns
type is PartDef<Record<string, unknown>, string, string>
isRef()
function isRef(value): value is Ref;Defined in: bear/engine/types.ts:71
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
value is Ref
resolvedSurface()
function resolvedSurface(node, key): Surface | undefined;Defined in: bear/engine/types.ts:120
Read a prop that may be authored as a Ref (resolved during collection into
node.resolved) or directly as a Surface. Returns undefined when neither.
Parameters
| Parameter | Type |
|---|---|
node | { props: object; resolved?: Readonly<Record<string, Surface>>; } |
node.props | object |
node.resolved? | Readonly<Record<string, Surface>> |
key | string |
Returns
Surface | undefined
segmentOf()
function segmentOf(node): string;Defined in: bear/engine/types.ts:270
A node's FQN segment, after sibling deduplication renamed it (J@16-2).
A segment may itself contain dots (Wall.001 from an IFC import, J@70.5
from a position label), so it comes off the parent's FQN: splitting an FQN
on "." reports 5 for J@70.5.
Parameters
| Parameter | Type |
|---|---|
node | { fqn: string; parent: | { fqn: string; } | null; } |
node.fqn | string |
node.parent | | { fqn: string; } | null |
Returns
string
walkNodes()
function walkNodes<N>(node, visit): void;Defined in: bear/engine/types.ts:388
Depth-first pre-order walk over a node tree.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
node | N |
visit | (node) => void |
Returns
void