/** @packageDocumentation * @module Hierarchies */ import { LabelDefinition, LabelDefinitionJSON } from "../LabelDefinition"; import { NodeKey, NodeKeyJSON } from "./Key"; /** * Data structure that describes a tree node. * @public */ export interface Node { /** A key that uniquely identifies a node. */ key: NodeKey; /** Definition of node display label */ label: LabelDefinition; /** Extensive description */ description?: string; /** Image ID */ imageId?: string; /** Foreground color */ foreColor?: string; /** Background color */ backColor?: string; /** Font style */ fontStyle?: string; /** Does this node have child nodes */ hasChildren?: boolean; /** Is this node selectable */ isSelectionDisabled?: boolean; /** Is this node editable */ isEditable?: boolean; /** Is this node expanded */ isExpanded?: boolean; /** Is checkbox visible for this node */ isCheckboxVisible?: boolean; /** Is this node's checkbox checked */ isChecked?: boolean; /** Is this node's checkbox enabled */ isCheckboxEnabled?: boolean; /** Extended data injected into this node */ extendedData?: { [key: string]: any; }; } /** * Serialized [[Node]] JSON representation. * @public */ export interface NodeJSON { key: NodeKeyJSON; labelDefinition: LabelDefinitionJSON; description?: string; imageId?: string; foreColor?: string; backColor?: string; fontStyle?: string; hasChildren?: boolean; isSelectionDisabled?: boolean; isEditable?: boolean; isExpanded?: boolean; isCheckboxVisible?: boolean; isChecked?: boolean; isCheckboxEnabled?: boolean; extendedData?: { [key: string]: any; }; } /** * Partial node definition. * @public */ export declare type PartialNode = AllOrNone, "key" | "label">; /** * Serialized [[PartialNode]] JSON representation. * @public */ export declare type PartialNodeJSON = AllOrNone, "key" | "labelDefinition">; declare type AllOrNone = Omit & ({ [K in P]?: never; } | Required>); /** @public */ export declare namespace Node { /** Serialize given [[Node]] to JSON */ function toJSON(node: Node): NodeJSON; /** @internal */ function toPartialJSON(node: PartialNode): PartialNodeJSON; /** Deserialize [[Node]] from JSON */ function fromJSON(json: NodeJSON | string): Node; /** @internal */ function fromPartialJSON(json: PartialNodeJSON): PartialNode; /** * Reviver function that can be used as a second argument for * `JSON.parse` method when parsing [[Node]] objects. * * @internal */ function reviver(key: string, value: any): any; /** * Deserialize nodes list from JSON * @param json JSON or JSON serialized to string to deserialize from * @returns Deserialized nodes list * * @internal */ function listFromJSON(json: NodeJSON[] | string): Node[]; /** * Reviver function that can be used as a second argument for * `JSON.parse` method when parsing [[Node]][] objects. * * @internal */ function listReviver(key: string, value: any): any; } export {}; //# sourceMappingURL=Node.d.ts.map