-
Notifications
You must be signed in to change notification settings - Fork 59
/
OdataConfig.ts
57 lines (48 loc) · 1.15 KB
/
OdataConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { OHandler } from "./OHandler";
import { OdataQuery } from "./OdataQuery";
export interface OdataBatchConfig {
endpoint?: string;
headers?: Headers;
boundaryPrefix?: string;
useChangset: boolean;
changsetBoundaryPrefix?: string;
/**
* When truthy, relative URL's will be used in batch elements
*/
useRelativeURLs: boolean;
}
export type OdataConfig = RequestInit & {
/**
* The URL to request data from
*/
rootUrl?: URL | string;
/**
* An default query
*/
query?: URLSearchParams | OdataQuery;
/**
* The fragment to parse data from
* Default is: value
*/
fragment: string;
/**
* Batch configuration (experimental)
*/
batch?: OdataBatchConfig;
/**
* Set to true to disable auto polyfilling
*/
disablePolyfill?: boolean;
/**
* A function which is called on each start of a request
*/
onStart: (oHandler: OHandler) => null;
/**
* A function which is called when a request has finished
*/
onFinish: (oHandler: OHandler, res?: Response) => null;
/**
* A function which is called when a request has a error
*/
onError: (oHandler: OHandler, res: Response) => null;
};