/** * Copyright (c) 2018-2025 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal */ import { StateTransformer } from './transformer.js'; export { Transform as StateTransform }; interface Transform { readonly parent: Transform.Ref; readonly transformer: T; readonly state: Transform.State; readonly tags?: string[]; readonly ref: Transform.Ref; /** * Sibling-like dependency * Do NOT make a cell dependent on its ancestor. */ readonly dependsOn?: Transform.Ref[]; readonly params?: StateTransformer.Params; readonly version: string; } declare namespace Transform { type Ref = string; type Transformer = T extends Transform ? S : never; const RootRef: Ref; interface State { isGhost?: boolean; isLocked?: boolean; isHidden?: boolean; isCollapsed?: boolean; } function isStateChange(a: State, b?: Partial): boolean; function assignState(a: State, b?: Partial): boolean; function syncState(a: State, b?: Partial): boolean; interface Options { ref?: string; tags?: string | string[]; state?: State; dependsOn?: Ref[]; } function create(parent: Ref, transformer: T, params?: StateTransformer.Params, options?: Options): Transform; function withParams(t: Transform, params: any): Transform; function withState(t: Transform, state?: Partial): Transform; function withTags(t: Transform, newTags?: string | string[]): Transform; function withDependsOn(t: Transform, newDependsOn?: string | string[]): Transform; function withParent(t: Transform, parent: Ref): Transform; function createRoot(state?: State): Transform; function hasTag(t: Transform, tag: string): boolean; function hasTags(t: Transform, tags: string | string[]): boolean; /** Updates the version of the transform to be computed as hash of the parameters */ function setParamsHashVersion(t: Transform): void; interface Serialized { parent: string; transformer: string; params: any; state?: State; tags?: string[]; isDecorator?: boolean; ref: string; dependsOn?: string[]; version: string; } function toJSON(t: Transform): Serialized; function fromJSON(t: Serialized): Transform; }