import { Event } from '../events';

export declare class NotEnoughStorageSpaceEvent extends Event {
    static readonly type: string;
}
export declare const RESERVED_DEFAULT_ROOT = "__DEFAULT_ROOT__";
export declare enum StorageError {
    NotEnoughStorage = "NOT_ENOUGH_STORAGE",
    PathLimitExceeded = "PATH_LIMIT_EXCEEDED"
}
export interface IStorage {
    combine: (path: string, chunks: Array<{
        from: number;
        path: string;
        to: number;
    }>) => Promise<boolean>;
    createDefaultRoot: () => Promise<string | null>;
    /**
     * Create root path
     * @param path
     * @returns normalized path (i.e. append number if path is duplicate with existing path). NULL if this action was explicitly cancelled by user
     */
    createRoot: (path: string) => Promise<string | null>;
    exists: (path: string) => Promise<boolean>;
    flushStoredPartial: (path: string) => Promise<boolean>;
    get: (path: string) => Promise<ArrayBuffer | null>;
    getDefaultRootName: () => Promise<string | null>;
    getSize: (path: string) => Promise<number>;
    remove: (path: string) => Promise<boolean>;
    removeDefaultRoot: () => Promise<void>;
    store: (path: string, data: ArrayBuffer) => Promise<boolean>;
    storePartial: (path: string, offset: number, data: ArrayBuffer) => Promise<boolean>;
    writable: (path: string) => Promise<boolean>;
}
