@aspida/swr
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -1,12 +0,12 @@ | ||
import { responseInterface, ConfigInterface } from 'swr'; | ||
declare type Options<T extends (option: any) => Promise<any>> = Parameters<Parameters<T> extends [Parameters<T>[0]] ? (option: Parameters<T>[0] & ConfigInterface<ReturnType<T> extends Promise<infer S> ? S : never> & { | ||
import { SWRResponse, SWRConfiguration } from 'swr'; | ||
declare type Options<T extends (option: any) => Promise<any>> = Parameters<Parameters<T> extends [Parameters<T>[0]] ? (option: Parameters<T>[0] & SWRConfiguration<ResponseData<T>> & { | ||
enabled?: boolean; | ||
}) => void : (option?: Parameters<T>[0] & ConfigInterface<ReturnType<T> extends Promise<infer S> ? S : never> & { | ||
}) => void : (option?: Parameters<T>[0] & SWRConfiguration<ResponseData<T>> & { | ||
enabled?: boolean; | ||
}) => void>; | ||
declare type Res<T extends (option: any) => Promise<any>> = responseInterface<ReturnType<T> extends Promise<infer S> ? S : never, any>; | ||
declare type ResponseData<T extends (option: any) => Promise<any>> = ReturnType<T> extends Promise<infer S> ? S : never; | ||
declare function useAspidaSWR<T extends Record<string, any> & { | ||
$get: (option: any) => Promise<any>; | ||
$path: (option?: any) => string; | ||
}>(api: T, ...option: Options<T['$get']>): Res<T['$get']>; | ||
}>(api: T, ...option: Options<T['$get']>): SWRResponse<ResponseData<T['$get']>, any>; | ||
declare function useAspidaSWR<T extends Record<string, any> & { | ||
@@ -16,4 +16,4 @@ $path: (option?: any) => string; | ||
[K in keyof T]: T[K] extends (option: any) => Promise<any> ? K : never; | ||
}[keyof T]>(api: T, key: U, ...option: Options<T[U]>): Res<T[U]>; | ||
}[keyof T]>(api: T, key: U, ...option: Options<T[U]>): SWRResponse<ResponseData<T[U]>, any>; | ||
export default useAspidaSWR; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@aspida/swr", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "SWR wrapper for aspida", | ||
@@ -29,4 +29,4 @@ "author": "Solufa <solufa2020@gmail.com>", | ||
"dependencies": { | ||
"aspida": "^1.7.0" | ||
"aspida": "^1.7.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9860
Updatedaspida@^1.7.1