Skip to content

core/shapePayload

Interfaces

ShapeLike

Defined in: core/shapePayload.ts:15

Minimal structural requirement for a shape payload entry.

Properties

lat?
optional lat?: number[];

Defined in: core/shapePayload.ts:16

lon?
optional lon?: number[];

Defined in: core/shapePayload.ts:17


ShapePayloadResult

Defined in: core/shapePayload.ts:20

Type Parameters

T

T extends ShapeLike

Properties

validShapes
validShapes: T[];

Defined in: core/shapePayload.ts:22

Shapes that passed lat/lon validation, in payload order.

skipped
skipped: string[];

Defined in: core/shapePayload.ts:24

Labels of entries that failed validation (dict key or array index).

isEmpty
isEmpty: boolean;

Defined in: core/shapePayload.ts:26

True when the payload was an empty/invalid dictionary envelope.

dictNames
dictNames: string[] | null;

Defined in: core/shapePayload.ts:33

All names present in a dictionary envelope (even empty or invalid entries), or null for the legacy single/array formats. The dictionary envelope carries the node's complete shape set, so a stored shape missing from this list was deleted server-side.

Functions

hasValidLatLon()

function hasValidLatLon(shape): shape is ShapeLike;

Defined in: core/shapePayload.ts:39

A shape is renderable only when it carries non-empty lat AND lon arrays.

Parameters

shape

unknown

Returns

shape is ShapeLike


parseShapePayload()

function parseShapePayload<T>(data): ShapePayloadResult<T>;

Defined in: core/shapePayload.ts:49

Normalize any of the three payload formats into a flat list of valid shapes plus the labels of the entries that failed validation.

Type Parameters

T

T extends ShapeLike

Parameters

data

unknown

Returns

ShapePayloadResult\<T>