@shopify/react-async
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -7,5 +7,23 @@ import { Resolver } from '@shopify/async'; | ||
export declare type KeepFreshable<KeepFreshOptions extends object> = Pick<AsyncComponentType<any, any, any, any, KeepFreshOptions>, 'useKeepFresh'>; | ||
export declare function usePreload<PreloadOptions extends object>(...args: IfAllOptionalKeys<PreloadOptions, [Preloadable<PreloadOptions>, PreloadOptions?], [Preloadable<PreloadOptions>, NoInfer<PreloadOptions>]>): ReturnType<typeof args[0]['usePreload']>; | ||
export declare function usePrefetch<PrefetchOptions extends object>(...args: IfAllOptionalKeys<PrefetchOptions, [Prefetchable<PrefetchOptions>, PrefetchOptions?], [Prefetchable<PrefetchOptions>, NoInfer<PrefetchOptions>]>): ReturnType<typeof args[0]['usePrefetch']>; | ||
export declare function useKeepFresh<KeepFreshOptions extends object>(...args: IfAllOptionalKeys<KeepFreshOptions, [KeepFreshable<KeepFreshOptions>, KeepFreshOptions?], [KeepFreshable<KeepFreshOptions>, NoInfer<KeepFreshOptions>]>): ReturnType<typeof args[0]['useKeepFresh']>; | ||
export declare function usePreload<PreloadOptions extends object>(...args: IfAllOptionalKeys<PreloadOptions, [ | ||
Preloadable<PreloadOptions>, | ||
PreloadOptions? | ||
], [ | ||
Preloadable<PreloadOptions>, | ||
NoInfer<PreloadOptions> | ||
]>): ReturnType<typeof args[0]['usePreload']>; | ||
export declare function usePrefetch<PrefetchOptions extends object>(...args: IfAllOptionalKeys<PrefetchOptions, [ | ||
Prefetchable<PrefetchOptions>, | ||
PrefetchOptions? | ||
], [ | ||
Prefetchable<PrefetchOptions>, | ||
NoInfer<PrefetchOptions> | ||
]>): ReturnType<typeof args[0]['usePrefetch']>; | ||
export declare function useKeepFresh<KeepFreshOptions extends object>(...args: IfAllOptionalKeys<KeepFreshOptions, [ | ||
KeepFreshable<KeepFreshOptions>, | ||
KeepFreshOptions? | ||
], [ | ||
KeepFreshable<KeepFreshOptions>, | ||
NoInfer<KeepFreshOptions> | ||
]>): ReturnType<typeof args[0]['useKeepFresh']>; | ||
interface Options { | ||
@@ -12,0 +30,0 @@ immediate?: boolean; |
@@ -12,5 +12,17 @@ import { ReactElement } from 'react'; | ||
readonly resolver: Resolver<T>; | ||
usePreload(...props: IfAllOptionalKeys<PreloadOptions, [NoInfer<PreloadOptions>?], [NoInfer<PreloadOptions>]>): () => void; | ||
usePrefetch(...props: IfAllOptionalKeys<PrefetchOptions, [NoInfer<PrefetchOptions>?], [NoInfer<PrefetchOptions>]>): () => void; | ||
useKeepFresh(...props: IfAllOptionalKeys<KeepFreshOptions, [NoInfer<KeepFreshOptions>?], [NoInfer<KeepFreshOptions>]>): () => void; | ||
usePreload(...props: IfAllOptionalKeys<PreloadOptions, [ | ||
NoInfer<PreloadOptions>? | ||
], [ | ||
NoInfer<PreloadOptions> | ||
]>): () => void; | ||
usePrefetch(...props: IfAllOptionalKeys<PrefetchOptions, [ | ||
NoInfer<PrefetchOptions>? | ||
], [ | ||
NoInfer<PrefetchOptions> | ||
]>): () => void; | ||
useKeepFresh(...props: IfAllOptionalKeys<KeepFreshOptions, [ | ||
NoInfer<KeepFreshOptions>? | ||
], [ | ||
NoInfer<KeepFreshOptions> | ||
]>): () => void; | ||
} | ||
@@ -17,0 +29,0 @@ export interface AsyncComponentType<T, Props extends object, PreloadOptions extends object, PrefetchOptions extends object, KeepFreshOptions extends object> extends AsyncHookTarget<T, PreloadOptions, PrefetchOptions, KeepFreshOptions> { |
{ | ||
"name": "@shopify/react-async", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"license": "MIT", | ||
@@ -70,3 +70,3 @@ "description": "Tools for creating powerful, asynchronously-loaded React components", | ||
}, | ||
"gitHead": "798d03d90b914be7bcd43092910840fb7d58866f" | ||
"gitHead": "1677c5acc6d5f72c51a2644a25dfbe9cec0b50f2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
116369
66
1939