import { IBackendInfo, IFile, IFileCreateOptions, ListFileKind, AccessOperation, IUser, IPatchRevision, IApplication, IHttpHistory, IHttpHistoryBulkAdd, HistoryListOptions, ContextChangeRecord, ContextListOptions, ContextListResult, IProjectExecution, IProjectExecutionListOptions, IBulkOperationResult, FileBreadcrumb } from '@api-client/core/build/browser.js';
import { Patch } from '@api-client/json';
import { IConfigEnvironment, IConfigInit } from '../lib/config/Config.js';
import { ISessionInitInfo } from '../store/HttpStore.js';
import { StoreAuthenticationInit } from '../bindings/base/StoreBindings.js';
/**
 * Reads file metadata from the store.
 *
 * @param key The file key
 * @returns THe file metadata
 */
declare function fileRead(key: string, media: false, target?: EventTarget): Promise<IFile>;
/**
* Reads file contents from the store.
*
* @param key The file key
* @returns THe file contents
*/
declare function fileRead(key: string, media: true, target?: EventTarget): Promise<unknown>;
/**
 * Patches file's meta in the store.
 *
 * @param key The file key
 * @param value The patch to apply.
 */
declare function patchFile(key: string, id: string, value: Patch.JsonPatch, app: IApplication, media: false, target?: EventTarget): Promise<IPatchRevision>;
/**
 * Patches file's content in the store.
 *
 * @param key The file key
 * @param value The patch to apply.
 */
