gi-nx / getBlock
ts
function getBlock(blockId: string): {
description?: string;
features: (
| PreStackedPoint
| PreStackedLineString
| PreStackedPolygon<Record<string, any>>)[];
id: string;
keyWords?: string[];
name: string;
properties?: Record<string, any>;
};Returns the block definition for the given id, or undefined if not found.
Parameters
| Parameter | Type | Description |
|---|---|---|
blockId | string | The id of the block to retrieve. |
Returns
| Name | Type |
|---|---|
description? | string |
features | ( | PreStackedPoint | PreStackedLineString | PreStackedPolygon<Record<string, any>>)[] |
id | string |
keyWords? | string[] |
name | string |
properties? | Record<string, any> |
Example
ts
const block = gi.getBlock("94d84733617e4c2d91b87a4da6106e8a");
if (block) {
console.log(block.name); // "My Cool Block"
}