import { UploadFileInfo } from "./upload-file-info"; /** * Upload Props and Response */ /** * Uploading using the Demo API has no special properties */ export declare type DemoAPIUploadProps = { type: "demo"; file: UploadFileInfo; }; /** * Upload a file with the api key and secret out in public. * * This means that anybody that has upload access in your app will have access * to the secret keys allowing them to upload without limit. * * It's useful for: * * 1. Trying Wysimark uploads out * 2. When your main user is yourself or a group of trusted people like staff * 3. To start when you just want to get things going. * * Eventually, for an app with untrusted users, you will want to upgrade to * the private upload which can be authenticated. */ export declare type SecretAPIUploadProps = { type: "secret"; file: UploadFileInfo; appName: string; path: string; apiKeyId: string; apiSecretKey: string; limit?: { path: string; bytes: number; }; }; export declare type JWTAPIUploadProps = { type: "jwt"; jwt: string; }; export declare type JWTAPIUploadPayload = { type: "jwt"; file: UploadFileInfo; appName: string; path: string; apiKeyId: string; limit?: { path: string; bytes: number; }; iat: number; }; /** * Upload a file without the api key and secret visible. * * Instead, the call is made to an API endpoint that the developer controls. */ export declare type CustomAPIUploadProps = { type: "custom"; file: UploadFileInfo; data: Record; }; /** * NOTE: * * We no longer provide the Editor Upload Props here as it's not a cross * library concern and therefore adds an unnecessary step to modify the Editor. */ export declare type UploadSuccessResponse = { status: "success"; data: { formFields: Record; apiUrl: string; fileUrl: string; }; }; export declare type UploadErrorResponse = { status: "error"; message: string; }; export declare type UploadResponse = UploadSuccessResponse | UploadErrorResponse;