import { type AnyRouter, type InferBucketPathObject, type InferMetadataObject, type UploadOptions } from '@edgestore/shared'; import { type z } from 'zod'; /** * @internal * @see https://www.totaltypescript.com/concepts/the-prettify-helper */ export type Prettify = { [K in keyof TType]: TType[K]; } & {}; export type BucketFunctions = { [K in keyof TRouter['buckets']]: { /** * Upload a file to the bucket * * @example * await edgestore.myBucket.upload({ * file: file, * signal: abortController.signal, // if you want to be able to cancel the ongoing upload * onProgressChange: (progress) => { console.log(progress) }, // if you want to show the progress of the upload * input: {...} // if the bucket has an input schema * options: { * manualFileName: file.name, // if you want to use a custom file name * replaceTargetUrl: url, // if you want to replace an existing file * temporary: true, // if you want to delete the file after 24 hours * } * }) */ upload: (params: z.infer extends never ? { file: File; signal?: AbortSignal; onProgressChange?: OnProgressChangeHandler; options?: UploadOptions; } : { file: File; signal?: AbortSignal; input: z.infer; onProgressChange?: OnProgressChangeHandler; options?: UploadOptions; }) => Promise; path: InferBucketPathObject; pathOrder: Prettify>[]; } : { url: string; size: number; uploadedAt: Date; metadata: InferMetadataObject; path: InferBucketPathObject; pathOrder: Prettify>[]; }>; confirmUpload: (params: { url: string; }) => Promise; delete: (params: { url: string; }) => Promise; }; }; type OnProgressChangeHandler = (progress: number) => void; export declare function createNextProxy({ apiPath, uploadingCountRef, maxConcurrentUploads, disableDevProxy, }: { apiPath: string; uploadingCountRef: React.MutableRefObject; maxConcurrentUploads?: number; disableDevProxy?: boolean; }): BucketFunctions; export {}; //# sourceMappingURL=createNextProxy.d.ts.map