import { SdkBase, SdkOptions } from './SdkBase.js';
import type { IUser } from '../models/store/User.js';
import type { FileBreadcrumb, IFile } from '../models/store/File.js';
import { FolderKind, CertificateFileKind, ProjectKind, DomainFileKind } from '../models/kinds.js';
import type { ContextListResult, IBulkOperationResult, ContextListOptions } from '../events/BaseEvents.js';
import type { PermissionRole } from '../models/store/Permission.js';
import { type IFolder } from '../models/Folder.js';
import type { AccessPatchInfo, MediaPatchInfo, MediaPatchRevision, PatchInfo } from '../patch/types.js';
export interface IMetaCreateOptions {
    /**
     * Optional parent file id.
     * When set it creates a file under this parent.
     */
    parent?: string;
}
export interface IMediaCreateOptions {
    /**
     * Optional contents mime type.
     * Default to `application/json`.
     */
    mime?: string;
}
export interface IFileCreateOptions extends IMetaCreateOptions, IMediaCreateOptions {
}
export type ListFileKind = typeof ProjectKind | typeof FolderKind | typeof DomainFileKind | typeof CertificateFileKind;
/**
 * In the store, the file is represented by the meta and the media.
 *
 * The meta is used to represent the file in the UI when listing files
 * or presenting their metadata (like name, last modified, etc).
 * The media is the actual contents of the file and is only used by application specializing in this file modification.
 */
export declare class FilesSdk extends SdkBase {
    /**
     * Lists files (organizations, projects, etc) in the store.
     *
     * @param organization the parent organization for files.
     * @param kinds Optional list of kinds to limit the file types in the result. organizations are always included.
     * @param options Optional query options.
     * @param request Optional request options.
     */
    list(organization: string, options?: ContextListOptions, request?: SdkOptions): Promise<ContextListResult<IFile>>;
    /**
     * Creates both the meta and the media for a file.
     *
     * @param meta The file meta
     * @param contents The file contents
     * @param opts Meta and media create options.
     * @param request Optional request details
     * @returns The id of the created file meta.
     */
    create(meta: IFile, contents: unknown, organization: string, opts?: IFileCreateOptions, request?: SdkOptions): Promise<IFile>;
    /**
     * Creates a file in the store.
     *
     * @param file The definition of a file that extends the IFile interface.
     * @param opts Optional options when creating a file
     * @param request Optional request options.
     * @returns The key of the creates file.
     */
    createMeta(file: IFile, organization: string, opts?: IMetaCreateOptions, request?: SdkOptions): Promise<IFile>;
    /**
     * Creates a file contents (the media) after the file meta was created.
     *
     * @param contents The file contents to upload to the server.
     * @param key The created file meta key.
     * @param opts Contents create options. You can define content's mime type here.
     * @param request Optional request.
     */
    createMedia(contents: unknown, organization: string, key: string, opts?: IMediaCreateOptions, request?: SdkOptions): Promise<void>;
    createFolder(name: string, organization: string, opts?: IMetaCreateOptions, request?: SdkOptions): Promise<IFolder>;
    /**
     * Reads a file from the store.
     *
     * @param oid Organization ID.
     * @param fid The file key
     * @param request Optional request options.
     */
    read(oid: string, fid: string, request?: SdkOptions): Promise<IFile>;
    readMedia(oid: string, fid: string, request?: SdkOptions): Promise<{
        media: unknown;
        version: number;
    }>;
    /**
     * Reads a number of files in a bulk operation.
     *
     * @param keys The list of keys to read. When the user has no access to the file it returns undefined
     * in that place. It also inserts `undefined` in place of a file that doesn't exist.
     * @param request Optional request options.
     */
    readBulk(organization: string, keys: string[], request?: SdkOptions): Promise<IBulkOperationResult<IFile>>;
    /**
     * Patches a file in the store.
     * @param fid The key of the file to patch
     * @param info The JSON patch to be processed.
     * @param request Optional request options.
     * @returns The updated file object after applying the patch
     */
    patch(oid: string, fid: string, info: PatchInfo, request?: SdkOptions): Promise<IFile>;
    /**
     * Patches file media.
     * @param oid Organization id
     * @param fid File id
     * @param info THe patch to send
     * @param req Optional request
     * @returns The server response.
     */
    patchMedia(oid: string, fid: string, info: MediaPatchInfo, req?: SdkOptions): Promise<MediaPatchRevision>;
    /**
     * Deletes the file in the store.
     *
     * @param fid The key of the file to delete.
     * @param request Optional request options.
     * @returns The key of the created trash entry.
     */
    delete(oid: string, fid: string, request?: SdkOptions): Promise<void>;
    deleteBulk(oid: string, fids: string[], request?: SdkOptions): Promise<void>;
    /**
     * Updates the sharing options of the file.
     *
     * @param oid The parent organization key
     * @param fid The file key
     * @param info The patch operation on the file's ACL
     * @param request Optional request options.
     */
    patchUsers(oid: string, fid: string, info: AccessPatchInfo, request?: SdkOptions): Promise<IFile>;
    /**
     * A shorthand method to add access to the file to a single user.
     *
     * @param organization The parent organization key
     * @param key The file key
     * @param otherUserKey The key of the user that gets access to the organization
     * @param role The user role to grant
     * @param expires Optionally, when the permission expires.
     */
    addUser(organization: string, key: string, otherUserKey: string, role: PermissionRole, expires?: number, request?: SdkOptions): Promise<IFile>;
    /**
     * A shorthand method to remove access to the organization to a single user.
     *
     * @param organization The organization key to share
     * @param key The file key
     * @param otherUserKey The key of the user that gets access to the organization
     */
    removeUser(organization: string, key: string, otherUserKey: string, request?: SdkOptions): Promise<IFile>;
    /**
     * Lists uses having access to the file.
     *
     * @param key The file key
     * @param request Optional request options.
     */
    listUsers(organization: string, key: string, request?: SdkOptions): Promise<ContextListResult<IUser>>;
    /**
     * Lists breadcrumbs to the file.
     * @param key The lowest file in the hierarchy
     */
    breadcrumbs(organization: string, key: string, request?: SdkOptions): Promise<ContextListResult<FileBreadcrumb>>;
}
//# sourceMappingURL=FilesSdk.d.ts.map