import { Optional } from 'utility-types';
import { SimulatorConfig, AccountInfo, EditorFileStack, BlockLoadMode, BlockContainerSize, DebugTenant, ApplicationType, DebugAccountInfo } from './commonData';
import { ProxyConfig } from './service';
export { SimulatorConfig } from './commonData';
export declare type ProjectMeta = Pick<SimulatorConfig, 'request' | 'socket' | 'upload' | 'download'>;
interface BaseData {
    appId: string;
    compilePath: string;
    compileId: string;
    accountInfo?: AccountInfo;
    lastOpen?: number;
    simulatorConfig: Partial<{
        appID: string;
        debugAccountInfo: DebugAccountInfo;
        applicationType: ApplicationType;
        debugTenantList: DebugTenant[];
    }>;
}
export interface EditorConfig {
    fileStack: EditorFileStack[];
    deleteFileWithoutConfirm: boolean;
}
export interface PanelConfig {
    showSimulator: boolean;
    showEditor: boolean;
    showExplorer: boolean;
    showDevtools: boolean;
}
export interface ProjectStorage extends BaseData {
    tmpConfig: {
        readonly dist: string;
        readonly downloadPath: string;
        readonly ttFileSystmpPath: string;
        readonly tmpVideos: string;
        readonly tmpImages: string;
        readonly debugDist: string;
        readonly livePreviewDist: string;
    };
    appData: {
        session?: string;
        storage?: any;
        appInfo?: {};
    };
    simulatorConfig: Partial<SimulatorConfig>;
    devtoolConfig: {
        [k: string]: any;
    };
    editorConfig: EditorConfig;
    blockUrl: string;
    panelConfig: PanelConfig;
    cookies: string[];
    compileMode: {
        useUpgrade: boolean;
        minimumVersion: string;
    };
}
export interface BlockStorage extends BaseData {
    appId: string;
    compileId: any;
    compilePath: string;
    blockTypeId: string;
    lastUpload: {
        time?: number;
        version: string;
    };
    lastPreview: {
        time?: number;
        platform: 'pc' | 'mobile';
        host: 'docs' | 'workplace';
        url?: string;
    };
    tmpConfig: {
        readonly dist: string;
    };
    blockIdx: number;
    simulatorConfig: Partial<SimulatorConfig>;
    userOperHis: {
        [key: string]: {
            isAutoRefresh: boolean;
            toolBoxInfo: {
                isActive: boolean;
                darkMode: 'light' | 'dark';
                scale: number;
            };
            host: 'docs' | 'workplace' | 'search';
            currentLoadMode: BlockLoadMode;
            selectedSizeUUID?: string;
            sdkVersion: string;
            lastUpload: {
                time?: number;
                version: string;
            };
            lastPreview: {
                time?: number;
                platform: 'pc' | 'mobile';
                host: 'docs' | 'workplace' | 'search';
                url?: string;
            };
        };
    };
    editorConfig: EditorConfig;
}
export declare type H5Storage = BaseData;
export interface H5OfflineStorage extends BaseData {
    editorConfig: EditorConfig;
    mockPanel: SimulatorConfig['mockPanel'];
}
export interface H5InBlockStorage extends BlockStorage {
    mockPanel: SimulatorConfig['mockPanel'];
}
export interface AppMap {
    gadget: ProjectStorage;
    block: BlockStorage;
    h5: H5Storage;
    h5_offline: H5OfflineStorage;
    h5_in_block: H5InBlockStorage;
}
interface WindowSize {
    width: number;
    height: number;
}
export interface StorageStruct {
    accountInfo?: AccountInfo;
    accountInfoMap?: {
        [env in string]: AccountInfo;
    };
    rootPath: string;
    ideConfig: {
        sdkRootPath: string;
        simulatorConfig: Partial<SimulatorConfig>;
    };
    cookies: {
        name: string;
        value: string;
        path: string;
        maxAge: number;
        domain: string;
        key: string;
        expireTime: number;
    }[];
    projects: {
        [k: string]: ProjectStorage;
    };
    blocks: {
        [k: string]: BlockStorage;
    };
    h5OfflineList: {
        [k: string]: H5OfflineStorage;
    };
    h5InBlockList: {
        [k: string]: H5InBlockStorage;
    };
    projectIds: {
        [k: string]: string;
    };
    uuid: string;
    testAccounts: string[];
    settings: {
        locale: 'default' | 'en-US' | 'zh-CN';
        proxy: Optional<ProxyConfig, 'proxy'>;
        customHeaders: Record<string, string>;
    };
    history: string[];
    windowSizeMemory: {
        welcome: WindowSize;
        gadget: WindowSize;
        h5: WindowSize;
        block: WindowSize;
    };
    usersConfig: {
        [userid: string]: UserStorageData;
    };
}
export interface UserStorageData {
    blockCustomSize?: BlockContainerSize[];
}
export declare type SavedProjectInfo<T> = Pick<T, Exclude<keyof T, 'tmpConfig' | 'compilePath' | 'compileId'>>;
export interface GlobalStorage {
    accountInfo?: AccountInfo;
    accountInfoMap?: {
        [env in string]: AccountInfo;
    };
    cookies: StorageStruct['cookies'];
    ideConfig: Pick<StorageStruct['ideConfig'], Exclude<keyof StorageStruct['ideConfig'], 'sdkRootPath'>>;
    projects: {
        [k: string]: SavedProjectInfo<ProjectStorage>;
    };
    blocks: {
        [k: string]: SavedProjectInfo<BlockStorage>;
    };
    h5OfflineList: {
        [k: string]: H5OfflineStorage;
    };
    h5InBlockList: {
        [k: string]: H5InBlockStorage;
    };
    uuid: StorageStruct['uuid'];
    testAccounts: StorageStruct['testAccounts'];
    settings: StorageStruct['settings'];
    history: string[];
    windowSizeMemory: {
        welcome: WindowSize;
        gadget: WindowSize;
        h5: WindowSize;
        block: WindowSize;
    };
    usersConfig: StorageStruct['usersConfig'];
}
export declare type Paths = (string | number)[];
export declare type DiffPaths = Paths[];
export declare enum CertificateConst {
    dirName = "cert",
    certName = "cert.pem",
    keyName = "key.pem"
}
