@rest-hooks/endpoint
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -6,2 +6,10 @@ # Change Log | ||
### [1.1.2](https://github.com/coinbase/rest-hooks/compare/@rest-hooks/endpoint@1.1.1...@rest-hooks/endpoint@1.1.2) (2021-05-24) | ||
**Note:** Version bump only for package @rest-hooks/endpoint | ||
### [1.1.1](https://github.com/coinbase/rest-hooks/compare/@rest-hooks/endpoint@1.1.0...@rest-hooks/endpoint@1.1.1) (2021-04-25) | ||
@@ -8,0 +16,0 @@ |
@@ -11,3 +11,3 @@ /* eslint-disable @typescript-eslint/ban-types */ | ||
S extends Schema | undefined = undefined, | ||
M extends true | undefined = undefined | ||
M extends true | undefined = undefined, | ||
> extends EndpointExtraOptions<F> { | ||
@@ -23,3 +23,3 @@ key?: (...args: Parameters<F>) => string; | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends true | undefined = true | undefined | ||
M extends true | undefined = true | undefined, | ||
> extends EndpointOptions<F, S, M> { | ||
@@ -46,3 +46,3 @@ fetch?: FetchFunction; | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends true | undefined = true | undefined | ||
M extends true | undefined = true | undefined, | ||
> extends EndpointInterface< | ||
@@ -89,3 +89,3 @@ F, | ||
>, | ||
P extends Parameters<F> | ||
P extends Parameters<F>, | ||
>( | ||
@@ -125,3 +125,3 @@ this: E, | ||
O extends EndpointExtendOptions<F> & | ||
Partial<Omit<E, keyof EndpointInstance<FetchFunction>>> | ||
Partial<Omit<E, keyof EndpointInstance<FetchFunction>>>, | ||
>( | ||
@@ -165,3 +165,3 @@ this: E, | ||
M extends true | undefined = undefined, | ||
E extends Record<string, any> = {} | ||
E extends Record<string, any> = {}, | ||
>( | ||
@@ -168,0 +168,0 @@ fetchFunction: F, |
@@ -18,2 +18,2 @@ export default class Index { | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleEVuZHBvaW50Ln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G9va3Mvbm9ybWFsaXpyJztcblxuaW1wb3J0IHR5cGUgeyBJbmRleEludGVyZmFjZSwgSW5kZXhQYXJhbXMgfSBmcm9tICcuL2ludGVyZmFjZSc7XG5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIEluZGV4PFMgZXh0ZW5kcyBTY2hlbWEsIFAgPSBSZWFkb25seTxJbmRleFBhcmFtczxTPj4+XG4gIGltcGxlbWVudHMgSW5kZXhJbnRlcmZhY2U8UywgUD5cbntcbiAgZGVjbGFyZSBzY2hlbWE6IFM7XG4gIGNvbnN0cnVjdG9yKHNjaGVtYTogUywga2V5PzogKHBhcmFtczogUCkgPT4gc3RyaW5nKSB7XG4gICAgdGhpcy5zY2hlbWEgPSBzY2hlbWE7XG4gICAgaWYgKGtleSkgdGhpcy5rZXkgPSBrZXk7XG4gIH1cblxuICBrZXkocGFyYW1zPzogUCkge1xuICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShwYXJhbXMpO1xuICB9XG5cbiAgLyoqIFRoZSBmb2xsb3dpbmcgaXMgZm9yIGNvbXBhdGliaWxpdHkgd2l0aCBGZXRjaFNoYXBlICovXG4gIGdldEZldGNoS2V5ID0gKHBhcmFtczogUCkgPT4ge1xuICAgIHJldHVybiB0aGlzLmtleShwYXJhbXMpO1xuICB9O1xufVxuIl19 |
{ | ||
"name": "@rest-hooks/endpoint", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Declarative Network Interface Definitions", | ||
@@ -75,5 +75,5 @@ "sideEffects": false, | ||
"@babel/runtime": "^7.7.2", | ||
"@rest-hooks/normalizr": "^6.1.1" | ||
"@rest-hooks/normalizr": "^7.0.0" | ||
}, | ||
"gitHead": "05cd4da122d9f77eb917fc06dcf6a82d39e13b6f" | ||
"gitHead": "7ed918973d3410b7d21b32187049470d081816fb" | ||
} |
@@ -11,3 +11,3 @@ /* eslint-disable @typescript-eslint/ban-types */ | ||
S extends Schema | undefined = undefined, | ||
M extends true | undefined = undefined | ||
M extends true | undefined = undefined, | ||
> extends EndpointExtraOptions<F> { | ||
@@ -23,3 +23,3 @@ key?: (...args: Parameters<F>) => string; | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends true | undefined = true | undefined | ||
M extends true | undefined = true | undefined, | ||
> extends EndpointOptions<F, S, M> { | ||
@@ -46,3 +46,3 @@ fetch?: FetchFunction; | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends true | undefined = true | undefined | ||
M extends true | undefined = true | undefined, | ||
> extends EndpointInterface< | ||
@@ -89,3 +89,3 @@ F, | ||
>, | ||
P extends Parameters<F> | ||
P extends Parameters<F>, | ||
>( | ||
@@ -125,3 +125,3 @@ this: E, | ||
O extends EndpointExtendOptions<F> & | ||
Partial<Omit<E, keyof EndpointInstance<FetchFunction>>> | ||
Partial<Omit<E, keyof EndpointInstance<FetchFunction>>>, | ||
>( | ||
@@ -165,3 +165,3 @@ this: E, | ||
M extends true | undefined = undefined, | ||
E extends Record<string, any> = {} | ||
E extends Record<string, any> = {}, | ||
>( | ||
@@ -168,0 +168,0 @@ fetchFunction: F, |
@@ -6,3 +6,4 @@ import { Schema } from '@rest-hooks/normalizr'; | ||
export default class Index<S extends Schema, P = Readonly<IndexParams<S>>> | ||
implements IndexInterface<S, P> { | ||
implements IndexInterface<S, P> | ||
{ | ||
declare schema: S; | ||
@@ -9,0 +10,0 @@ constructor(schema: S, key?: (params: P) => string) { |
@@ -10,3 +10,3 @@ import { Schema, AbstractInstanceType } from '@rest-hooks/normalizr'; | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends true | undefined = true | undefined | ||
M extends true | undefined = true | undefined, | ||
> extends EndpointExtraOptions<F> { | ||
@@ -22,3 +22,3 @@ (...args: Parameters<F>): InferReturn<F, S>; | ||
F extends (params?: any, body?: any) => Promise<any> = FetchFunction, | ||
S extends Schema | undefined = Schema | undefined | ||
S extends Schema | undefined = Schema | undefined, | ||
> extends EndpointInterface<F, S, true> { | ||
@@ -31,8 +31,7 @@ sideEffect: true; | ||
F extends (params?: any) => Promise<any> = (params?: any) => Promise<any>, | ||
S extends Schema | undefined = Schema | undefined | ||
S extends Schema | undefined = Schema | undefined, | ||
> = EndpointInterface<F, S, undefined>; | ||
export type ArrayElement< | ||
ArrayType extends unknown[] | readonly unknown[] | ||
> = ArrayType[number]; | ||
export type ArrayElement<ArrayType extends unknown[] | readonly unknown[]> = | ||
ArrayType[number]; | ||
@@ -39,0 +38,0 @@ export type IndexParams<S extends Schema> = S extends { |
@@ -28,3 +28,3 @@ import { schema, Schema } from '@rest-hooks/normalizr'; | ||
SourceSchema extends Schema | undefined, | ||
Dest extends EndpointInterface<FetchFunction, Schema, any> | ||
Dest extends EndpointInterface<FetchFunction, Schema, any>, | ||
> = [ | ||
@@ -38,3 +38,3 @@ Dest, | ||
SourceSchema extends Schema | undefined, | ||
DestSchema extends Schema | ||
DestSchema extends Schema, | ||
> = ( | ||
@@ -41,0 +41,0 @@ sourceResults: Normalize<SourceSchema>, |
@@ -7,15 +7,12 @@ import { Schema } from '@rest-hooks/normalizr'; | ||
/** What the function's promise resolves to */ | ||
export type ResolveType< | ||
E extends (...args: any) => any | ||
> = ReturnType<E> extends Promise<infer R> ? R : never; | ||
export type ResolveType<E extends (...args: any) => any> = | ||
ReturnType<E> extends Promise<infer R> ? R : never; | ||
/** Fallback to schema if fetch function isn't defined */ | ||
export type InferReturn< | ||
F extends FetchFunction, | ||
S extends Schema | undefined | ||
> = S extends undefined | ||
? ReturnType<F> | ||
: ReturnType<F> extends unknown | ||
? Promise<Denormalize<S>> | ||
: ReturnType<F>; | ||
export type InferReturn<F extends FetchFunction, S extends Schema | undefined> = | ||
S extends undefined | ||
? ReturnType<F> | ||
: ReturnType<F> extends unknown | ||
? Promise<Denormalize<S>> | ||
: ReturnType<F>; | ||
@@ -22,0 +19,0 @@ /** Get the Params type for a given Shape */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
126382
1907
+ Added@rest-hooks/normalizr@7.5.2(transitive)
- Removed@rest-hooks/normalizr@6.1.1(transitive)
Updated@rest-hooks/normalizr@^7.0.0