declare function patchFile(key: string, id: string, value: Patch.JsonPatch, app: IApplication, media: true, target?: EventTarget): Promise<IPatchRevision>;
export declare const StoreEvents: Readonly<{
    /**
     * Initializes the store configuration for the application.
     *
     * @param init The configuration initialization.
     * @param target Optional events target.
     */
    initEnvironment: (init: IConfigInit, target?: EventTarget) => Promise<void>;
    /**
     * Reads the information about the data store.
     *
     * @param baseUri The store's base URI
     * @param target Optional events target.
     */
    storeInfo: (baseUri: string, target?: EventTarget) => Promise<IBackendInfo>;
    Global: Readonly<{
        /**
         * Sets the store environment to be used globally by the application.
         * This initializes the store with the configuration.
         *
         * Note, this won't initialize the session with the store.
         *
         * @param env The environment to set. Note, it must have the `location` set.
         */
        setEnv: (env: IConfigEnvironment, target?: EventTarget) => Promise<void>;
        /**
         * Reads the currently set global environment.
         */
        getEnv: (target?: EventTarget) => Promise<IConfigEnvironment>;
    }>;
    Auth: Readonly<{
        /**
         * Checks whether the user is authenticated in the store for the environment
         * @returns True if the user is authenticated in the store.
         */
        isAuthenticated: (target?: EventTarget) => Promise<boolean>;
        /**
         * Authenticates the current environment, if needed.
         *
         * @param update Whether to update the stored environment configuration when the token was renewed.
         * @param env Optional environment to authenticated if different than default
         * @param force Whether to force authentication.
         * @param target Optional events target.
         * @returns The session information.
         */
        authenticate: (options?: StoreAuthenticationInit, target?: EventTarget) => Promise<ISessionInitInfo>;
        /**
         * Reads the store access token in use, if any.
         * Note, this does not perform authentication. The user has to be already authenticated.
         *
         * @param target Optional events target.
         * @returns The current access token value to use in the store or undefined if none is in use, or the event is not handled.
         */
        getToken: (target?: EventTarget) => Promise<string | undefined>;
    }>;
    File: Readonly<{
        /**
         * Lists files (spaces, projects, etc) in the store.
         *
         * @param kinds the list of kinds to list. Spaces are always included.
         * @param options Optional query options.
         */
        list: (kinds?: ListFileKind[], options?: ContextListOptions, target?: EventTarget) => Promise<ContextListResult<IFile>>;
        /**
         * Lists files that are shared with the user.
         *
         * @param kinds the list of kinds to list. Spaces are always included.
         * @param options Optional query options.
         */
        listShared: (kinds?: ListFileKind[], options?: ContextListOptions, target?: EventTarget) => Promise<ContextListResult<IFile>>;
        /**
         * Creates a file in the store.
         *
         * @param meta The definition of a file that extends the IFile interface.
         * @param media The file content to create with the file meta, if available.
         * @param opts Optional options when creating a file
         * @returns The key of the creates file.
         */
        create: (meta: IFile, media?: unknown, opts?: IFileCreateOptions, target?: EventTarget) => Promise<string>;
        /**
         * A special case of a create file flow.
         * It allow to create a file only from a name and its kind.
         * The store has logic to recognize the file from its `kind` and create a file.
         *
         * This is helpful when creating a new file from the "create" dialog.
         *
         * @param name The name provided by the user.
         * @param kind File kind.
         * @param opts Optional options when creating a file
         * @returns The key of the creates file.
         */
        createDefault: (name: string, kind: string, opts?: IFileCreateOptions, target?: EventTarget) => Promise<string>;
        read: typeof fileRead;
        patch: typeof patchFile;
        /**
         * Deletes the file in the store.
         *
         * @param key The key of the file to delete.
         */
        delete: (key: string, target?: EventTarget) => Promise<string>;
        /**
         * Updates the sharing options of the file.
         *
         * @param key The file key
         * @param id The generated by the client random id. This id is reported back by the server.
         * @param value The patch operation on the file's ACL
         */
        patchUsers: (key: string, id: string, value: AccessOperation[], app: IApplication, target?: EventTarget) => Promise<void>;
        /**
         * Lists the users that have direct permission to the file.
         *
         * @param key The file key
         */
        listUsers: (key: string, target?: EventTarget) => Promise<ContextListResult<IUser>>;
        /**
         * Lists breadcrumbs to the file.
         *
         * @param fileOrFolder The if of the file or folder to query for.
         * @param options Optional query options.
         */
        breadcrumbs: (fileOrFolder: string, target?: EventTarget) => Promise<ContextListResult<FileBreadcrumb>>;
    }>;
    /**
     * Reads the current user.
     */
    User: Readonly<{
        me: (target?: EventTarget) => Promise<IUser>;
        read: (key: string, target?: EventTarget) => Promise<IUser | undefined>;
        list: (options?: ContextListOptions, target?: EventTarget) => Promise<ContextListResult<IUser>>;
    }>;
    History: Readonly<{
        create: (history: IHttpHistory, target?: EventTarget) => Promise<ContextChangeRecord<IHttpHistory>>;
        createBulk: (info: IHttpHistoryBulkAdd, target?: EventTarget) => Promise<IBulkOperationResult<ContextChangeRecord<IHttpHistory>>>;
        list: (init: HistoryListOptions, target?: EventTarget) => Promise<ContextListResult<IHttpHistory>>;
        delete: (key: string, parent?: string, target?: EventTarget) => Promise<void>;
        /**
         * Deletes history request in a bulk operation.
         * @param keys The keys of history objects to delete.
         */
        deleteBulk: (keys: string[], target?: EventTarget) => Promise<void>;
        read: (key: string, target?: EventTarget) => Promise<IHttpHistory>;
        /**
         * Clears all history from a project
         * @param project The key of the parent project
         */
        clearSpace: (space: string, target?: EventTarget) => Promise<void>;
        /**
         * Clears all history from a project
         * @param project The key of the parent project
         */
        clearProject: (space: string, project: string, target?: EventTarget) => Promise<void>;
        /**
         * Clears all history from a request
         * @param project The key of the parent project
         * @param request The key of the request to clear the history for.
         */
        clearRequest: (space: string, project: string, request: string, target?: EventTarget) => Promise<void>;
    }>;
    ProjectRuns: Readonly<{
        /**
         * Adds an execution logs object to the store.
         * @param item The execution log to add.
         */
        add: (item: IProjectExecution, target?: EventTarget) => Promise<ContextChangeRecord<IProjectExecution>>;
        /**
         * Reads an execution logs item.
         *
         * @param key The key of the history object to read.
         */
        read: (key: string, target?: EventTarget) => Promise<IProjectExecution>;
        /**
         * Lists the execution logs data.
         * @param options List options. Note, space is added by the bindings.
         */
        list: (options: IProjectExecutionListOptions, target?: EventTarget) => Promise<ContextListResult<IProjectExecution>>;
        /**
         * Marks the data as deleted.
         *
         * @param key The key of the object to delete.
         */
        delete: (key: string, parent?: string, target?: EventTarget) => Promise<void>;
        /**
         * Deletes a history in a bulk operation.
         *
         * @param keys The list of history keys to delete.
         */
        deleteBulk: (keys: string[], parent?: string, target?: EventTarget) => Promise<void>;
        /**
         * Clears the datastore from history for a space.
         * @param project The parent space key. Note, space is added by the bindings. This can be empty.
         */
        clearSpace: (space: string, target?: EventTarget) => Promise<void>;
        /**
         * Clears all history from a project
         * @param project The parent space key. Note, space is added by the bindings. This can be empty.
         * @param project The parent project key
         */
        clearProject: (space: string, project: string, target?: EventTarget) => Promise<void>;
        /**
         * Clears all history from a folder.
         * @param project The parent space key. Note, space is added by the bindings. This can be empty.
         * @param project The parent project key
         */
        clearParent: (space: string, project: string, folder: string, target?: EventTarget) => Promise<void>;
    }>;
}>;
export {};
//# sourceMappingURL=StoreEvents.d.ts.map