gi-nx / GiraffeState
Properties
| Property | Type |
|---|---|
attr | GiraffeStateAttrMap |
listeners | Record<string, any> |
Methods
addListener()
ts
addListener(keys: (
| "project"
| "selected"
| "mapView"
| "mapContent"
| "mapSelectCoord"
| "projects"
| "bakedSections"
| "projectLayers"
| "rawSections"
| "flows"
| "blocks"
| "projectOrigin"
| "projectAppsByAppID"
| "layerTree"
| "selectedProjectApp"
| "mapHoverCoords"
| "closingSignal"
| "uiLayout"
| "contextMenuClick"
| "views"
| "mapboxEvent"
| "workspace"
| "visibleScenarios")[], listener: (key:
| "project"
| "selected"
| "mapView"
| "mapContent"
| "mapSelectCoord"
| "projects"
| "bakedSections"
| "projectLayers"
| "rawSections"
| "flows"
| "blocks"
| "projectOrigin"
| "projectAppsByAppID"
| "layerTree"
| "selectedProjectApp"
| "mapHoverCoords"
| "closingSignal"
| "uiLayout"
| "contextMenuClick"
| "views"
| "mapboxEvent"
| "workspace"
| "visibleScenarios", event: MessageEvent) => void): string;Parameters
| Parameter | Type |
|---|---|
keys | ( | "project" | "selected" | "mapView" | "mapContent" | "mapSelectCoord" | "projects" | "bakedSections" | "projectLayers" | "rawSections" | "flows" | "blocks" | "projectOrigin" | "projectAppsByAppID" | "layerTree" | "selectedProjectApp" | "mapHoverCoords" | "closingSignal" | "uiLayout" | "contextMenuClick" | "views" | "mapboxEvent" | "workspace" | "visibleScenarios")[] |
listener | (key: | "project" | "selected" | "mapView" | "mapContent" | "mapSelectCoord" | "projects" | "bakedSections" | "projectLayers" | "rawSections" | "flows" | "blocks" | "projectOrigin" | "projectAppsByAppID" | "layerTree" | "selectedProjectApp" | "mapHoverCoords" | "closingSignal" | "uiLayout" | "contextMenuClick" | "views" | "mapboxEvent" | "workspace" | "visibleScenarios", event: MessageEvent) => void |
Returns
string
get()
ts
get<K>(key: K): GiraffeStateGet[K];Type Parameters
| Type Parameter |
|---|
K extends | "project" | "selected" | "mapView" | "mapContent" | "mapSelectCoord" | "projects" | "bakedSections" | "projectLayers" | "rawSections" | "flows" | "blocks" | "projectOrigin" | "projectAppsByAppID" | "layerTree" | "selectedProjectApp" | "mapHoverCoords" | "closingSignal" | "uiLayout" | "contextMenuClick" | "views" | "mapboxEvent" | "workspace" | "visibleScenarios" |
Parameters
| Parameter | Type |
|---|---|
key | K |
Returns
Remarks
The returned snapshot is read-only. Don’t mutate it. Copy before editing: const editable = structuredClone(snap) (deep) or const editable = { ...snap } (shallow).
listen()
ts
listen(): void;Returns
void
removeAllListeners()
ts
removeAllListeners(): void;Returns
void
removeListener()
ts
removeListener(listenerKey: any): void;Parameters
| Parameter | Type |
|---|---|
listenerKey | any |
Returns
void
set()
ts
set<K>(
key: K,
value: Partial<GiraffeStateSelected & GiraffeStateMapView & GiraffeStateMapContent & GiraffeStateMapSelectCoord & GiraffeStateProjects & GiraffeStateBakedSections & GiraffeStateProjectLayers & GiraffeStateRawSections & GiraffeStateFlows & GiraffeStateBlocks & GiraffeStateProject & GiraffeStateProjectOrigin & GiraffeStateProjectAppsByAppID & GiraffeStateLayerTree & GiraffeStateSelectedProjectApp & GiraffeStateMapHoverCoords & GiraffeStateClosingSignal & GiraffeStateUiLayout & GiraffeStateContextMenuClick & GiraffeStateViews & GiraffeStateMapboxEvent & GiraffeStateWorkspace & GiraffeStateVisibleScenarios>[K],
event: MessageEvent): void;Type Parameters
| Type Parameter |
|---|
K extends | "project" | "selected" | "mapView" | "mapContent" | "mapSelectCoord" | "projects" | "bakedSections" | "projectLayers" | "rawSections" | "flows" | "blocks" | "projectOrigin" | "projectAppsByAppID" | "layerTree" | "selectedProjectApp" | "mapHoverCoords" | "closingSignal" | "uiLayout" | "contextMenuClick" | "views" | "mapboxEvent" | "workspace" | "visibleScenarios" |
Parameters
Returns
void