Interface StorageClient

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.

interface StorageClient {
    transformInput: ((input: Record<string, any>) => Promise<Record<string, any>>);
    upload: ((file: Blob) => Promise<string>);
}

Properties

transformInput: ((input: Record<string, any>) => Promise<Record<string, any>>)

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.

Type declaration

upload: ((file: Blob) => Promise<string>)

Upload a file to the server. Returns the URL of the uploaded file.

Type declaration

    • (file): Promise<string>
    • Parameters

      • file: Blob

        the file to upload

      Returns Promise<string>

      the URL of the uploaded file