import type { FilesBase, FileCreateParams, StoreFile } from "../resources/stores/files.js"; import type { RequestOptions } from "../internal/request-options.js"; import type { Uploadable } from "../core/uploads.js"; import { type MultipartUploadConfig } from "./upload-file.js"; /** * Parameters for polling store file status. */ export interface FilePollHelperParams { storeIdentifier: string; fileIdentifier: string; pollIntervalMs?: number | undefined; pollTimeoutMs?: number | undefined; options?: RequestOptions | undefined; returnChunks?: boolean | undefined; } /** * Parameters for creating and polling a store file. */ export interface FileCreateAndPollHelperParams { storeIdentifier: string; body: FileCreateParams; pollIntervalMs?: number | undefined; pollTimeoutMs?: number | undefined; options?: RequestOptions | undefined; returnChunks?: boolean | undefined; } /** * Parameters for uploading a file to a store. */ export interface FileUploadHelperParams { storeIdentifier: string; file: Uploadable; body?: Omit | undefined; options?: RequestOptions | undefined; multipartUpload?: MultipartUploadConfig | undefined; } /** * Parameters for uploading and polling a store file. */ export interface FileUploadAndPollHelperParams { storeIdentifier: string; file: Uploadable; body?: Omit | undefined; pollIntervalMs?: number | undefined; pollTimeoutMs?: number | undefined; options?: RequestOptions | undefined; returnChunks?: boolean | undefined; multipartUpload?: MultipartUploadConfig | undefined; } type Constructor = new (...args: any[]) => T; /** * Methods `withStoreFileHelpers` adds to the generated `stores.files` resource. * * The mixin's return type is spelled out so that declaration emit does not have to name the * anonymous class (TS4094: it has the protected `_client` member). */ export interface StoreFileHelpers { /** * Poll for a file's processing status until it reaches a terminal state. */ poll(storeIdentifier: string, fileIdentifier: string, pollIntervalMs?: number, pollTimeoutMs?: number, options?: RequestOptions): Promise; poll(params: FilePollHelperParams): Promise; /** * Create a file in a store and wait for it to be processed. */ createAndPoll(storeIdentifier: string, body: FileCreateParams, pollIntervalMs?: number, pollTimeoutMs?: number, options?: RequestOptions): Promise; createAndPoll(params: FileCreateAndPollHelperParams): Promise; /** * Upload a file to the files API and then create a file in a store. * Note the file will be asynchronously processed. */ upload(storeIdentifier: string, file: Uploadable, body?: Omit, options?: RequestOptions, multipartUpload?: MultipartUploadConfig): Promise; upload(params: FileUploadHelperParams): Promise; /** * Upload a file to the files API, create a file in a store, and poll until processing is complete. */ uploadAndPoll(storeIdentifier: string, file: Uploadable, body?: Omit, pollIntervalMs?: number, pollTimeoutMs?: number, options?: RequestOptions, multipartUpload?: MultipartUploadConfig): Promise; uploadAndPoll(params: FileUploadAndPollHelperParams): Promise; } export declare function withStoreFileHelpers>(Base: TBase): (new (...args: any[]) => StoreFileHelpers) & TBase; export {}; //# sourceMappingURL=store-files.d.ts.map