Skip to content

Commit

Permalink
[internal] Simplify type exports
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Sep 11, 2019
1 parent 4da574b commit b0727fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/react-integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
useInvalidator,
} from './hooks';
import { CacheProvider, ExternalCacheProvider } from './provider';
import NetworkErrorBoundary, { NetworkError } from './NetworkErrorBoundary';
import NetworkErrorBoundary from './NetworkErrorBoundary';

export type NetworkError = NetworkError;
export * from './NetworkErrorBoundary';
export {
useCache,
useFetcher,
Expand Down
55 changes: 2 additions & 53 deletions src/resource/index.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,12 @@
import Resource from './Resource';
import SimpleResource from './SimpleResource';
import {
SchemaOf,
DeleteShape,
ReadShape,
MutateShape,
FetchShape,
isDeleteShape,
RequestResource,
isEntity,
} from './types';
import {
SchemaList,
Schema,
SchemaDetail,
normalize,
denormalize,
schemas,
} from './normal';
export * from './types';
export * from './normal';

export type DeleteShape<
S extends schemas.Entity,
Params extends Readonly<object> = Readonly<object>
> = DeleteShape<S, Params>;
export type MutateShape<
S extends Schema,
Params extends Readonly<object> = Readonly<object>,
Body extends Readonly<object | string> | void =
| Readonly<object | string>
| undefined
> = MutateShape<S, Params, Body>;
export type ReadShape<
S extends Schema,
Params extends Readonly<object> = Readonly<object>,
Body extends Readonly<object | string> | void =
| Readonly<object | string>
| undefined
> = ReadShape<S, Params, Body>;
export type FetchShape<
S extends Schema,
Params extends Readonly<object> = Readonly<object>,
Body extends Readonly<object | string> | void =
| Readonly<object | string>
| undefined
> = FetchShape<S, Params, Body>;
export type Schema<T = any> = Schema<T>;
export type SchemaOf<T> = SchemaOf<T>;
export type SchemaList<T> = SchemaList<T>;
export type SchemaDetail<T> = SchemaDetail<T>;
export type RequestResource<RS> = RequestResource<RS>;
const SuperagentResource = Resource;

export {
Resource,
SimpleResource,
SuperagentResource,
isEntity,
normalize,
denormalize,
isDeleteShape,
schemas,
};

0 comments on commit b0727fc

Please sign in to comment.