enlace 0.0.1-beta.2 → 0.0.1-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,124 +0,0 @@
1
- import { WildcardClient, EnlaceClient, EnlaceResponse, EnlaceOptions } from 'enlace-core';
2
-
3
- /** Per-request options for React hooks */
4
- type ReactRequestOptionsBase = {
5
- /**
6
- * Cache tags for caching (GET requests only)
7
- * This will auto generate tags from the URL path if not provided and autoGenerateTags is enabled.
8
- * But can be manually specified to override auto-generation.
9
- * */
10
- tags?: string[];
11
- /** Tags to invalidate after mutation (triggers refetch in matching queries) */
12
- revalidateTags?: string[];
13
- };
14
- type ApiClient<TSchema, TOptions = ReactRequestOptionsBase> = unknown extends TSchema ? WildcardClient<TOptions> : EnlaceClient<TSchema, TOptions>;
15
- type QueryFn<TSchema, TData, TError, TOptions = ReactRequestOptionsBase> = (api: ApiClient<TSchema, TOptions>) => Promise<EnlaceResponse<TData, TError>>;
16
- type SelectorFn<TSchema, TMethod, TOptions = ReactRequestOptionsBase> = (api: ApiClient<TSchema, TOptions>) => TMethod;
17
- type ExtractData<T> = T extends (...args: any[]) => Promise<EnlaceResponse<infer D, unknown>> ? D : never;
18
- type ExtractError<T> = T extends (...args: any[]) => Promise<EnlaceResponse<unknown, infer E>> ? E : never;
19
- /** Discriminated union for hook response state - enables type narrowing on ok check */
20
- type HookResponseState<TData, TError> = {
21
- ok: undefined;
22
- data: undefined;
23
- error: undefined;
24
- } | {
25
- ok: true;
26
- data: TData;
27
- error: undefined;
28
- } | {
29
- ok: false;
30
- data: undefined;
31
- error: TError;
32
- };
33
- /** Result when hook is called with query function (auto-fetch mode) */
34
- type UseEnlaceQueryResult<TData, TError> = {
35
- loading: boolean;
36
- fetching: boolean;
37
- } & HookResponseState<TData, TError>;
38
- /** Result when hook is called with method selector (trigger mode) */
39
- type UseEnlaceSelectorResult<TMethod> = {
40
- trigger: TMethod;
41
- loading: boolean;
42
- fetching: boolean;
43
- } & HookResponseState<ExtractData<TMethod>, ExtractError<TMethod>>;
44
-
45
- type EnlaceHookOptions = {
46
- /**
47
- * Auto-generate cache tags from URL path for GET requests.
48
- * e.g., `/posts/1` generates tags `['posts', 'posts/1']`
49
- * @default true
50
- */
51
- autoGenerateTags?: boolean;
52
- /** Auto-revalidate generated tags after successful mutations. @default true */
53
- autoRevalidateTags?: boolean;
54
- /** Time in ms before cached data is considered stale. @default 0 (always stale) */
55
- staleTime?: number;
56
- };
57
-
58
- /**
59
- * Handler function called after successful mutations to trigger server-side revalidation.
60
- * @param tags - Cache tags to revalidate
61
- * @param paths - URL paths to revalidate
62
- */
63
- type RevalidateHandler = (tags: string[], paths: string[]) => void | Promise<void>;
64
- /** Next.js-specific options (third argument for createEnlace) */
65
- type NextOptions = Pick<EnlaceHookOptions, "autoGenerateTags" | "autoRevalidateTags"> & {
66
- /**
67
- * Handler called after successful mutations to trigger server-side revalidation.
68
- * Receives auto-generated or manually specified tags and paths.
69
- * @example
70
- * ```ts
71
- * createEnlace("http://localhost:3000/api/", {}, {
72
- * revalidator: (tags, paths) => revalidateServerAction(tags, paths)
73
- * });
74
- * ```
75
- */
76
- revalidator?: RevalidateHandler;
77
- };
78
- /** Next.js hook options (third argument for createEnlaceHook) - extends React's EnlaceHookOptions */
79
- type NextHookOptions = EnlaceHookOptions & Pick<NextOptions, "revalidator">;
80
- /** Per-request options for Next.js fetch - extends React's base options */
81
- type NextRequestOptionsBase = ReactRequestOptionsBase & {
82
- /** Time in seconds to revalidate, or false to disable */
83
- revalidate?: number | false;
84
- /**
85
- * URL paths to revalidate after mutation
86
- * This doesn't do anything on the client by itself - it's passed to the revalidator handler.
87
- * You must implement the revalidation logic in the revalidator.
88
- */
89
- revalidatePaths?: string[];
90
- /**
91
- * Skip server-side revalidation for this request.
92
- * Useful when autoRevalidateTags is enabled but you want to opt-out for specific mutations.
93
- * You can still pass empty [] to revalidateTags to skip triggering revalidation.
94
- * But this flag can be used if you want to revalidate client-side and skip server-side entirely.
95
- * Eg. you don't fetch any data on server component and you might want to skip the overhead of revalidation.
96
- */
97
- skipRevalidator?: boolean;
98
- };
99
-
100
- type NextQueryFn<TSchema, TData, TError> = QueryFn<TSchema, TData, TError, NextRequestOptionsBase>;
101
- type NextSelectorFn<TSchema, TMethod> = SelectorFn<TSchema, TMethod, NextRequestOptionsBase>;
102
- type NextEnlaceHook<TSchema> = {
103
- <TMethod extends (...args: any[]) => Promise<EnlaceResponse<unknown, unknown>>>(selector: NextSelectorFn<TSchema, TMethod>): UseEnlaceSelectorResult<TMethod>;
104
- <TData, TError>(queryFn: NextQueryFn<TSchema, TData, TError>): UseEnlaceQueryResult<TData, TError>;
105
- };
106
- /**
107
- * Creates a React hook for making API calls in Next.js Client Components.
108
- * Uses Next.js-specific features like revalidator for server-side cache invalidation.
109
- *
110
- * @example
111
- * const useAPI = createEnlaceHook<ApiSchema>('https://api.com', {}, {
112
- * revalidator: (tags) => revalidateTagsAction(tags),
113
- * staleTime: 5000,
114
- * });
115
- *
116
- * // Query mode - auto-fetch
117
- * const { loading, data, error } = useAPI((api) => api.posts.get());
118
- *
119
- * // Selector mode - trigger for mutations
120
- * const { trigger } = useAPI((api) => api.posts.delete);
121
- */
122
- declare function createEnlaceHook<TSchema = unknown>(baseUrl: string, defaultOptions?: EnlaceOptions, hookOptions?: NextHookOptions): NextEnlaceHook<TSchema>;
123
-
124
- export { createEnlaceHook };
@@ -1,444 +0,0 @@
1
- "use client";
2
- "use client";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
-
21
- // src/next/index.ts
22
- var next_exports = {};
23
- __export(next_exports, {
24
- createEnlace: () => createEnlace
25
- });
26
- import {
27
- createProxyHandler
28
- } from "enlace-core";
29
-
30
- // src/next/fetch.ts
31
- import {
32
- buildUrl,
33
- isJsonBody,
34
- mergeHeaders
35
- } from "enlace-core";
36
-
37
- // src/utils/generateTags.ts
38
- function generateTags(path) {
39
- return path.map((_, i) => path.slice(0, i + 1).join("/"));
40
- }
41
-
42
- // src/next/fetch.ts
43
- async function executeNextFetch(baseUrl, path, method, combinedOptions, requestOptions) {
44
- const {
45
- autoGenerateTags = true,
46
- autoRevalidateTags = true,
47
- revalidator,
48
- headers: defaultHeaders,
49
- ...restOptions
50
- } = combinedOptions;
51
- const url = buildUrl(baseUrl, path, requestOptions?.query);
52
- let headers = mergeHeaders(defaultHeaders, requestOptions?.headers);
53
- const isGet = method === "GET";
54
- const autoTags = generateTags(path);
55
- const fetchOptions = {
56
- ...restOptions,
57
- method
58
- };
59
- if (requestOptions?.cache) {
60
- fetchOptions.cache = requestOptions.cache;
61
- }
62
- if (isGet) {
63
- const tags = requestOptions?.tags ?? (autoGenerateTags ? autoTags : void 0);
64
- const nextFetchOptions = {};
65
- if (tags) {
66
- nextFetchOptions.tags = tags;
67
- }
68
- if (requestOptions?.revalidate !== void 0) {
69
- nextFetchOptions.revalidate = requestOptions.revalidate;
70
- }
71
- fetchOptions.next = nextFetchOptions;
72
- }
73
- if (headers) {
74
- fetchOptions.headers = headers;
75
- }
76
- if (requestOptions?.body !== void 0) {
77
- if (isJsonBody(requestOptions.body)) {
78
- fetchOptions.body = JSON.stringify(requestOptions.body);
79
- headers = mergeHeaders(headers, { "Content-Type": "application/json" });
80
- if (headers) {
81
- fetchOptions.headers = headers;
82
- }
83
- } else {
84
- fetchOptions.body = requestOptions.body;
85
- }
86
- }
87
- const response = await fetch(url, fetchOptions);
88
- const contentType = response.headers.get("content-type");
89
- const isJson = contentType?.includes("application/json");
90
- if (response.ok) {
91
- if (!isGet && !requestOptions?.skipRevalidator) {
92
- const revalidateTags = requestOptions?.revalidateTags ?? (autoRevalidateTags ? autoTags : []);
93
- const revalidatePaths = requestOptions?.revalidatePaths ?? [];
94
- if (revalidateTags.length || revalidatePaths.length) {
95
- revalidator?.(revalidateTags, revalidatePaths);
96
- }
97
- }
98
- return {
99
- ok: true,
100
- status: response.status,
101
- data: isJson ? await response.json() : response
102
- };
103
- }
104
- return {
105
- ok: false,
106
- status: response.status,
107
- error: isJson ? await response.json() : response
108
- };
109
- }
110
-
111
- // src/next/index.ts
112
- __reExport(next_exports, enlace_core_star);
113
- import * as enlace_core_star from "enlace-core";
114
- function createEnlace(baseUrl, defaultOptions = {}, nextOptions = {}) {
115
- const combinedOptions = { ...defaultOptions, ...nextOptions };
116
- return createProxyHandler(baseUrl, combinedOptions, [], executeNextFetch);
117
- }
118
-
119
- // src/react/useQueryMode.ts
120
- import { useRef, useReducer, useEffect } from "react";
121
-
122
- // src/react/reducer.ts
123
- var initialState = {
124
- loading: false,
125
- fetching: false,
126
- ok: void 0,
127
- data: void 0,
128
- error: void 0
129
- };
130
- function hookReducer(state, action) {
131
- switch (action.type) {
132
- case "RESET":
133
- return action.state;
134
- case "FETCH_START":
135
- return {
136
- ...state,
137
- loading: state.data === void 0,
138
- fetching: true
139
- };
140
- case "FETCH_SUCCESS":
141
- return {
142
- loading: false,
143
- fetching: false,
144
- ok: true,
145
- data: action.data,
146
- error: void 0
147
- };
148
- case "FETCH_ERROR":
149
- return {
150
- loading: false,
151
- fetching: false,
152
- ok: false,
153
- data: void 0,
154
- error: action.error
155
- };
156
- case "SYNC_CACHE":
157
- return action.state;
158
- default:
159
- return state;
160
- }
161
- }
162
-
163
- // src/utils/sortObjectKeys.ts
164
- function sortObjectKeys(obj) {
165
- if (obj === null || typeof obj !== "object") return obj;
166
- if (Array.isArray(obj)) return obj.map(sortObjectKeys);
167
- return Object.keys(obj).sort().reduce(
168
- (sorted, key) => {
169
- sorted[key] = sortObjectKeys(obj[key]);
170
- return sorted;
171
- },
172
- {}
173
- );
174
- }
175
-
176
- // src/react/cache.ts
177
- var cache = /* @__PURE__ */ new Map();
178
- function createQueryKey(tracked) {
179
- return JSON.stringify(
180
- sortObjectKeys({
181
- path: tracked.path,
182
- method: tracked.method,
183
- options: tracked.options
184
- })
185
- );
186
- }
187
- function getCache(key) {
188
- return cache.get(key);
189
- }
190
- function setCache(key, entry) {
191
- const existing = cache.get(key);
192
- if (existing) {
193
- if ("ok" in entry) {
194
- delete existing.promise;
195
- }
196
- Object.assign(existing, entry);
197
- existing.subscribers.forEach((cb) => cb());
198
- } else {
199
- cache.set(key, {
200
- data: void 0,
201
- error: void 0,
202
- ok: void 0,
203
- timestamp: 0,
204
- tags: [],
205
- subscribers: /* @__PURE__ */ new Set(),
206
- ...entry
207
- });
208
- }
209
- }
210
- function subscribeCache(key, callback) {
211
- let entry = cache.get(key);
212
- if (!entry) {
213
- cache.set(key, {
214
- data: void 0,
215
- error: void 0,
216
- ok: void 0,
217
- timestamp: 0,
218
- tags: [],
219
- subscribers: /* @__PURE__ */ new Set()
220
- });
221
- entry = cache.get(key);
222
- }
223
- entry.subscribers.add(callback);
224
- return () => {
225
- entry.subscribers.delete(callback);
226
- };
227
- }
228
- function isStale(key, staleTime) {
229
- const entry = cache.get(key);
230
- if (!entry) return true;
231
- return Date.now() - entry.timestamp > staleTime;
232
- }
233
- function clearCacheByTags(tags) {
234
- cache.forEach((entry) => {
235
- const hasMatch = entry.tags.some((tag) => tags.includes(tag));
236
- if (hasMatch) {
237
- entry.data = void 0;
238
- entry.error = void 0;
239
- entry.ok = void 0;
240
- entry.timestamp = 0;
241
- delete entry.promise;
242
- }
243
- });
244
- }
245
-
246
- // src/react/revalidator.ts
247
- var listeners = /* @__PURE__ */ new Set();
248
- function invalidateTags(tags) {
249
- clearCacheByTags(tags);
250
- listeners.forEach((listener) => listener(tags));
251
- }
252
- function onRevalidate(callback) {
253
- listeners.add(callback);
254
- return () => listeners.delete(callback);
255
- }
256
-
257
- // src/react/useQueryMode.ts
258
- function useQueryMode(api, trackedCall, options) {
259
- const { autoGenerateTags, staleTime } = options;
260
- const queryKey = createQueryKey(trackedCall);
261
- const requestOptions = trackedCall.options;
262
- const queryTags = requestOptions?.tags ?? (autoGenerateTags ? generateTags(trackedCall.path) : []);
263
- const getCacheState = (includeNeedsFetch = false) => {
264
- const cached = getCache(queryKey);
265
- const hasCachedData = cached?.data !== void 0;
266
- const isFetching = !!cached?.promise;
267
- const needsFetch = includeNeedsFetch && (!hasCachedData || isStale(queryKey, staleTime));
268
- return {
269
- loading: !hasCachedData && (isFetching || needsFetch),
270
- fetching: isFetching || needsFetch,
271
- ok: cached?.ok,
272
- data: cached?.data,
273
- error: cached?.error
274
- };
275
- };
276
- const [state, dispatch] = useReducer(hookReducer, null, () => getCacheState(true));
277
- const mountedRef = useRef(true);
278
- const fetchRef = useRef(null);
279
- useEffect(() => {
280
- mountedRef.current = true;
281
- dispatch({ type: "RESET", state: getCacheState(true) });
282
- const unsubscribe = subscribeCache(queryKey, () => {
283
- if (mountedRef.current) {
284
- dispatch({ type: "SYNC_CACHE", state: getCacheState() });
285
- }
286
- });
287
- const doFetch = () => {
288
- const cached2 = getCache(queryKey);
289
- if (cached2?.promise) {
290
- return;
291
- }
292
- dispatch({ type: "FETCH_START" });
293
- let current = api;
294
- for (const segment of trackedCall.path) {
295
- current = current[segment];
296
- }
297
- const method = current[trackedCall.method];
298
- const fetchPromise = method(trackedCall.options).then((res) => {
299
- if (mountedRef.current) {
300
- setCache(queryKey, {
301
- data: res.ok ? res.data : void 0,
302
- error: res.ok ? void 0 : res.error,
303
- ok: res.ok,
304
- timestamp: Date.now(),
305
- tags: queryTags
306
- });
307
- }
308
- });
309
- setCache(queryKey, {
310
- promise: fetchPromise,
311
- tags: queryTags
312
- });
313
- };
314
- fetchRef.current = doFetch;
315
- const cached = getCache(queryKey);
316
- if (cached?.data !== void 0 && !isStale(queryKey, staleTime)) {
317
- dispatch({ type: "SYNC_CACHE", state: getCacheState() });
318
- } else {
319
- doFetch();
320
- }
321
- return () => {
322
- mountedRef.current = false;
323
- fetchRef.current = null;
324
- unsubscribe();
325
- };
326
- }, [queryKey]);
327
- useEffect(() => {
328
- if (queryTags.length === 0) return;
329
- return onRevalidate((invalidatedTags) => {
330
- const hasMatch = invalidatedTags.some((tag) => queryTags.includes(tag));
331
- if (hasMatch && mountedRef.current && fetchRef.current) {
332
- fetchRef.current();
333
- }
334
- });
335
- }, [JSON.stringify(queryTags)]);
336
- return state;
337
- }
338
-
339
- // src/react/useSelectorMode.ts
340
- import { useRef as useRef2, useReducer as useReducer2 } from "react";
341
- function useSelectorMode(method, path, autoRevalidateTags) {
342
- const [state, dispatch] = useReducer2(hookReducer, initialState);
343
- const methodRef = useRef2(method);
344
- const triggerRef = useRef2(null);
345
- const pathRef = useRef2(path);
346
- const autoRevalidateRef = useRef2(autoRevalidateTags);
347
- methodRef.current = method;
348
- pathRef.current = path;
349
- autoRevalidateRef.current = autoRevalidateTags;
350
- if (!triggerRef.current) {
351
- triggerRef.current = (async (...args) => {
352
- dispatch({ type: "FETCH_START" });
353
- const res = await methodRef.current(...args);
354
- if (res.ok) {
355
- dispatch({ type: "FETCH_SUCCESS", data: res.data });
356
- const options = args[0];
357
- const tagsToInvalidate = options?.revalidateTags ?? (autoRevalidateRef.current ? generateTags(pathRef.current) : []);
358
- if (tagsToInvalidate.length > 0) {
359
- invalidateTags(tagsToInvalidate);
360
- }
361
- } else {
362
- dispatch({ type: "FETCH_ERROR", error: res.error });
363
- }
364
- return res;
365
- });
366
- }
367
- return {
368
- trigger: triggerRef.current,
369
- ...state
370
- };
371
- }
372
-
373
- // src/react/types.ts
374
- var HTTP_METHODS = ["get", "post", "put", "patch", "delete"];
375
-
376
- // src/react/trackingProxy.ts
377
- function createTrackingProxy(onTrack) {
378
- const createProxy = (path = []) => {
379
- return new Proxy(() => {
380
- }, {
381
- get(_, prop) {
382
- if (HTTP_METHODS.includes(prop)) {
383
- const methodFn = (options) => {
384
- onTrack({
385
- trackedCall: { path, method: prop, options },
386
- selectorPath: null,
387
- selectorMethod: null
388
- });
389
- return Promise.resolve({ ok: true, data: void 0 });
390
- };
391
- onTrack({
392
- trackedCall: null,
393
- selectorPath: path,
394
- selectorMethod: prop
395
- });
396
- return methodFn;
397
- }
398
- return createProxy([...path, prop]);
399
- }
400
- });
401
- };
402
- return createProxy();
403
- }
404
-
405
- // src/next/createEnlaceHook.ts
406
- function createEnlaceHook(baseUrl, defaultOptions = {}, hookOptions = {}) {
407
- const {
408
- autoGenerateTags = true,
409
- autoRevalidateTags = true,
410
- staleTime = 0,
411
- ...nextOptions
412
- } = hookOptions;
413
- const api = createEnlace(baseUrl, defaultOptions, {
414
- autoGenerateTags,
415
- autoRevalidateTags,
416
- ...nextOptions
417
- });
418
- function useEnlaceHook(selectorOrQuery) {
419
- let trackedCall = null;
420
- let selectorPath = null;
421
- const trackingProxy = createTrackingProxy((result2) => {
422
- trackedCall = result2.trackedCall;
423
- selectorPath = result2.selectorPath;
424
- });
425
- const result = selectorOrQuery(trackingProxy);
426
- if (typeof result === "function") {
427
- const actualResult = selectorOrQuery(api);
428
- return useSelectorMode(
429
- actualResult,
430
- selectorPath ?? [],
431
- autoRevalidateTags
432
- );
433
- }
434
- return useQueryMode(
435
- api,
436
- trackedCall,
437
- { autoGenerateTags, staleTime }
438
- );
439
- }
440
- return useEnlaceHook;
441
- }
442
- export {
443
- createEnlaceHook
444
- };
@@ -1,74 +0,0 @@
1
- import { EnlaceOptions, WildcardClient, EnlaceClient } from 'enlace-core';
2
- export * from 'enlace-core';
3
- export { EnlaceOptions } from 'enlace-core';
4
-
5
- /** Per-request options for React hooks */
6
- type ReactRequestOptionsBase = {
7
- /**
8
- * Cache tags for caching (GET requests only)
9
- * This will auto generate tags from the URL path if not provided and autoGenerateTags is enabled.
10
- * But can be manually specified to override auto-generation.
11
- * */
12
- tags?: string[];
13
- /** Tags to invalidate after mutation (triggers refetch in matching queries) */
14
- revalidateTags?: string[];
15
- };
16
-
17
- type EnlaceHookOptions = {
18
- /**
19
- * Auto-generate cache tags from URL path for GET requests.
20
- * e.g., `/posts/1` generates tags `['posts', 'posts/1']`
21
- * @default true
22
- */
23
- autoGenerateTags?: boolean;
24
- /** Auto-revalidate generated tags after successful mutations. @default true */
25
- autoRevalidateTags?: boolean;
26
- /** Time in ms before cached data is considered stale. @default 0 (always stale) */
27
- staleTime?: number;
28
- };
29
-
30
- /**
31
- * Handler function called after successful mutations to trigger server-side revalidation.
32
- * @param tags - Cache tags to revalidate
33
- * @param paths - URL paths to revalidate
34
- */
35
- type RevalidateHandler = (tags: string[], paths: string[]) => void | Promise<void>;
36
- /** Next.js-specific options (third argument for createEnlace) */
37
- type NextOptions = Pick<EnlaceHookOptions, "autoGenerateTags" | "autoRevalidateTags"> & {
38
- /**
39
- * Handler called after successful mutations to trigger server-side revalidation.
40
- * Receives auto-generated or manually specified tags and paths.
41
- * @example
42
- * ```ts
43
- * createEnlace("http://localhost:3000/api/", {}, {
44
- * revalidator: (tags, paths) => revalidateServerAction(tags, paths)
45
- * });
46
- * ```
47
- */
48
- revalidator?: RevalidateHandler;
49
- };
50
- /** Next.js hook options (third argument for createEnlaceHook) - extends React's EnlaceHookOptions */
51
- type NextHookOptions = EnlaceHookOptions & Pick<NextOptions, "revalidator">;
52
- /** Per-request options for Next.js fetch - extends React's base options */
53
- type NextRequestOptionsBase = ReactRequestOptionsBase & {
54
- /** Time in seconds to revalidate, or false to disable */
55
- revalidate?: number | false;
56
- /**
57
- * URL paths to revalidate after mutation
58
- * This doesn't do anything on the client by itself - it's passed to the revalidator handler.
59
- * You must implement the revalidation logic in the revalidator.
60
- */
61
- revalidatePaths?: string[];
62
- /**
63
- * Skip server-side revalidation for this request.
64
- * Useful when autoRevalidateTags is enabled but you want to opt-out for specific mutations.
65
- * You can still pass empty [] to revalidateTags to skip triggering revalidation.
66
- * But this flag can be used if you want to revalidate client-side and skip server-side entirely.
67
- * Eg. you don't fetch any data on server component and you might want to skip the overhead of revalidation.
68
- */
69
- skipRevalidator?: boolean;
70
- };
71
-
72
- declare function createEnlace<TSchema = unknown>(baseUrl: string, defaultOptions?: EnlaceOptions, nextOptions?: NextOptions): unknown extends TSchema ? WildcardClient<NextRequestOptionsBase> : EnlaceClient<TSchema, NextRequestOptionsBase>;
73
-
74
- export { type NextHookOptions, type NextOptions, type NextRequestOptionsBase, type RevalidateHandler, createEnlace };