Skip to main content

ArrayIndexes

Numeric node access with parent-aware array item types.

Import

import type { ArrayIndexes } from '@ngblocks/form-nodes';

When to use it

Use when describing an array node's numeric property access. Each indexed item retains the owning array as its parent.

Declaration

type ArrayIndexes<TItem extends AnyNode, TParent extends AnyNode> = {
readonly [index: number]: ArrayItemWithParent<TItem, ArrayNode<TItem, TParent>> | undefined;
};

Type parameters

ParameterConstraintDefault
TItemAnyNodeRequired
TParentAnyNodeRequired