import Jsona from 'jsona';
import { Action, Store, Template, TemplateData, TreeFolder, TreeNode, ZustandStoreGetter, ZustandStoreSetter } from '../types';
export declare const dataFormatter: Jsona;
type Tree = {
    /**
     * Map of all folders for easy access
     */
    folders: Record<string, TreeFolder>;
    /**
     * Actual tree
     */
    tree: TreeNode[];
    /**
     * Template path map: templateId to array of folder ids in which this template is
     */
    pathMap: Record<string, string[]>;
};
type CreateTreeOptions = {
    foldersEnabled: boolean;
    rigsDataMap: Record<string, string>;
    programsDataMap: Record<string, string>;
};
export declare const createTree: (templates: Template[], { foldersEnabled, rigsDataMap, programsDataMap }: CreateTreeOptions) => Tree;
export declare const getFolders: (templates: Template[]) => TreeFolder[];
export declare const AssetsFieldsMap: {
    rig: string[];
    program: string[];
    frac_fleet: string[];
    well: string[];
    pad: string[];
    intervention_unit: string[];
};
type LoadAdditionalDataMapsOptions = {
    permissions: Store['permissions'];
    appEntities: Store['appEntities'];
    userProgramIds: Store['userProgramIds'];
};
export declare const loadAdditionalDataMaps: (templates: Template[], { appEntities, permissions, userProgramIds }: LoadAdditionalDataMapsOptions) => Promise<{
    rigsDataMap: Record<string, string>;
    programsDataMap: Record<string, string>;
}>;
export declare const getAllTemplates: <T extends TemplateData>(get: ZustandStoreGetter<T>) => Template<T>[];
export declare const findTemplate: <T extends TemplateData>(get: ZustandStoreGetter<T>, templateId?: number) => Template<T> | undefined;
export declare const setBusy: <T extends TemplateData>(set: ZustandStoreSetter<T>, id?: number | string, action?: Action) => () => void;
export declare const getUpdatedTemplates: <T extends TemplateData>(get: ZustandStoreGetter<T>, templateId: number | undefined, update: Partial<Template<T>>) => Template<T>[];
export declare const findTemplateOverride: <T extends TemplateData>(loadedTemplates: Template<T>[], templateId?: number) => Template<T> | undefined;
export declare const getTemplateOverride: <T extends TemplateData>(get: ZustandStoreGetter<T>, template?: Template<T>) => Template<T> | undefined;
export declare const ensureTemplateSettings: <T extends TemplateData>(get: ZustandStoreGetter<T>, set: ZustandStoreSetter<T>, template: Template<T>) => Promise<{
    settings: T;
    id: number;
    name: string;
    isPreset?: boolean;
    metadata?: import("../types").TemplateMetaData;
    published?: boolean;
    shared?: boolean;
    app_id?: number;
    company_id?: number;
    updated_at?: string;
    shared_with?: number[];
}>;
export declare const selectTemplateOnDeletion: <T extends TemplateData>(get: ZustandStoreGetter<T>, set: ZustandStoreSetter<T>) => Promise<void>;
export declare const removeTemplateFromList: <T extends TemplateData>(get: ZustandStoreGetter<T>, set: ZustandStoreSetter<T>, templateOrId?: number | Template<T>) => Template<T> | undefined;
/**
 * Updates templates
 *
 * @return Template[] of updated templates in arbitrary order
 */
export declare const updateTemplates: <T extends TemplateData>(get: ZustandStoreGetter<T>, set: ZustandStoreSetter<T>, ids: number[], updateOrFn: Partial<Template<T>> | ((template: Template<T>) => Partial<Template<T>>), action: Action) => Promise<(Template<T> | undefined)[]>;
export declare const updateTemplate: <T extends TemplateData>(get: ZustandStoreGetter<T>, set: ZustandStoreSetter<T>, id: number | undefined, updateOrFn: Partial<Template<T>> | ((template: Template<T>) => Partial<Template<T>>), action: Action) => Promise<Template<T> | undefined>;
export declare const addTemplate: <T extends TemplateData>(get: ZustandStoreGetter<T>, set: ZustandStoreSetter<T>, template: Pick<Template<T>, "name" | "settings" | "metadata">) => Promise<Template<T>>;
export declare const processLoadedTemplates: <T extends TemplateData>(get: ZustandStoreGetter<T>, templates: Template<T>[]) => Promise<{
    loadedTemplates: Template<T>[];
    rigsDataMap: Record<string, string>;
    programsDataMap: Record<string, string>;
}>;
export {};
//# sourceMappingURL=utils.d.ts.map