41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { fetchUtils, DataProvider } from 'ra-core';
|
|
declare const _default: (apiUrl: any, httpClient?: (url: any, options?: fetchUtils.Options) => Promise<{
|
|
status: number;
|
|
headers: Headers;
|
|
body: string;
|
|
json: any;
|
|
}>) => DataProvider;
|
|
/**
|
|
* Maps react-admin queries to a json-server powered REST API
|
|
*
|
|
* @see https://github.com/typicode/json-server
|
|
*
|
|
* @example
|
|
*
|
|
* getList => GET http://my.api.url/posts?_sort=title&_order=ASC&_start=0&_end=24
|
|
* getOne => GET http://my.api.url/posts/123
|
|
* getManyReference => GET http://my.api.url/posts?author_id=345
|
|
* getMany => GET http://my.api.url/posts/123, GET http://my.api.url/posts/456, GET http://my.api.url/posts/789
|
|
* create => POST http://my.api.url/posts/123
|
|
* update => PUT http://my.api.url/posts/123
|
|
* updateMany => PUT http://my.api.url/posts/123, PUT http://my.api.url/posts/456, PUT http://my.api.url/posts/789
|
|
* delete => DELETE http://my.api.url/posts/123
|
|
*
|
|
* @example
|
|
*
|
|
* import React from 'react';
|
|
* import { Admin, Resource } from 'react-admin';
|
|
* import jsonServerProvider from 'ra-data-json-server';
|
|
*
|
|
* import { PostList } from './posts';
|
|
*
|
|
* const App = () => (
|
|
* <Admin dataProvider={jsonServerProvider('http://jsonplaceholder.typicode.com')}>
|
|
* <Resource name="posts" list={PostList} />
|
|
* </Admin>
|
|
* );
|
|
*
|
|
* export default App;
|
|
*/
|
|
export default _default;
|