You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/kit/src/exports/public.d.ts
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -790,14 +790,22 @@ export type HandleClientError = (input: {
790
790
})=>MaybePromise<void|App.Error>;
791
791
792
792
/**
793
-
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Server-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during prerendering).
793
+
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during pre-rendering).
794
794
*/
795
795
exporttypeHandleFetch=(input: {
796
796
event: RequestEvent;
797
797
request: Request;
798
798
fetch: typeoffetch;
799
799
})=>MaybePromise<Response>;
800
800
801
+
/**
802
+
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the client
803
+
*/
804
+
exporttypeHandleClientFetch=(input: {
805
+
request: Request;
806
+
fetch: typeoffetch;
807
+
})=>MaybePromise<Response>;
808
+
801
809
/**
802
810
* The [`init`](https://svelte.dev/docs/kit/hooks#Shared-hooks-init) will be invoked before the server responds to its first request
// This flag is set in initial_fetch and subsequent_fetch
52
-
constused_kit_fetch=init?.__sveltekit_fetch__;
53
-
54
-
if(in_load_heuristic&&!used_kit_fetch){
55
-
console.warn(
56
-
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests`
// This flag is set in initial_fetch and subsequent_fetch
60
+
constused_kit_fetch=init?.__sveltekit_fetch__;
61
+
62
+
if(in_load_heuristic&&!used_kit_fetch){
63
+
console.warn(
64
+
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests`
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Server-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during prerendering).
775
+
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the server (or during pre-rendering).
776
776
*/
777
777
exporttypeHandleFetch=(input: {
778
778
event: RequestEvent;
779
779
request: Request;
780
780
fetch: typeoffetch;
781
781
})=>MaybePromise<Response>;
782
782
783
+
/**
784
+
* The [`handleFetch`](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleFetch) hook allows you to modify (or replace) a `fetch` request that happens inside a `load` function that runs on the client
785
+
*/
786
+
exporttypeHandleClientFetch=(input: {
787
+
request: Request;
788
+
fetch: typeoffetch;
789
+
})=>MaybePromise<Response>;
790
+
783
791
/**
784
792
* The [`init`](https://svelte.dev/docs/kit/hooks#Shared-hooks-init) will be invoked before the server responds to its first request
0 commit comments