@uniformdev/next-app-router 20.80.2 → 20.81.1-alpha.10.sha-def425616f
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.
- package/dist/{UniformComposition-DBO-oo7J.d.ts → UniformComposition-ChDH4dMd.d.ts} +12 -31
- package/dist/{UniformComposition-le6UEB_r.d.mts → UniformComposition-Doa1kKRm.d.mts} +12 -31
- package/dist/cache.d.mts +24 -6
- package/dist/cache.d.ts +24 -6
- package/dist/cache.js +396 -832
- package/dist/cache.mjs +391 -830
- package/dist/compat.d.mts +2 -4
- package/dist/compat.d.ts +2 -4
- package/dist/component.d.mts +10 -1
- package/dist/component.d.ts +10 -1
- package/dist/component.js +113 -617
- package/dist/component.mjs +112 -640
- package/dist/composition-CGU7iH-k.d.mts +37 -0
- package/dist/composition-CGU7iH-k.d.ts +37 -0
- package/dist/config/default.js +0 -1
- package/dist/config/default.mjs +0 -1
- package/dist/createCachedManifestProvider-2-2u3PYd.d.mts +84 -0
- package/dist/createCachedManifestProvider-BoorKD15.d.ts +84 -0
- package/dist/edge.d.mts +80 -0
- package/dist/edge.d.ts +80 -0
- package/dist/edge.js +1225 -0
- package/dist/edge.mjs +1191 -0
- package/dist/handler.d.mts +15 -2
- package/dist/handler.d.ts +15 -2
- package/dist/handler.js +134 -628
- package/dist/handler.mjs +132 -626
- package/dist/index.d.mts +81 -41
- package/dist/index.d.ts +81 -41
- package/dist/index.esm.js +2051 -5614
- package/dist/index.js +2092 -5651
- package/dist/index.mjs +2051 -5614
- package/dist/middleware.d.mts +60 -13
- package/dist/middleware.d.ts +60 -13
- package/dist/middleware.js +415 -5746
- package/dist/middleware.mjs +422 -5776
- package/dist/models-C8OdCO44.d.mts +72 -0
- package/dist/models-C8OdCO44.d.ts +72 -0
- package/dist/resolveRouteFromPath-CnfnaxY2.d.ts +80 -0
- package/dist/resolveRouteFromPath-_rauUskz.d.mts +80 -0
- package/dist/vercel.d.mts +37 -0
- package/dist/vercel.d.ts +37 -0
- package/dist/vercel.js +788 -0
- package/dist/vercel.mjs +759 -0
- package/package.json +37 -9
- package/dist/client-BElN_CWD.d.mts +0 -786
- package/dist/client-BElN_CWD.d.ts +0 -786
- package/dist/resolveRouteFromCode-BOvjIvM2.d.ts +0 -18
- package/dist/resolveRouteFromCode-CuJ4JHeb.d.mts +0 -18
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { CanvasClient, CompositionDeliveryClient, RouteClient,
|
|
2
|
-
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient, RouteGetResponseRedirect } from '@uniformdev/canvas';
|
|
2
|
+
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult, PageState } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
5
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
6
|
-
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-Doa1kKRm.mjs';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-Doa1kKRm.mjs';
|
|
7
|
+
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
7
8
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import '
|
|
9
|
+
import { a as ResolvedRouteResult, b as ResolvedComposition, R as ResolvedCompositionResult } from './composition-CGU7iH-k.mjs';
|
|
10
|
+
export { c as ResolvedNotFound, d as ResolvedRedirect } from './composition-CGU7iH-k.mjs';
|
|
11
|
+
import { E as EdgeRouteFilter } from './models-C8OdCO44.mjs';
|
|
12
|
+
import { b as ResolveRouteFromCodeOptions } from './resolveRouteFromPath-_rauUskz.mjs';
|
|
13
|
+
export { P as PageStateSource, R as ResolveCompositionByIdOptions, a as ResolveCompositionBySlugOptions, c as ResolveRouteFromPathOptions, d as ResolveRouteFunction, r as resolveCompositionById, e as resolveCompositionBySlug, f as resolveRouteFromCode, g as resolveRouteFromPath } from './resolveRouteFromPath-_rauUskz.mjs';
|
|
12
14
|
import '@uniformdev/context';
|
|
13
15
|
|
|
14
16
|
type SpecificCacheMode<TCacheMode extends CacheMode> = {
|
|
@@ -202,6 +204,24 @@ type PlaygroundParameters = {
|
|
|
202
204
|
}>;
|
|
203
205
|
};
|
|
204
206
|
|
|
207
|
+
type UniformContextProps = {
|
|
208
|
+
/**
|
|
209
|
+
* Component to initialize Uniform context on the client.
|
|
210
|
+
*/
|
|
211
|
+
clientContextComponent?: ClientContextComponent;
|
|
212
|
+
/**
|
|
213
|
+
* The page's primary composition. It sets the composition metadata of the visitor's context and
|
|
214
|
+
* the default consent, and loads the contextual editing script in the editor and draft states.
|
|
215
|
+
* Takes any resolver result as is; a redirect or not found result sets no composition metadata.
|
|
216
|
+
*/
|
|
217
|
+
result: ResolvedRouteResult | undefined;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Initializes Uniform context on the client and loads the contextual editing script. Render it
|
|
221
|
+
* once per page, next to one or more `UniformComposition` elements.
|
|
222
|
+
*/
|
|
223
|
+
declare function UniformContext(props: UniformContextProps): React.JSX.Element;
|
|
224
|
+
|
|
205
225
|
type UniformPageParameters = {
|
|
206
226
|
params: Promise<{
|
|
207
227
|
code: string;
|
|
@@ -211,8 +231,13 @@ type AwaitedUniformPageParameters = {
|
|
|
211
231
|
params: Awaited<UniformPageParameters['params']>;
|
|
212
232
|
};
|
|
213
233
|
|
|
214
|
-
type UniformPlaygroundProps = UniformCompositionProps
|
|
215
|
-
|
|
234
|
+
type UniformPlaygroundProps = UniformCompositionProps & Pick<UniformContextProps, 'clientContextComponent'>;
|
|
235
|
+
/**
|
|
236
|
+
* Renders a playground page in draft mode: the composition, usually from `resolvePlaygroundRoute`,
|
|
237
|
+
* with its `UniformContext`. Renders a message outside draft mode. Keep it out of layouts that
|
|
238
|
+
* render their own `UniformContext`, which would initialize Uniform context twice.
|
|
239
|
+
*/
|
|
240
|
+
declare const UniformPlayground: ({ clientContextComponent, ...props }: UniformPlaygroundProps) => Promise<React.JSX.Element>;
|
|
216
241
|
|
|
217
242
|
type CreateStaticParamsOptions = {
|
|
218
243
|
paths: string[];
|
|
@@ -220,49 +245,64 @@ type CreateStaticParamsOptions = {
|
|
|
220
245
|
path: string;
|
|
221
246
|
}) => Promise<RewriteRequestPathResult | undefined>;
|
|
222
247
|
locale?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Prebuilds pages in edge mode, for apps that use `uniformEdgeMiddleware`. `true` puts every
|
|
250
|
+
* path in edge mode. A filter is asked about each path; pass the same filter the middleware uses
|
|
251
|
+
* so the prebuilt codes match the ones it rewrites to.
|
|
252
|
+
*/
|
|
253
|
+
edgeMode?: boolean | EdgeRouteFilter;
|
|
223
254
|
};
|
|
224
255
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* @returns
|
|
256
|
+
* Generates the playground code for the first of the given paths. Playground requests are drafts,
|
|
257
|
+
* which evaluate while the page renders, so there is one code per composition.
|
|
228
258
|
*/
|
|
229
259
|
declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
230
260
|
code: string;
|
|
231
261
|
}[]>;
|
|
232
262
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
263
|
+
* Generates one code per published composition among the given paths, for `generateStaticParams`
|
|
264
|
+
* of the `[code]` route. Codes carry the route, not an evaluation, so each path has one static page
|
|
265
|
+
* whose variants are chosen in the browser or at the edge.
|
|
236
266
|
*/
|
|
237
267
|
declare const createUniformStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
238
268
|
code: string;
|
|
239
269
|
}[]>;
|
|
240
270
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
component: ComponentInstance;
|
|
248
|
-
}) => boolean;
|
|
249
|
-
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
|
-
/**
|
|
251
|
-
* Whether to evaluate tests
|
|
252
|
-
* @defaultValue true
|
|
253
|
-
*/
|
|
254
|
-
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
|
-
/**
|
|
256
|
-
* Whether to evaluate personalizations
|
|
257
|
-
* @defaultValue true
|
|
258
|
-
*/
|
|
259
|
-
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
|
-
};
|
|
261
|
-
declare const precomputeComposition: ({ pageState, route, evaluatePersonalizations, evaluateTests, }: PrecomputeCompositionOptions) => Promise<void>;
|
|
262
|
-
|
|
263
|
-
declare const resolvePlaygroundRoute: ({ code }: {
|
|
271
|
+
/**
|
|
272
|
+
* Reads the page state the middleware encoded in a `[code]` path segment: the route path,
|
|
273
|
+
* composition state, release, locale and preview settings. The resolvers accept the code
|
|
274
|
+
* directly; call this when the page needs the page state before resolving.
|
|
275
|
+
*/
|
|
276
|
+
declare const deserializePageState: ({ code }: {
|
|
264
277
|
code: string;
|
|
265
|
-
}) =>
|
|
278
|
+
}) => PageState;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Returns the result when it resolved to a composition, ready for `UniformComposition`. Otherwise
|
|
282
|
+
* it throws through Next.js navigation: `notFound()` when nothing matched, `permanentRedirect` for
|
|
283
|
+
* 301 and 308 redirect targets, and `redirect` for the rest. The redirect target is built with
|
|
284
|
+
* `resolveRedirectHref`.
|
|
285
|
+
*/
|
|
286
|
+
declare const requireComposition: (result: ResolvedRouteResult) => ResolvedComposition;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Resolves the composition of a playground code. The code carries the composition id, and the
|
|
290
|
+
* composition resolves in the editor state, falling back to the draft state. `route` is undefined
|
|
291
|
+
* outside draft mode, without fetching, and when the composition does not exist.
|
|
292
|
+
*/
|
|
293
|
+
declare const resolvePlaygroundRoute: ({ code, }: ResolveRouteFromCodeOptions) => Promise<ResolvedCompositionResult>;
|
|
294
|
+
|
|
295
|
+
type ResolveRedirectHrefOptions = {
|
|
296
|
+
route: RouteGetResponseRedirect;
|
|
297
|
+
/** The path that matched the redirect, usually the result's `pageState.routePath`. */
|
|
298
|
+
routePath: string;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Builds the URL a redirect route sends the visitor to. Path variables in the target, such as
|
|
302
|
+
* `/new/:id`, are filled from `routePath`. Targets on the same domain come back as relative paths;
|
|
303
|
+
* absolute targets on another domain come back unchanged.
|
|
304
|
+
*/
|
|
305
|
+
declare const resolveRedirectHref: ({ route, routePath }: ResolveRedirectHrefOptions) => string;
|
|
266
306
|
|
|
267
307
|
type CustomRoute = {
|
|
268
308
|
id: string;
|
|
@@ -276,4 +316,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
276
316
|
|
|
277
317
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
278
318
|
|
|
279
|
-
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient,
|
|
319
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type ResolveRedirectHrefOptions, ResolveRouteFromCodeOptions, ResolvedComposition, ResolvedCompositionResult, ResolvedRouteResult, type RouteMatch, UniformCompositionProps, UniformContext, type UniformContextProps, type UniformPageParameters, UniformPlayground, type UniformPlaygroundProps, createUniformPlaygroundStaticParams, createUniformStaticParams, deserializePageState, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, requireComposition, resolvePlaygroundRoute, resolveRedirectHref, serverContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { CanvasClient, CompositionDeliveryClient, RouteClient,
|
|
2
|
-
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient, RouteGetResponseRedirect } from '@uniformdev/canvas';
|
|
2
|
+
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult, PageState } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
5
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
6
|
-
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-ChDH4dMd.js';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-ChDH4dMd.js';
|
|
7
|
+
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
7
8
|
import React from 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import '
|
|
9
|
+
import { a as ResolvedRouteResult, b as ResolvedComposition, R as ResolvedCompositionResult } from './composition-CGU7iH-k.js';
|
|
10
|
+
export { c as ResolvedNotFound, d as ResolvedRedirect } from './composition-CGU7iH-k.js';
|
|
11
|
+
import { E as EdgeRouteFilter } from './models-C8OdCO44.js';
|
|
12
|
+
import { b as ResolveRouteFromCodeOptions } from './resolveRouteFromPath-CnfnaxY2.js';
|
|
13
|
+
export { P as PageStateSource, R as ResolveCompositionByIdOptions, a as ResolveCompositionBySlugOptions, c as ResolveRouteFromPathOptions, d as ResolveRouteFunction, r as resolveCompositionById, e as resolveCompositionBySlug, f as resolveRouteFromCode, g as resolveRouteFromPath } from './resolveRouteFromPath-CnfnaxY2.js';
|
|
12
14
|
import '@uniformdev/context';
|
|
13
15
|
|
|
14
16
|
type SpecificCacheMode<TCacheMode extends CacheMode> = {
|
|
@@ -202,6 +204,24 @@ type PlaygroundParameters = {
|
|
|
202
204
|
}>;
|
|
203
205
|
};
|
|
204
206
|
|
|
207
|
+
type UniformContextProps = {
|
|
208
|
+
/**
|
|
209
|
+
* Component to initialize Uniform context on the client.
|
|
210
|
+
*/
|
|
211
|
+
clientContextComponent?: ClientContextComponent;
|
|
212
|
+
/**
|
|
213
|
+
* The page's primary composition. It sets the composition metadata of the visitor's context and
|
|
214
|
+
* the default consent, and loads the contextual editing script in the editor and draft states.
|
|
215
|
+
* Takes any resolver result as is; a redirect or not found result sets no composition metadata.
|
|
216
|
+
*/
|
|
217
|
+
result: ResolvedRouteResult | undefined;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Initializes Uniform context on the client and loads the contextual editing script. Render it
|
|
221
|
+
* once per page, next to one or more `UniformComposition` elements.
|
|
222
|
+
*/
|
|
223
|
+
declare function UniformContext(props: UniformContextProps): React.JSX.Element;
|
|
224
|
+
|
|
205
225
|
type UniformPageParameters = {
|
|
206
226
|
params: Promise<{
|
|
207
227
|
code: string;
|
|
@@ -211,8 +231,13 @@ type AwaitedUniformPageParameters = {
|
|
|
211
231
|
params: Awaited<UniformPageParameters['params']>;
|
|
212
232
|
};
|
|
213
233
|
|
|
214
|
-
type UniformPlaygroundProps = UniformCompositionProps
|
|
215
|
-
|
|
234
|
+
type UniformPlaygroundProps = UniformCompositionProps & Pick<UniformContextProps, 'clientContextComponent'>;
|
|
235
|
+
/**
|
|
236
|
+
* Renders a playground page in draft mode: the composition, usually from `resolvePlaygroundRoute`,
|
|
237
|
+
* with its `UniformContext`. Renders a message outside draft mode. Keep it out of layouts that
|
|
238
|
+
* render their own `UniformContext`, which would initialize Uniform context twice.
|
|
239
|
+
*/
|
|
240
|
+
declare const UniformPlayground: ({ clientContextComponent, ...props }: UniformPlaygroundProps) => Promise<React.JSX.Element>;
|
|
216
241
|
|
|
217
242
|
type CreateStaticParamsOptions = {
|
|
218
243
|
paths: string[];
|
|
@@ -220,49 +245,64 @@ type CreateStaticParamsOptions = {
|
|
|
220
245
|
path: string;
|
|
221
246
|
}) => Promise<RewriteRequestPathResult | undefined>;
|
|
222
247
|
locale?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Prebuilds pages in edge mode, for apps that use `uniformEdgeMiddleware`. `true` puts every
|
|
250
|
+
* path in edge mode. A filter is asked about each path; pass the same filter the middleware uses
|
|
251
|
+
* so the prebuilt codes match the ones it rewrites to.
|
|
252
|
+
*/
|
|
253
|
+
edgeMode?: boolean | EdgeRouteFilter;
|
|
223
254
|
};
|
|
224
255
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* @returns
|
|
256
|
+
* Generates the playground code for the first of the given paths. Playground requests are drafts,
|
|
257
|
+
* which evaluate while the page renders, so there is one code per composition.
|
|
228
258
|
*/
|
|
229
259
|
declare const createUniformPlaygroundStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
230
260
|
code: string;
|
|
231
261
|
}[]>;
|
|
232
262
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
263
|
+
* Generates one code per published composition among the given paths, for `generateStaticParams`
|
|
264
|
+
* of the `[code]` route. Codes carry the route, not an evaluation, so each path has one static page
|
|
265
|
+
* whose variants are chosen in the browser or at the edge.
|
|
236
266
|
*/
|
|
237
267
|
declare const createUniformStaticParams: (options: CreateStaticParamsOptions) => Promise<{
|
|
238
268
|
code: string;
|
|
239
269
|
}[]>;
|
|
240
270
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
component: ComponentInstance;
|
|
248
|
-
}) => boolean;
|
|
249
|
-
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
|
-
/**
|
|
251
|
-
* Whether to evaluate tests
|
|
252
|
-
* @defaultValue true
|
|
253
|
-
*/
|
|
254
|
-
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
|
-
/**
|
|
256
|
-
* Whether to evaluate personalizations
|
|
257
|
-
* @defaultValue true
|
|
258
|
-
*/
|
|
259
|
-
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
|
-
};
|
|
261
|
-
declare const precomputeComposition: ({ pageState, route, evaluatePersonalizations, evaluateTests, }: PrecomputeCompositionOptions) => Promise<void>;
|
|
262
|
-
|
|
263
|
-
declare const resolvePlaygroundRoute: ({ code }: {
|
|
271
|
+
/**
|
|
272
|
+
* Reads the page state the middleware encoded in a `[code]` path segment: the route path,
|
|
273
|
+
* composition state, release, locale and preview settings. The resolvers accept the code
|
|
274
|
+
* directly; call this when the page needs the page state before resolving.
|
|
275
|
+
*/
|
|
276
|
+
declare const deserializePageState: ({ code }: {
|
|
264
277
|
code: string;
|
|
265
|
-
}) =>
|
|
278
|
+
}) => PageState;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Returns the result when it resolved to a composition, ready for `UniformComposition`. Otherwise
|
|
282
|
+
* it throws through Next.js navigation: `notFound()` when nothing matched, `permanentRedirect` for
|
|
283
|
+
* 301 and 308 redirect targets, and `redirect` for the rest. The redirect target is built with
|
|
284
|
+
* `resolveRedirectHref`.
|
|
285
|
+
*/
|
|
286
|
+
declare const requireComposition: (result: ResolvedRouteResult) => ResolvedComposition;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Resolves the composition of a playground code. The code carries the composition id, and the
|
|
290
|
+
* composition resolves in the editor state, falling back to the draft state. `route` is undefined
|
|
291
|
+
* outside draft mode, without fetching, and when the composition does not exist.
|
|
292
|
+
*/
|
|
293
|
+
declare const resolvePlaygroundRoute: ({ code, }: ResolveRouteFromCodeOptions) => Promise<ResolvedCompositionResult>;
|
|
294
|
+
|
|
295
|
+
type ResolveRedirectHrefOptions = {
|
|
296
|
+
route: RouteGetResponseRedirect;
|
|
297
|
+
/** The path that matched the redirect, usually the result's `pageState.routePath`. */
|
|
298
|
+
routePath: string;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Builds the URL a redirect route sends the visitor to. Path variables in the target, such as
|
|
302
|
+
* `/new/:id`, are filled from `routePath`. Targets on the same domain come back as relative paths;
|
|
303
|
+
* absolute targets on another domain come back unchanged.
|
|
304
|
+
*/
|
|
305
|
+
declare const resolveRedirectHref: ({ route, routePath }: ResolveRedirectHrefOptions) => string;
|
|
266
306
|
|
|
267
307
|
type CustomRoute = {
|
|
268
308
|
id: string;
|
|
@@ -276,4 +316,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
276
316
|
|
|
277
317
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
278
318
|
|
|
279
|
-
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient,
|
|
319
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type ResolveRedirectHrefOptions, ResolveRouteFromCodeOptions, ResolvedComposition, ResolvedCompositionResult, ResolvedRouteResult, type RouteMatch, UniformCompositionProps, UniformContext, type UniformContextProps, type UniformPageParameters, UniformPlayground, type UniformPlaygroundProps, createUniformPlaygroundStaticParams, createUniformStaticParams, deserializePageState, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, requireComposition, resolvePlaygroundRoute, resolveRedirectHref, serverContext };
|