import { YAMLMap, Range } from "yaml"; export declare function parse(item?: string, throwIfError?: boolean): T | undefined; export declare function stringify(item: any): string; export declare function sort(value: Record): string[]; export declare function pairsToMap(pairs?: any[]): YAMLMap; export declare function getPathFromSectionAndId({ source, section, id, }: { source: string; section: string; id: string; }): string | undefined; export declare function extractBlock({ source, section, key, keyName }: { source: string; section: string; key: string; keyName?: string; }): string | undefined; export declare function extractBlockWithPath({ source, path }: { source: string; path: string; }): string | undefined; export declare function replaceBlockWithPath({ source, path, newContent }: { source: string; path: string; newContent: string; }): string; export declare function replaceBlockInDocument({ source, section, keyName, key, newContent }: { source: string; section: string; keyName: string; key: string; newContent: string; }): string | undefined; export declare function swapBlocks({ source, section, key1, key2, keyName }: { source: string; section: string; key1: string; key2: string; keyName?: string; }): string; export declare function insertBlock({ source, section, newBlock, refKey, position, parentKey, keyName, subBlockName }: { source: string; section: string; newBlock: string; refKey?: string; position?: "before" | "after"; parentKey?: string; keyName?: string; subBlockName?: string; }): string; export declare function parsePath(path: string): (string | number)[]; export declare function insertBlockWithPath({ source, newBlock, refPath, position, parentPath, }: { source: string; parentPath: string; newBlock: string; refPath?: string | number; position?: "before" | "after"; }): string; export declare function deleteBlock({ source, section, key, keyName }: { source: string; section: string; key: string; keyName?: string; }): string; export declare function deleteBlockWithPath({ source, path }: { source: string; path: string; }): string; export declare function isParentChildrenRelation({ source, sections, key1, key2, keyName }: { source: string; sections: string[]; key1: string; key2: string; keyName: string; }): boolean; export declare function replaceIdAndNamespace(source: string, id: string, namespace: string): string; export declare function checkBlockAlreadyExists({ source, section, newContent, keyName }: { source: string; section: string; newContent: string; keyName: string; }): any; export declare function getLastBlock({ source, section, parentKey, keyName, subBlockName }: { source: string; section: string; parentKey?: string; keyName?: string; subBlockName?: string; }): string | undefined; export declare function updateMetadata(source: string, metadata: Record): string; export declare const FLOW_SECTION_KEYS: readonly ["tasks", "triggers", "errors", "finally", "afterExecution", "pluginDefaults"]; export type FlowSectionKeys = typeof FLOW_SECTION_KEYS[number]; export declare const ORDERED_FLOW_ROOT_KEYS: readonly ["id", "type", "namespace", "description", "retry", "labels", "inputs", "variables", "tasks", "triggers", "errors", "finally", "afterExecution", "pluginDefaults", "taskDefaults", "concurrency", "sla", "outputs", "disabled"]; export type FlowRootKeys = typeof ORDERED_FLOW_ROOT_KEYS[number]; export declare function cleanMetadata(source: string): string; export declare function getMetadata(source: string): Record; export declare function deleteMetadata(source: any, metadata: any): any; export declare function flowHaveTasks(source: string): boolean; export declare function extractPluginDefault(source: string, pluginType: string): string | undefined; export declare function replacePluginDefaultsInDocument(source: string, pluginType: string, newContent: string): string | undefined; export declare function deletePluginDefaults(source: string, pluginType: string): string; export declare function insertErrorInFlowable(source: string, errorTask: string, flowableTask: string): any; /** * Specify a source yaml doc, the field to extract recursively in every map of the doc and optionally * a predicate to define which paths should be taken into account `parentPathPredicate` * will take a single argument which is the path of each parent property starting from the root doc (joined with ".") * "my.parent.task" will mean that the field was retrieved in my -> parent -> task path. */ export declare function extractFieldFromMaps(source: string, fieldName: T, parentPathPredicate?: (_: any, __?: any) => boolean, valuePredicate?: (_: any) => boolean, keepEmptyFields?: boolean): (Record & { range: Range; })[]; export declare function getAllFlowSectionRanges(source: string): [start: number, end: number][]; /** * Get task type at cursor position. * Useful to display/update the live docs */ export declare function getTypeAtPosition(source: string, position: { lineNumber: number; column: number; }, validTypes: any): any; /** * Get task version at cursor position. * Useful to display/update the live docs */ export declare function getVersionAtPosition(source: string, position: { lineNumber: number; column: number; }): any; export type YamlElement = { key?: string; value: Record; parents: Record[]; range?: [number, number, number]; }; export declare function localizeElementAtIndex(source: string, indexInSource: number): YamlElement; export declare function getAllCharts(source: string): string[]; export declare function getChartAtPosition(source: string, position: { lineNumber: number; column: number; }): any; /** * Get line start and end for all tasks * @param source - YAML source code * @returns lines infos for each taskId */ export declare function getTasksLines(source: string): Record; //# sourceMappingURL=FlowYamlUtils.d.ts.map