flatNodes

Returns every mark among a node's children with the cue wrappers unwrapped, whether or not a given mark is on screen yet.

@internote/canvas-sdkFunction
On this page
import { flatNodes } from '@internote/canvas-sdk';

What anything that needs to see the whole picture reads: the frame deciding its domains, the footer listing what is there, the walk that collects an environment's free letters. For the marks a reader can see right now, use visibleNodes.

#Signature

<N extends NodeLike>(children: readonly N[]): N[]

#Parameters

children
An environment's children, as childNodes returns them.

#Returns

The marks in source order, with every cue's contents in its place.

#Example

const points = flatNodes(childNodes(ctx.node.body)).filter((node) => node.identifier === 'point');

Declared in packages/canvas-sdk/src/environment/nodes.ts:125.

Last updated