import { StoreApi } from 'zustand';
import { ComponentType } from 'react';
export declare enum ConfirmationModalType {
    Revert = "Revert",
    DeleteTemplate = "DeleteTemplate",
    DeleteFolder = "DeleteFolder"
}
export declare enum FolderType {
    Preset = "preset",// Presets
    Shared = "shared",// Shared with user
    Company = "company",// Published by company admins
    Regular = "regular",// User-created;
    Rig = "rig",// By rig
    Program = "program",// By program
    FracFleet = "fracFleet",
    Pad = "pad"
}
export declare enum Action {
    ReloadList = "reloadList",
    LoadData = "LoadData",
    SaveSettings = "SaveSettings",
    Export = "Export",
    UpdateMetadata = "UpdateMetadata",
    Publish = "Publish",
    Share = "Share",
    UpdateName = "UpdateName",
    Create = "Create",
    Delete = "Delete",
    Unknown = "Unknown"
}
export type TemplateData = object;
export type TemplateMetaData = {
    icon?: string;
    iconColor?: string;
    folderPath?: string;
    programIds?: number[];
    rigIds?: number[];
    /**
     * Indicates that template is a user's override for a preset: should not be shown in a list
     */
    isPresetOverride?: boolean;
    /**
     * Indicates to which preset template this override is for
     */
    parentTemplateId?: number;
};
export type Template<T extends TemplateData = object> = {
    id: number;
    name: string;
    isPreset?: boolean;
    metadata?: TemplateMetaData;
    settings: T;
    published?: boolean;
    shared?: boolean;
    app_id?: number;
    company_id?: number;
    updated_at?: string;
    shared_with?: number[];
};
export type TreeNode = Template | TreeFolder;
export type TreeFolder = {
    id: string;
    name?: string;
    type: FolderType;
    entityId?: number;
    items: TreeNode[];
};
type TemplateMenuData = {
    anchorEl: HTMLElement | null | undefined;
    templateId: number;
};
type FolderMenuData = {
    anchorEl: HTMLElement | null | undefined;
    folder: TreeFolder;
};
export type ZustandStoreSetter<T extends TemplateData> = (partial: Store<T> | Partial<Store<T>> | ((state: Store<T>) => Store<T> | Partial<Store<T>>), replace?: boolean | undefined) => void;
export type ZustandStoreGetter<T extends TemplateData> = () => Store<T>;
export type TemplatesControlAdditionalControlProps<T extends TemplateData> = {
    template: Template<T>;
};
export type Store<T extends TemplateData = never> = {
    set: ZustandStoreSetter<T>;
    get: ZustandStoreGetter<T>;
    appKey: string;
    userId: number;
    userProgramIds: number[];
    presetTemplates: Template<T>[];
    loadedTemplates: Template<T>[];
    isInitialized: boolean;
    /**
     * Indicates that something is being done in the background
     */
    currentActions: {
        id: number | string;
        action: Action;
    }[];
    onChange?: (template: Template<T> | undefined, reason: 'initialLoad' | 'reloadList' | 'deleteTemplate' | 'selectTemplate') => void;
    isPopoverOpen: boolean;
    templateSettings?: T;
    searchString?: string;
    currentTemplateId?: number;
    templateMenuData?: TemplateMenuData;
    folderMenuData?: FolderMenuData;
    templateIconColors: string[];
    defaultTemplateIconColor: string;
    templateIconMap: Record<string, ComponentType<{
        color?: string;
        className?: string;
        size?: number;
    }>>;
    defaultTemplateIcon: string;
    dataEqualityFn: (a?: Template<T>, b?: Template<T>) => boolean;
    /**
     * User's permissions
     */
    permissions: {
        canPublish: boolean;
    };
    confirmationType?: ConfirmationModalType;
    confirmationCallback?: () => void;
    confirmationTargetTemplateId?: number;
    confirmationTargetFolder?: TreeFolder;
    rigsDataMap: Record<string, string>;
    programsDataMap: Record<string, string>;
    templateControls?: ComponentType<TemplatesControlAdditionalControlProps<T>>;
    foldersEnabled: boolean;
    publishEnabled: boolean;
    reloadListOnOpen: boolean;
    /**
     * Hooks into internal logic
     */
    hooks: {
        getDefaultTemplate?: (templates: Template<T>[], state: {
            currentTemplateId?: number;
            templateSettings?: T;
            event: 'loadList' | 'reloadList' | 'deleteTemplate';
        }) => Template<T> | undefined;
        filterInitialTemplates?: (allTemplates: Template<T>[]) => Template<T>[] | Promise<Template<T>[]>;
    };
    appEntities: {
        rigId?: number;
    };
};
export type TemplatesControlChangeHandler<T extends TemplateData> = Required<Store<T>>['onChange'];
export type StoreContextType<T extends TemplateData> = StoreApi<Store<T>>;
export {};
//# sourceMappingURL=types.d.ts.map