import { Builder } from "@dawntech/dwntbots-models"; export declare enum DiffMode { "ADDED" = "+", "REMOVED" = "-", "UPDATED" = "~", "UNCHANGED" = "*" } export declare enum DiffType { "PROPERTY" = "Property", "ARRAY" = "Array", "TEXT" = "Text", "ENTITY" = "Entity", "ENTITY_ARRAY" = "EntityArray", "BLOCK" = "Block", "CONFIG" = "Config", "FLOW" = "Flow", "ENTERING_ACTIONS" = "EnteringActions", "LEAVING_ACTIONS" = "LeavingActions", "CONDITION_OUTPUTS" = "ConditionOutputs", "CONTENT_ACTIONS" = "ContentActions", "ENTERING_ACTION" = "EnteringAction", "LEAVING_ACTION" = "LeavingAction", "CONDITION_OUTPUT" = "ConditionOutput", "CONTENT_ACTION" = "ContentAction", "INPUT" = "Input", "MESSAGE" = "Message", "RAW_MESSAGE" = "RawMessage", "EXECUTE_SCRIPT" = "ExecuteScript" } export interface DiffPosition { from: number; to: number; } export interface DiffSingleData { from: Primitive | null; to: Primitive | null; } export interface DiffMultiData { mode: DiffMode; value: Primitive; } export interface DiffBase { name: string; type: DiffType; mode: DiffMode; } export declare type DiffLeafType = DiffType.PROPERTY | DiffType.TEXT; export interface DiffLeaf extends DiffBase { type: DiffLeafType; data: DiffSingleData; } export declare type DiffArrayLeafType = DiffType.ARRAY; export interface DiffArrayLeaf extends DiffBase { type: DiffArrayLeafType; data: Array; } export declare type DiffEntityType = DiffType.BLOCK | DiffType.CONFIG | DiffType.ENTERING_ACTION | DiffType.LEAVING_ACTION | DiffType.CONDITION_OUTPUT | DiffType.CONTENT_ACTION | DiffType.ENTITY; export interface DiffEntity extends DiffBase { id: string; type: DiffEntityType; changes: Array; position?: DiffPosition; } export declare type DiffArrayEntityType = DiffType.ENTITY_ARRAY; export interface DiffArrayEntity extends DiffBase { type: DiffArrayEntityType; changes: Array; } export declare type Diff = DiffLeaf | DiffArrayLeaf | DiffEntity | DiffArrayEntity; export declare const isDiffLeaf: (diff: Diff) => diff is DiffLeaf | DiffArrayLeaf; export declare const isDiffEntity: (diff: Diff) => diff is DiffEntity | DiffArrayEntity; export declare const isEntityKey: (data_key: string) => boolean; export declare const getKeyType: (data_key: string) => DiffEntityType; export declare const makeTypeEntity: (type: DiffType | string) => DiffEntityType; interface Traversal { id: string; name: string; type: DiffType; data: Record>; } declare type Primitive = string | number | boolean; declare type TraversalData = Traversal | Object | Primitive; interface JsonDiff { key: string; mode: DiffMode; new: Primitive | null; old: Primitive | null; list: Array | null; } export declare const __json_diff: (base: Record>, keys?: Array) => JsonDiff[]; export declare const json_diff: (source: Object, target: Object) => Array; interface ArrayDiff { data: T; mode: DiffMode; position: DiffPosition; } export declare const array_diff: (source: T[], target: T[]) => ArrayDiff[]; interface ArrayTraversalDiff { id: string; name: string; type: DiffEntityType; source: Traversal; target: Traversal; mode: DiffMode; position: DiffPosition; } export declare const array_element_diff: (source: Array, target: Array) => Array; export declare const data_json_diff: (source: Object, target: Object, mode?: DiffMode) => (DiffLeaf | DiffArrayLeaf)[]; export declare const transformBlock: (block: Builder.Block, flow: Builder.Flow) => Traversal; export declare const blipBlockDiff: (source: Builder.Block, target: Builder.Block) => { name: string; type: DiffMode; }; export declare const blipFlowDiff: (source: Builder.Flow, target: Builder.Flow, simplify?: boolean) => Diff; export declare const transformConfig: (config: Builder.Configuration) => Record; export declare const blipConfigDiff: (source: Builder.Configuration, target: Builder.Configuration) => any; export declare const blipBotDiff: (source: Builder.Bot, target: Builder.Bot) => { flow: Diff; configuration: any; globalActions: { name: string; type: DiffMode; }; }; export {};