@fal-ai/serverless-client
Version:
Deprecation note: this library has been deprecated in favor of @fal-ai/client
25 lines (24 loc) • 953 B
TypeScript
/**
* File support for the client. This interface establishes the contract for
* uploading files to the server and transforming the input to replace file
* objects with URLs.
*/
export interface StorageSupport {
/**
* Upload a file to the server. Returns the URL of the uploaded file.
* @param file the file to upload
* @param options optional parameters, such as custom file name
* @returns the URL of the uploaded file
*/
upload: (file: Blob) => Promise<string>;
/**
* Transform the input to replace file objects with URLs. This is used
* to transform the input before sending it to the server and ensures
* that the server receives URLs instead of file objects.
*
* @param input the input to transform.
* @returns the transformed input.
*/
transformInput: (input: Record<string, any>) => Promise<Record<string, any>>;
}
export declare const storageImpl: StorageSupport;