Skip to content

gi-nx


gi-nx / updateBlock

ts
function updateBlock(blockId: string, updatedBlock: Partial<{
  description?: string;
  features: (
     | PreStackedPoint
     | PreStackedLineString
    | PreStackedPolygon<Record<string, any>>)[];
  id: string;
  keyWords?: string[];
  name: string;
  properties?: Record<string, any>;
}>): void;

Updates an existing block definition by merging the provided fields. The block's id cannot be changed.

Parameters

ParameterTypeDescription
blockIdstringThe id of the block to update.
updatedBlockPartial<{ description?: string; features: ( | PreStackedPoint | PreStackedLineString | PreStackedPolygon<Record<string, any>>)[]; id: string; keyWords?: string[]; name: string; properties?: Record<string, any>; }>Partial block definition with fields to update.

Returns

void

Throws

If no block with the given id exists.

Example

ts
gi.updateBlock("94d84733617e4c2d91b87a4da6106e8a", {
  name: "My Updated Block",
  description: "An updated description."
});