/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { BooleanType, DictType, OptionType, StringType, StructType, type ValueTypeOf } from "@elaraai/east"; import type { SchematicLayerValue } from "./canvas/layers.js"; /** * The viewer's layer choices, as the UI store holds them. * * @property shown - Each layer the viewer showed or hid, by its key: over its author's `visible` * @property locked - Each layer the viewer locked or unlocked, by its key: over its author's `locked` * @property isolated - The layer shown alone; `none` while none is */ export declare const SchematicLayerViewType: StructType<{ readonly shown: DictType; readonly locked: DictType; readonly isolated: OptionType; }>; /** The viewer's layer choices, decoded. */ export type SchematicLayerView = ValueTypeOf; /** No choice yet: every layer as its author has it. */ export declare const NO_LAYER_VIEW: SchematicLayerView; /** * Whether a layer shows now: the isolated one alone while one is, else the * viewer's choice, else its author's default — shown unless it says otherwise. * * @param layer - The layer * @param view - The viewer's choices * @returns Whether it shows */ export declare function layerShown(layer: SchematicLayerValue, view: SchematicLayerView): boolean; /** * Whether a layer is locked now: the viewer's choice, else its author's * default — unlocked unless it says otherwise. * * @param layer - The layer * @param view - The viewer's choices * @returns Whether its entities never select */ export declare function layerLocked(layer: SchematicLayerValue, view: SchematicLayerView): boolean; /** * The layers as the drawing obeys them: each one's `visible` and `locked` the * viewer's choices over its author's defaults (see the module docs). * * @param layers - The layers, in their order * @param view - The viewer's choices * @returns The layers, each as it shows and locks now; the layers themselves while the viewer has chosen nothing */ export declare function layersInForce(layers: readonly SchematicLayerValue[], view: SchematicLayerView): readonly SchematicLayerValue[]; /** * Show or Hide: the layer flipped as it shows now, isolation counted, and the * isolation ended. * * @param layers - The layers * @param view - The viewer's choices * @param key - The layer's key * @returns The choices after it */ export declare function toggleShown(layers: readonly SchematicLayerValue[], view: SchematicLayerView, key: string): SchematicLayerView; /** * Lock or unlock a layer, as it is locked now. * * @param layers - The layers * @param view - The viewer's choices * @param key - The layer's key * @returns The choices after it */ export declare function toggleLocked(layers: readonly SchematicLayerValue[], view: SchematicLayerView, key: string): SchematicLayerView; /** * Isolate a layer, or end its isolation. * * @param view - The viewer's choices * @param key - The layer's key * @returns The choices after it */ export declare function toggleIsolated(view: SchematicLayerView, key: string): SchematicLayerView; /** * Show all: every layer shown, the ones its author hides at first among them, * the isolation ended and the locks kept. * * @param layers - The layers * @param view - The viewer's choices * @returns The choices after it */ export declare function showAll(layers: readonly SchematicLayerValue[], view: SchematicLayerView): SchematicLayerView; /** * Whether any layer is hidden now, isolation counted: what offers Show all. * * @param layers - The layers * @param view - The viewer's choices * @returns Whether one is */ export declare function anyHidden(layers: readonly SchematicLayerValue[], view: SchematicLayerView): boolean; /** * The viewer's layer choices under a key, and the write that changes them — * every Schematic under that key follows it (see the module docs). * * @param key - The Schematic's layers key (`schematicKeys(id).layers`) * @returns What the store holds — no choice until the viewer makes one — and the write */ export declare function useSchematicLayerView(key: string): [SchematicLayerView, (next: SchematicLayerView) => void]; //# sourceMappingURL=layers-view.d.ts.map