fix: Flesh out possible server url configurations

This commit is contained in:
Zach Posten
2019-01-04 13:26:46 -06:00
parent aa3e405524
commit 31283ad9ca
+34 -5
View File
@@ -48,6 +48,40 @@ export interface FilePondItem {
abortProcessing: () => void;
getMetadata: (key?: any) => any;
setMetadata: (key: any, value: any, silent?: boolean) => void;
interface ServerUrl {
url: string;
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
withCredentials?: boolean;
headers?: {[key: string]: string|boolean|number};
timeout?: number;
/**
* Called when server response is received, useful for getting
* the unique file id from the server response
*/
onload?: () => any;
/**
* Called when server error is received, receives the response
* body, useful to select the relevant error data
*/
onerror?: (responseBody: any) => any;
/**
* Called with the formdata object right before it is sent,
* return extended formdata object to make changes
*/
ondata?: (data: any) => any;
}
interface FilePondServerConfigProps {
instantUpload?: boolean;
server?: string | {
process: string | ServerUrl;
revert: string | ServerUrl;
restore: string | ServerUrl;
load: string | ServerUrl;
fetch: string | ServerUrl;
};
}
interface FilePondDragDropProps {
@@ -57,11 +91,6 @@ interface FilePondDragDropProps {
ignoredFiles?: string[];
}
interface FilePondServerConfigProps {
server?: string;
instantUpload?: boolean;
}
interface FilePondLabelProps {
labelDecimalSeparator?: string;
labelThousandsSeparator?: string;