-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
79 lines (79 loc) · 2.65 KB
/
index.d.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* Maps react-admin queries to a WooCommerce REST API
*
* @see https://woocommerce.github.io/woocommerce-rest-api-docs/
*
* @example
*
* getList => GET https://example.com/orders?order=asc&page=1&per_page=10&search=example&status=completed
* getOne => GET https://example.com/orders/123
* getMany => GET https://example.com/orders?include=123,456,789
* getManyReference => GET https://example.com/orders/123/notes
* create => POST https://example.com/orders
* update => PUT https://example.com/orders/123
* updateMany => PUT https://example.com/orders/123, PUT http://example.com/orders/456, PUT http://example.com/orders/789
* delete => DELETE https://example.com/orders/123
* deleteMany => DELETE https://example.com/orders/123, DELETE https://example.com/orders/456, DELETE https://example.com/orders/789
*
* @example
*
* import { Admin, Resource, ListGuesser, EditGuesser } from 'react-admin';
* import woocommerceData from 'ra-data-woocommerce';
*
* const dataProvider = woocommerceData({
* woocommerceUrl: 'https://example.com',
* consumerKey: 'ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
* consumerSecret: 'cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
* })
*
* const App = () => (
* <Admin dataProvider={dataProvider}>
* <Resource name="orders" list={ListGuesser} edit={EditGuesser} />
* <Resource name="customers" list={ListGuesser} edit={EditGuesser} />
* </Admin>
* );
*
* export default App;
*/
declare const _default: ({ woocommerceUrl, consumerKey, consumerSecret, httpClient }: {
woocommerceUrl: any;
consumerKey: any;
consumerSecret: any;
httpClient?: ((url: any, options?: {}) => Promise<{
status: number;
headers: Headers;
body: string;
json: any;
}>) | undefined;
}) => {
getList: (resource: any, params: any) => Promise<{
data: any;
total: number;
}>;
getOne: (resource: any, params: any) => Promise<{
data: any;
}>;
getMany: (resource: any, params: any) => Promise<{
data: any;
}>;
getManyReference: (resource: any, params: any) => Promise<{
data: any;
total: number;
}>;
create: (resource: any, params: any) => Promise<{
data: any;
}>;
update: (resource: any, params: any) => Promise<{
data: any;
}>;
updateMany: (resource: any, params: any) => Promise<{
data: any;
}>;
delete: (resource: any, params: any) => Promise<{
data: any;
}>;
deleteMany: (resource: any, params: any) => Promise<{
data: any;
}>;
};
export default _default;