@analogjs/router 3.0.0-alpha.2 → 3.0.0-alpha.21
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/content/package.json +4 -0
- package/fesm2022/analogjs-router-content.mjs +63 -0
- package/fesm2022/analogjs-router-content.mjs.map +1 -0
- package/fesm2022/analogjs-router-server-actions.mjs +327 -31
- package/fesm2022/analogjs-router-server-actions.mjs.map +1 -1
- package/fesm2022/analogjs-router-server.mjs +151 -199
- package/fesm2022/analogjs-router-server.mjs.map +1 -1
- package/fesm2022/analogjs-router-tanstack-query-server.mjs +22 -0
- package/fesm2022/analogjs-router-tanstack-query-server.mjs.map +1 -0
- package/fesm2022/analogjs-router-tanstack-query.mjs +39 -0
- package/fesm2022/analogjs-router-tanstack-query.mjs.map +1 -0
- package/fesm2022/analogjs-router-tokens.mjs +15 -18
- package/fesm2022/analogjs-router-tokens.mjs.map +1 -1
- package/fesm2022/analogjs-router.mjs +960 -815
- package/fesm2022/analogjs-router.mjs.map +1 -1
- package/fesm2022/debug.page.mjs +135 -0
- package/fesm2022/debug.page.mjs.map +1 -0
- package/fesm2022/provide-analog-query.mjs +23 -0
- package/fesm2022/provide-analog-query.mjs.map +1 -0
- package/fesm2022/route-files.mjs +345 -0
- package/fesm2022/route-files.mjs.map +1 -0
- package/fesm2022/routes.mjs +28 -0
- package/fesm2022/routes.mjs.map +1 -0
- package/package.json +67 -27
- package/server/actions/package.json +4 -0
- package/server/package.json +4 -0
- package/tanstack-query/package.json +4 -0
- package/tanstack-query/server/package.json +4 -0
- package/tokens/package.json +4 -0
- package/types/content/src/index.d.ts +4 -0
- package/types/content/src/lib/debug/routes.d.ts +10 -0
- package/types/content/src/lib/markdown-helpers.d.ts +2 -0
- package/types/content/src/lib/routes.d.ts +8 -0
- package/types/content/src/lib/with-content-routes.d.ts +2 -0
- package/types/server/actions/src/actions.d.ts +13 -0
- package/types/server/actions/src/define-action.d.ts +54 -0
- package/types/server/actions/src/define-api-route.d.ts +57 -0
- package/types/server/actions/src/define-page-load.d.ts +55 -0
- package/types/server/actions/src/define-server-route.d.ts +68 -0
- package/types/server/actions/src/index.d.ts +9 -0
- package/types/server/actions/src/parse-request-data.d.ts +9 -0
- package/types/server/actions/src/validate.d.ts +8 -0
- package/types/server/src/index.d.ts +4 -0
- package/types/server/src/provide-server-context.d.ts +11 -0
- package/types/server/src/render.d.ts +12 -0
- package/types/server/src/server-component-render.d.ts +4 -0
- package/types/server/src/tokens.d.ts +7 -0
- package/types/src/index.d.ts +27 -0
- package/types/src/lib/cache-key.d.ts +3 -0
- package/types/src/lib/constants.d.ts +2 -0
- package/types/src/lib/cookie-interceptor.d.ts +4 -0
- package/types/src/lib/debug/debug.page.d.ts +20 -0
- package/types/src/lib/debug/index.d.ts +10 -0
- package/types/src/lib/debug/routes.d.ts +10 -0
- package/types/src/lib/define-route.d.ts +51 -0
- package/types/src/lib/endpoints.d.ts +5 -0
- package/types/src/lib/experimental.d.ts +140 -0
- package/types/src/lib/form-action.directive.d.ts +25 -0
- package/types/src/lib/get-load-resolver.d.ts +8 -0
- package/types/src/lib/inject-load.d.ts +9 -0
- package/types/src/lib/inject-navigate.d.ts +23 -0
- package/types/src/lib/inject-route-context.d.ts +32 -0
- package/types/src/lib/inject-route-endpoint-url.d.ts +2 -0
- package/types/src/lib/inject-typed-params.d.ts +63 -0
- package/types/src/lib/json-ld.d.ts +31 -0
- package/types/src/lib/meta-tags.d.ts +33 -0
- package/types/src/lib/models.d.ts +32 -0
- package/types/src/lib/provide-file-router-base.d.ts +4 -0
- package/types/src/lib/provide-file-router.d.ts +12 -0
- package/types/src/lib/request-context.d.ts +13 -0
- package/types/src/lib/route-builder.d.ts +5 -0
- package/types/src/lib/route-config.d.ts +2 -0
- package/types/src/lib/route-files.d.ts +18 -0
- package/types/src/lib/route-path.d.ts +124 -0
- package/types/src/lib/route-types.d.ts +12 -0
- package/types/src/lib/routes.d.ts +11 -0
- package/types/src/lib/server.component.d.ts +33 -0
- package/types/src/lib/validation-errors.d.ts +7 -0
- package/types/tanstack-query/server/src/index.d.ts +1 -0
- package/types/tanstack-query/src/index.d.ts +2 -0
- package/types/tanstack-query/src/provide-analog-query.d.ts +4 -0
- package/types/tanstack-query/src/provide-server-analog-query.d.ts +2 -0
- package/types/tanstack-query/src/server-query.d.ts +16 -0
- package/types/tokens/src/index.d.ts +23 -0
- package/fesm2022/analogjs-router-debug.page-jzggTA45.mjs +0 -91
- package/fesm2022/analogjs-router-debug.page-jzggTA45.mjs.map +0 -1
- package/types/analogjs-router-server-actions.d.ts +0 -17
- package/types/analogjs-router-server.d.ts +0 -29
- package/types/analogjs-router-tokens.d.ts +0 -27
- package/types/analogjs-router.d.ts +0 -269
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-router-debug.page-jzggTA45.mjs","sources":["../../../../packages/router/src/lib/debug/debug.page.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\nimport { injectDebugRoutes, DebugRoute } from './routes';\n\ntype CollectedRoute = {\n path: string;\n filename: string;\n file: string;\n isLayout: boolean;\n};\n\n@Component({\n selector: 'analogjs-debug-routes-page',\n standalone: true,\n template: `\n <h2>Routes</h2>\n\n <div class=\"table-container\">\n <div class=\"table-header\">\n <div class=\"header-cell\">Route Path</div>\n <div class=\"header-cell\">File</div>\n <div class=\"header-cell\">Type</div>\n </div>\n <div class=\"table-body\">\n @for (\n collectedRoute of collectedRoutes;\n track collectedRoute.filename\n ) {\n <div class=\"table-row\">\n <div class=\"table-cell\">{{ collectedRoute.path }}</div>\n <div class=\"table-cell\" [title]=\"collectedRoute.filename\">\n {{ collectedRoute.file }}\n </div>\n <div class=\"table-cell\">\n {{ collectedRoute.isLayout ? 'Layout' : 'Page' }}\n </div>\n </div>\n }\n </div>\n </div>\n `,\n styles: `\n :host {\n width: 100%;\n }\n\n .table-container {\n width: 100%;\n max-width: 900px;\n margin: 0 auto;\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n }\n\n .table-header {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n background: gray;\n border-bottom: 2px solid #e5e7eb;\n }\n\n .header-cell {\n padding: 16px 24px;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 14px;\n letter-spacing: 0.05em;\n color: white;\n }\n\n .table-body {\n display: flex;\n flex-direction: column;\n }\n\n .table-row {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n border-bottom: 1px solid #e5e7eb;\n transition: background-color 0.2s ease;\n }\n\n .table-row:last-child {\n border-bottom: none;\n }\n\n .table-row:hover {\n background-color: #f9fafb;\n }\n\n .table-cell {\n padding: 16px 24px;\n font-size: 16px;\n color: #4b5563;\n }\n\n @media (max-width: 640px) {\n .table-container {\n border-radius: 0;\n margin: 0;\n }\n\n .header-cell,\n .table-cell {\n padding: 12px 16px;\n }\n }\n `,\n})\nexport default class DebugRoutesComponent {\n collectedRoutes: CollectedRoute[] = [];\n debugRoutes = injectDebugRoutes();\n\n ngOnInit() {\n this.traverseRoutes(this.debugRoutes);\n }\n\n traverseRoutes(routes: DebugRoute[], parent?: string) {\n routes.forEach((route) => {\n this.collectedRoutes.push({\n path: route.isLayout\n ? `${parent ? `/${parent}` : ''}${route.path ? `/${route.path}` : ''}`\n : `${parent ? `/${parent}` : ''}${\n route.path ? `/${route.path}` : '/'\n }`,\n filename: route.filename,\n file: route.filename?.replace(/(^.*)pages\\//, '') || '',\n isLayout: route.isLayout,\n });\n\n if (route.children) {\n const parentSegments = [parent, route.path];\n\n const fullParentPath = parentSegments.filter((s) => !!s).join('/');\n this.traverseRoutes(route.children, fullParentPath);\n }\n });\n }\n}\n"],"names":[],"mappings":";;;;AA+Gc,MAAO,oBAAoB,CAAA;AApGzC,IAAA,WAAA,GAAA;QAqGE,IAAA,CAAA,eAAe,GAAqB,EAAE;QACtC,IAAA,CAAA,WAAW,GAAG,iBAAiB,EAAE;AA2BlC,IAAA;IAzBC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;IACvC;IAEA,cAAc,CAAC,MAAoB,EAAE,MAAe,EAAA;AAClD,QAAA,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACvB,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBACxB,IAAI,EAAE,KAAK,CAAC;AACV,sBAAE,CAAA,EAAG,MAAM,GAAG,CAAA,CAAA,EAAI,MAAM,CAAA,CAAE,GAAG,EAAE,CAAA,EAAG,KAAK,CAAC,IAAI,GAAG,CAAA,CAAA,EAAI,KAAK,CAAC,IAAI,CAAA,CAAE,GAAG,EAAE,CAAA;AACpE,sBAAE,CAAA,EAAG,MAAM,GAAG,CAAA,CAAA,EAAI,MAAM,CAAA,CAAE,GAAG,EAAE,CAAA,EAC3B,KAAK,CAAC,IAAI,GAAG,CAAA,CAAA,EAAI,KAAK,CAAC,IAAI,CAAA,CAAE,GAAG,GAClC,CAAA,CAAE;gBACN,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACxB,gBAAA,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,IAAI,EAAE;gBACvD,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACzB,aAAA,CAAC;AAEF,YAAA,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC;gBAE3C,MAAM,cAAc,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBAClE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,cAAc,CAAC;YACrD;AACF,QAAA,CAAC,CAAC;IACJ;8GA5BmB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAjG7B;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,kzBAAA,CAAA,EAAA,CAAA,CAAA;;2FAuEkB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBApGxC,SAAS;+BACE,4BAA4B,EAAA,UAAA,EAC1B,IAAI,EAAA,QAAA,EACN;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,kzBAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { H3EventContext, H3Event } from 'nitro/h3';
|
|
2
|
-
import { $Fetch } from 'nitro/types';
|
|
3
|
-
|
|
4
|
-
type NodeContext = NonNullable<H3Event['node']>;
|
|
5
|
-
type PageServerAction = {
|
|
6
|
-
params: H3EventContext['params'];
|
|
7
|
-
req: NodeContext['req'];
|
|
8
|
-
res: NonNullable<NodeContext['res']>;
|
|
9
|
-
fetch: $Fetch;
|
|
10
|
-
event: H3Event;
|
|
11
|
-
};
|
|
12
|
-
declare function fail<T = object>(status: number, errors: T): Response;
|
|
13
|
-
declare function json<T = object>(data: T, config?: ResponseInit): Response;
|
|
14
|
-
declare function redirect(url: string, config?: number | ResponseInit): Response;
|
|
15
|
-
|
|
16
|
-
export { fail, json, redirect };
|
|
17
|
-
export type { PageServerAction };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { StaticProvider, ApplicationConfig, Type, Provider } from '@angular/core';
|
|
2
|
-
import { ServerRequest, ServerResponse, ServerInternalFetch, ServerContext } from '@analogjs/router/tokens';
|
|
3
|
-
|
|
4
|
-
declare function provideServerContext({ req, res, fetch, }: {
|
|
5
|
-
req: ServerRequest;
|
|
6
|
-
res: ServerResponse;
|
|
7
|
-
fetch?: ServerInternalFetch;
|
|
8
|
-
}): StaticProvider[];
|
|
9
|
-
|
|
10
|
-
declare function injectStaticProps(): Record<string, any>;
|
|
11
|
-
declare function injectStaticOutputs<T>(): {
|
|
12
|
-
set(data: T): void;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
declare function serverComponentRequest(serverContext: ServerContext): string | undefined;
|
|
16
|
-
declare function renderServerComponent(url: string, serverContext: ServerContext, config?: ApplicationConfig): Promise<Response>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Returns a function that accepts the navigation URL,
|
|
20
|
-
* the root HTML, and server context.
|
|
21
|
-
*
|
|
22
|
-
* @param rootComponent
|
|
23
|
-
* @param config
|
|
24
|
-
* @param platformProviders
|
|
25
|
-
* @returns Promise<string | Reponse>
|
|
26
|
-
*/
|
|
27
|
-
declare function render(rootComponent: Type<unknown>, config: ApplicationConfig, platformProviders?: Provider[]): (url: string, document: string, serverContext: ServerContext) => Promise<string | Response>;
|
|
28
|
-
|
|
29
|
-
export { injectStaticOutputs, injectStaticProps, provideServerContext, render, renderServerComponent, serverComponentRequest };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { $Fetch } from 'nitro/types';
|
|
3
|
-
import { IncomingMessage, ServerResponse as ServerResponse$1 } from 'node:http';
|
|
4
|
-
|
|
5
|
-
type ServerRequest = IncomingMessage & {
|
|
6
|
-
originalUrl: string;
|
|
7
|
-
};
|
|
8
|
-
type ServerResponse = ServerResponse$1;
|
|
9
|
-
type ServerInternalFetch = $Fetch;
|
|
10
|
-
type ServerContext = {
|
|
11
|
-
req: ServerRequest;
|
|
12
|
-
res: ServerResponse;
|
|
13
|
-
fetch?: ServerInternalFetch;
|
|
14
|
-
};
|
|
15
|
-
declare const REQUEST: InjectionToken<ServerRequest>;
|
|
16
|
-
declare const RESPONSE: InjectionToken<ServerResponse>;
|
|
17
|
-
declare const BASE_URL: InjectionToken<string>;
|
|
18
|
-
declare const INTERNAL_FETCH: InjectionToken<ServerInternalFetch>;
|
|
19
|
-
declare const API_PREFIX: InjectionToken<string>;
|
|
20
|
-
declare function injectRequest(): ServerRequest | null;
|
|
21
|
-
declare function injectResponse(): ServerResponse | null;
|
|
22
|
-
declare function injectBaseURL(): string | null;
|
|
23
|
-
declare function injectInternalServerFetch(): ServerInternalFetch | null;
|
|
24
|
-
declare function injectAPIPrefix(): string;
|
|
25
|
-
|
|
26
|
-
export { API_PREFIX, BASE_URL, INTERNAL_FETCH, REQUEST, RESPONSE, injectAPIPrefix, injectBaseURL, injectInternalServerFetch, injectRequest, injectResponse };
|
|
27
|
-
export type { ServerContext, ServerInternalFetch, ServerRequest, ServerResponse };
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Type, EnvironmentProviders, Injector } from '@angular/core';
|
|
3
|
-
import * as _angular_router from '@angular/router';
|
|
4
|
-
import { Route, ActivatedRoute, Router, CanActivateFn, DeprecatedGuard, CanActivateChildFn, CanDeactivateFn, CanMatchFn, ResolveFn, RouterFeatures, Routes, ActivatedRouteSnapshot } from '@angular/router';
|
|
5
|
-
import { H3EventContext, H3Event } from 'nitro/h3';
|
|
6
|
-
import { $Fetch } from 'nitro/types';
|
|
7
|
-
import * as rxjs from 'rxjs';
|
|
8
|
-
import { Observable } from 'rxjs';
|
|
9
|
-
import * as _angular_common_http from '@angular/common/http';
|
|
10
|
-
import { HttpRequest, HttpHandlerFn } from '@angular/common/http';
|
|
11
|
-
import { SafeHtml } from '@angular/platform-browser';
|
|
12
|
-
|
|
13
|
-
type RouteOmitted = 'component' | 'loadComponent' | 'loadChildren' | 'path' | 'pathMatch';
|
|
14
|
-
type RestrictedRoute = Omit<Route, RouteOmitted>;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Use `RouteMeta` type instead.
|
|
17
|
-
* For more info see: https://github.com/analogjs/analog/issues/223
|
|
18
|
-
*
|
|
19
|
-
* Defines additional route config metadata. This
|
|
20
|
-
* object is merged into the route config with
|
|
21
|
-
* the predefined file-based route.
|
|
22
|
-
*
|
|
23
|
-
* @usageNotes
|
|
24
|
-
*
|
|
25
|
-
* ```
|
|
26
|
-
* import { Component } from '@angular/core';
|
|
27
|
-
* import { defineRouteMeta } from '@analogjs/router';
|
|
28
|
-
*
|
|
29
|
-
* export const routeMeta = defineRouteMeta({
|
|
30
|
-
* title: 'Welcome'
|
|
31
|
-
* });
|
|
32
|
-
*
|
|
33
|
-
* @Component({
|
|
34
|
-
* template: `Home`,
|
|
35
|
-
* standalone: true,
|
|
36
|
-
* })
|
|
37
|
-
* export default class HomeComponent {}
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @param route
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
declare const defineRouteMeta: (route: RestrictedRoute) => RestrictedRoute;
|
|
44
|
-
/**
|
|
45
|
-
* Returns the instance of Angular Router
|
|
46
|
-
*
|
|
47
|
-
* @returns The router
|
|
48
|
-
*/
|
|
49
|
-
declare const injectRouter: () => Router;
|
|
50
|
-
/**
|
|
51
|
-
* Returns the instance of the Activate Route for the component
|
|
52
|
-
*
|
|
53
|
-
* @returns The activated route
|
|
54
|
-
*/
|
|
55
|
-
declare const injectActivatedRoute: () => ActivatedRoute;
|
|
56
|
-
|
|
57
|
-
declare const CHARSET_KEY = "charset";
|
|
58
|
-
declare const HTTP_EQUIV_KEY = "httpEquiv";
|
|
59
|
-
declare const NAME_KEY = "name";
|
|
60
|
-
declare const PROPERTY_KEY = "property";
|
|
61
|
-
declare const CONTENT_KEY = "content";
|
|
62
|
-
declare const ITEMPROP_KEY = "itemprop";
|
|
63
|
-
type MetaTag = (CharsetMetaTag & ExcludeRestMetaTagKeys<typeof CHARSET_KEY>) | (HttpEquivMetaTag & ExcludeRestMetaTagKeys<typeof HTTP_EQUIV_KEY>) | (NameMetaTag & ExcludeRestMetaTagKeys<typeof NAME_KEY>) | (PropertyMetaTag & ExcludeRestMetaTagKeys<typeof PROPERTY_KEY>) | (ItempropMetaTag & ExcludeRestMetaTagKeys<typeof ITEMPROP_KEY>);
|
|
64
|
-
type CharsetMetaTag = {
|
|
65
|
-
[CHARSET_KEY]: string;
|
|
66
|
-
};
|
|
67
|
-
type HttpEquivMetaTag = {
|
|
68
|
-
[HTTP_EQUIV_KEY]: string;
|
|
69
|
-
[CONTENT_KEY]: string;
|
|
70
|
-
};
|
|
71
|
-
type NameMetaTag = {
|
|
72
|
-
[NAME_KEY]: string;
|
|
73
|
-
[CONTENT_KEY]: string;
|
|
74
|
-
};
|
|
75
|
-
type PropertyMetaTag = {
|
|
76
|
-
[PROPERTY_KEY]: string;
|
|
77
|
-
[CONTENT_KEY]: string;
|
|
78
|
-
};
|
|
79
|
-
type ItempropMetaTag = {
|
|
80
|
-
[ITEMPROP_KEY]: string;
|
|
81
|
-
[CONTENT_KEY]: string;
|
|
82
|
-
};
|
|
83
|
-
type MetaTagKey = typeof CHARSET_KEY | typeof HTTP_EQUIV_KEY | typeof NAME_KEY | typeof PROPERTY_KEY | typeof ITEMPROP_KEY;
|
|
84
|
-
type ExcludeRestMetaTagKeys<Key extends MetaTagKey> = {
|
|
85
|
-
[K in Exclude<MetaTagKey, Key>]?: never;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
type OmittedRouteProps = 'path' | 'matcher' | 'component' | 'loadComponent' | 'children' | 'loadChildren' | 'canLoad' | 'outlet';
|
|
89
|
-
interface DefaultRouteMeta extends Omit<Route, OmittedRouteProps | keyof RedirectRouteMeta> {
|
|
90
|
-
canActivate?: CanActivateFn[] | DeprecatedGuard[];
|
|
91
|
-
canActivateChild?: CanActivateChildFn[];
|
|
92
|
-
canDeactivate?: CanDeactivateFn<unknown>[];
|
|
93
|
-
canMatch?: CanMatchFn[];
|
|
94
|
-
resolve?: {
|
|
95
|
-
[key: string | symbol]: ResolveFn<unknown>;
|
|
96
|
-
};
|
|
97
|
-
title?: string | ResolveFn<string>;
|
|
98
|
-
meta?: MetaTag[] | ResolveFn<MetaTag[]>;
|
|
99
|
-
}
|
|
100
|
-
interface RedirectRouteMeta {
|
|
101
|
-
redirectTo: string;
|
|
102
|
-
pathMatch?: Route['pathMatch'];
|
|
103
|
-
}
|
|
104
|
-
type RouteMeta = (DefaultRouteMeta & {
|
|
105
|
-
redirectTo?: never;
|
|
106
|
-
}) | RedirectRouteMeta;
|
|
107
|
-
type RouteExport = {
|
|
108
|
-
default: Type<unknown>;
|
|
109
|
-
routeMeta?: RouteMeta | ReturnType<typeof defineRouteMeta>;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
type Files = Record<string, () => Promise<RouteExport | string>>;
|
|
113
|
-
/**
|
|
114
|
-
* A function used to parse list of files and create configuration of routes.
|
|
115
|
-
*
|
|
116
|
-
* @param files
|
|
117
|
-
* @returns Array of routes
|
|
118
|
-
*/
|
|
119
|
-
declare function createRoutes(files: Files, debug?: boolean): Route[];
|
|
120
|
-
declare const routes: Route[];
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Sets up providers for the Angular router, and registers
|
|
124
|
-
* file-based routes. Additional features can be provided
|
|
125
|
-
* to further configure the behavior of the router.
|
|
126
|
-
*
|
|
127
|
-
* @param features
|
|
128
|
-
* @returns Providers and features to configure the router with routes
|
|
129
|
-
*/
|
|
130
|
-
declare function provideFileRouter(...features: RouterFeatures[]): EnvironmentProviders;
|
|
131
|
-
/**
|
|
132
|
-
* Provides extra custom routes in addition to the routes
|
|
133
|
-
* discovered from the filesystem-based routing. These routes are
|
|
134
|
-
* inserted before the filesystem-based routes, and take priority in
|
|
135
|
-
* route matching.
|
|
136
|
-
*/
|
|
137
|
-
declare function withExtraRoutes(routes: Routes): RouterFeatures;
|
|
138
|
-
|
|
139
|
-
type NodeContext = NonNullable<H3Event['node']>;
|
|
140
|
-
type PageServerLoad = {
|
|
141
|
-
params: H3EventContext['params'];
|
|
142
|
-
req: NodeContext['req'];
|
|
143
|
-
res: NonNullable<NodeContext['res']>;
|
|
144
|
-
fetch: $Fetch;
|
|
145
|
-
event: H3Event;
|
|
146
|
-
};
|
|
147
|
-
type LoadResult<A extends (pageServerLoad: PageServerLoad) => Promise<any>> = Awaited<ReturnType<A>>;
|
|
148
|
-
|
|
149
|
-
declare function injectLoad<T extends (pageServerLoad: PageServerLoad) => Promise<any>>(options?: {
|
|
150
|
-
injector?: Injector;
|
|
151
|
-
}): Observable<Awaited<ReturnType<T>>>;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Get server load resolver data for the route
|
|
155
|
-
*
|
|
156
|
-
* @param route Provides the route to get server load resolver
|
|
157
|
-
* @returns Returns server load resolver data for the route
|
|
158
|
-
*/
|
|
159
|
-
declare function getLoadResolver<T>(route: ActivatedRouteSnapshot): Promise<T>;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Interceptor that is server-aware when making HttpClient requests.
|
|
163
|
-
* Server-side requests use the full URL
|
|
164
|
-
* Prerendering uses the internal Nitro $fetch function, along with state transfer
|
|
165
|
-
* Client-side requests use the window.location.origin
|
|
166
|
-
*
|
|
167
|
-
* @param req HttpRequest<unknown>
|
|
168
|
-
* @param next HttpHandlerFn
|
|
169
|
-
* @returns
|
|
170
|
-
*/
|
|
171
|
-
declare function requestContextInterceptor(req: HttpRequest<unknown>, next: HttpHandlerFn): rxjs.Observable<_angular_common_http.HttpEvent<unknown>>;
|
|
172
|
-
|
|
173
|
-
declare function injectRouteEndpointURL(route: ActivatedRouteSnapshot): URL;
|
|
174
|
-
|
|
175
|
-
declare class FormAction {
|
|
176
|
-
action: _angular_core.InputSignal<string>;
|
|
177
|
-
onSuccess: _angular_core.OutputEmitterRef<unknown>;
|
|
178
|
-
onError: _angular_core.OutputEmitterRef<unknown>;
|
|
179
|
-
state: _angular_core.OutputEmitterRef<"error" | "redirect" | "navigate" | "submitting" | "success">;
|
|
180
|
-
private router;
|
|
181
|
-
private route;
|
|
182
|
-
private path;
|
|
183
|
-
submitted($event: any): void;
|
|
184
|
-
private _handleGet;
|
|
185
|
-
private _handlePost;
|
|
186
|
-
private _getPath;
|
|
187
|
-
private _isJSON;
|
|
188
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormAction, never>;
|
|
189
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FormAction, "form[action],form[method]", never, { "action": { "alias": "action"; "required": false; "isSignal": true; }; }, { "onSuccess": "onSuccess"; "onError": "onError"; "state": "state"; }, never, never, true, never>;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
type DebugRoute = {
|
|
193
|
-
path: string;
|
|
194
|
-
filename: string;
|
|
195
|
-
isLayout: boolean;
|
|
196
|
-
children?: DebugRoute[];
|
|
197
|
-
};
|
|
198
|
-
declare function injectDebugRoutes(): (Route & DebugRoute)[];
|
|
199
|
-
|
|
200
|
-
type CollectedRoute = {
|
|
201
|
-
path: string;
|
|
202
|
-
filename: string;
|
|
203
|
-
file: string;
|
|
204
|
-
isLayout: boolean;
|
|
205
|
-
};
|
|
206
|
-
declare class DebugRoutesComponent {
|
|
207
|
-
collectedRoutes: CollectedRoute[];
|
|
208
|
-
debugRoutes: (_angular_router.Route & DebugRoute)[];
|
|
209
|
-
ngOnInit(): void;
|
|
210
|
-
traverseRoutes(routes: DebugRoute[], parent?: string): void;
|
|
211
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DebugRoutesComponent, never>;
|
|
212
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DebugRoutesComponent, "analogjs-debug-routes-page", never, {}, {}, never, never, true, never>;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
declare namespace __debug_page {
|
|
216
|
-
export {
|
|
217
|
-
DebugRoutesComponent as default,
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Provides routes that provide additional
|
|
223
|
-
* pages for displaying and debugging
|
|
224
|
-
* routes.
|
|
225
|
-
*/
|
|
226
|
-
declare function withDebugRoutes(): {
|
|
227
|
-
ɵkind: number;
|
|
228
|
-
ɵproviders: {
|
|
229
|
-
provide: _angular_core.InjectionToken<_angular_router.Route[][]>;
|
|
230
|
-
useValue: {
|
|
231
|
-
path: string;
|
|
232
|
-
loadComponent: () => Promise<typeof __debug_page>;
|
|
233
|
-
}[];
|
|
234
|
-
multi: boolean;
|
|
235
|
-
}[];
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
type ServerProps = Record<string, any>;
|
|
239
|
-
type ServerOutputs = Record<string, any>;
|
|
240
|
-
/**
|
|
241
|
-
* @description
|
|
242
|
-
* Component that defines the bridge between the client and server-only
|
|
243
|
-
* components. The component passes the component ID and props to the server
|
|
244
|
-
* and retrieves the rendered HTML and outputs from the server-only component.
|
|
245
|
-
*
|
|
246
|
-
* Status: experimental
|
|
247
|
-
*/
|
|
248
|
-
declare class ServerOnly {
|
|
249
|
-
component: _angular_core.InputSignal<string>;
|
|
250
|
-
props: _angular_core.InputSignal<ServerProps | undefined>;
|
|
251
|
-
outputs: _angular_core.OutputEmitterRef<ServerOutputs>;
|
|
252
|
-
private http;
|
|
253
|
-
private sanitizer;
|
|
254
|
-
protected content: _angular_core.WritableSignal<SafeHtml>;
|
|
255
|
-
private route;
|
|
256
|
-
private baseURL;
|
|
257
|
-
private transferState;
|
|
258
|
-
constructor();
|
|
259
|
-
updateContent(content: {
|
|
260
|
-
html: string;
|
|
261
|
-
outputs: ServerOutputs;
|
|
262
|
-
}): void;
|
|
263
|
-
getComponentUrl(componentId: string): string;
|
|
264
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ServerOnly, never>;
|
|
265
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ServerOnly, "server-only,ServerOnly,Server", never, { "component": { "alias": "component"; "required": true; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; }, { "outputs": "outputs"; }, never, never, true, never>;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export { FormAction, ServerOnly, createRoutes, defineRouteMeta, getLoadResolver, injectActivatedRoute, injectDebugRoutes, injectLoad, injectRouteEndpointURL, injectRouter, provideFileRouter, requestContextInterceptor, routes, withDebugRoutes, withExtraRoutes };
|
|
269
|
-
export type { Files, LoadResult, MetaTag, PageServerLoad, RouteExport, RouteMeta };
|