import { SpecifyCollectionSettings } from '../../definitions/index.js'; import { SpecifyDesignTokenCollectionProperties } from '../../definitions/internals/designTokenCollection.js'; import { TreeNodeInterface, TreeNodeState } from './TreeNodeState.js'; import { TreeState } from './TreeState.js'; import { TreeNodeExtensions } from '../../definitions/internals/designTokenTree.js'; import { TokenState } from './TokenState.js'; import { GroupState } from './GroupState.js'; import { AnalyzedSDTFNode } from '../parser/internals/AnalyzedSDTFNode.js'; import { AnalyzedCollection } from '../parser/internals/parseRawCollection.js'; import { TreePath } from './path/TreePath.js'; export type CollectionAllowedModes = [string, ...Array]; export type CollectionStateParams = AnalyzedSDTFNode & { $description?: string | undefined; $extensions?: TreeNodeExtensions | undefined; allowedModes: Array; }; export declare class CollectionState extends TreeNodeState implements TreeNodeInterface { #private; readonly isToken = false; readonly isGroup = false; readonly isCollection = true; constructor(treeState: TreeState, { path, name, $description, $extensions, allowedModes }: CollectionStateParams); /** * Get the allowed modes of the Collection or its parent collection (recursively). */ get allowedModes(): [string, ...string[]]; /** * Get the allowed modes of the Collection exclusively. */ get innerAllowedModes(): [string, ...string[]]; /** * Use `innerAllowedModes` instead. * @deprecated */ getAllowedModes(): [string, ...string[]]; /** * Use `allowedModes` instead. * @deprecated */ resolveAllowedModes(): [string, ...string[]]; /** * Get the JSON object corresponding to `$collection`. */ getCollectionSettings(): SpecifyCollectionSettings; /** * Returns all direct group children of the Collection */ getGroupChildren(): GroupState[]; /** * Returns all direct tokens children of the Collection */ getTokenChildren(): TokenState<"string" | "number" | "boolean" | "object" | "null" | "array" | "integerNumber" | "zeroToOneNumber" | "arcDegreeNumber" | "rgbColorNumber" | "positiveNumber" | "positiveIntegerNumber" | "percentageNumber" | "hexadecimalColorString" | "bitmap" | "bitmaps" | "bitmapFormat" | "blur" | "border" | "borderStyle" | "borderStyleLineCap" | "breakpoint" | "color" | "cubicBezier" | "dimension" | "dimensionUnit" | "duration" | "durationUnit" | "font" | "fontFamily" | "fontFeature" | "fontFeatures" | "fontFormat" | "fontStyle" | "fontWeight" | "gradient" | "gradients" | "opacity" | "radius" | "radii" | "shadow" | "shadows" | "shadowType" | "spacing" | "spacings" | "stepsTimingFunction" | "textAlignHorizontal" | "textAlignVertical" | "textDecoration" | "textStyle" | "textTransform" | "transition" | "vector" | "vectors" | "vectorFormat" | "zIndex", unknown, string>[]; /** * Returns all group children of the Collection */ getAllGroupChildren(): GroupState[]; /** * Returns all token children of the Collection */ getAllTokenChildren(): TokenState<"string" | "number" | "boolean" | "object" | "null" | "array" | "integerNumber" | "zeroToOneNumber" | "arcDegreeNumber" | "rgbColorNumber" | "positiveNumber" | "positiveIntegerNumber" | "percentageNumber" | "hexadecimalColorString" | "bitmap" | "bitmaps" | "bitmapFormat" | "blur" | "border" | "borderStyle" | "borderStyleLineCap" | "breakpoint" | "color" | "cubicBezier" | "dimension" | "dimensionUnit" | "duration" | "durationUnit" | "font" | "fontFamily" | "fontFeature" | "fontFeatures" | "fontFormat" | "fontStyle" | "fontWeight" | "gradient" | "gradients" | "opacity" | "radius" | "radii" | "shadow" | "shadows" | "shadowType" | "spacing" | "spacings" | "stepsTimingFunction" | "textAlignHorizontal" | "textAlignVertical" | "textDecoration" | "textStyle" | "textTransform" | "transition" | "vector" | "vectors" | "vectorFormat" | "zIndex", unknown, string>[]; /** * Rename the Collection * @param newName */ rename(newName: string): boolean; /** * Rename a mode of the Collection - recursively renaming all token children modes * @param fromMode * @param toMode */ renameMode(fromMode: string, toMode: string): void; /** * Delete a mode of the Collection - recursively delete all token children mode value * @param mode */ deleteMode(mode: string): void; /** * Get serializable JSON representation of the Collection * @internal */ getJSONProperties(): SpecifyDesignTokenCollectionProperties; /** * Get serializable JSON representation of the Collection with its children * @internal */ toJSON(): { $collection: { $modes: [string, ...string[]]; }; $description?: string | undefined; $extensions?: Record | null> | undefined; }; move(toPath: TreePath): void; toCollectionStateParams(): CollectionStateParams; toAnalyzedCollection(): AnalyzedCollection; }