@analogjs/router 2.0.0-alpha.9 → 2.0.0-beta.2

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.
Files changed (38) hide show
  1. package/fesm2022/{analogjs-router-debug.page-e5DJlNv3.mjs → analogjs-router-debug.page-C7mEWSZu.mjs} +4 -4
  2. package/fesm2022/{analogjs-router-debug.page-e5DJlNv3.mjs.map → analogjs-router-debug.page-C7mEWSZu.mjs.map} +1 -1
  3. package/fesm2022/analogjs-router-server-actions.mjs.map +1 -1
  4. package/fesm2022/analogjs-router-server.mjs +4 -12
  5. package/fesm2022/analogjs-router-server.mjs.map +1 -1
  6. package/fesm2022/analogjs-router.mjs +12 -12
  7. package/fesm2022/analogjs-router.mjs.map +1 -1
  8. package/index.d.ts +265 -16
  9. package/package.json +8 -4
  10. package/server/actions/index.d.ts +16 -1
  11. package/server/index.d.ts +28 -4
  12. package/tokens/index.d.ts +16 -12
  13. package/lib/cache-key.d.ts +0 -3
  14. package/lib/constants.d.ts +0 -2
  15. package/lib/cookie-interceptor.d.ts +0 -2
  16. package/lib/debug/debug.page.d.ts +0 -17
  17. package/lib/debug/index.d.ts +0 -16
  18. package/lib/debug/routes.d.ts +0 -10
  19. package/lib/define-route.d.ts +0 -46
  20. package/lib/endpoints.d.ts +0 -5
  21. package/lib/form-action.directive.d.ts +0 -19
  22. package/lib/get-load-resolver.d.ts +0 -8
  23. package/lib/inject-load.d.ts +0 -6
  24. package/lib/inject-route-endpoint-url.d.ts +0 -2
  25. package/lib/markdown-helpers.d.ts +0 -2
  26. package/lib/meta-tags.d.ts +0 -28
  27. package/lib/models.d.ts +0 -29
  28. package/lib/provide-file-router.d.ts +0 -18
  29. package/lib/request-context.d.ts +0 -12
  30. package/lib/route-config.d.ts +0 -2
  31. package/lib/route-types.d.ts +0 -10
  32. package/lib/routes.d.ts +0 -19
  33. package/lib/server.component.d.ts +0 -32
  34. package/server/actions/actions.d.ts +0 -12
  35. package/server/provide-server-context.d.ts +0 -10
  36. package/server/render.d.ts +0 -12
  37. package/server/server-component-render.d.ts +0 -4
  38. package/server/tokens.d.ts +0 -7
@@ -1,10 +0,0 @@
1
- import type { H3Event, H3EventContext } from 'h3';
2
- import type { $Fetch } from 'nitropack';
3
- export type PageServerLoad = {
4
- params: H3EventContext['params'];
5
- req: H3Event['node']['req'];
6
- res: H3Event['node']['res'];
7
- fetch: $Fetch;
8
- event: H3Event;
9
- };
10
- export type LoadResult<A extends (pageServerLoad: PageServerLoad) => Promise<any>> = Awaited<ReturnType<A>>;
package/lib/routes.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import type { Route } from '@angular/router';
2
- import type { RouteExport } from './models';
3
- /**
4
- * This variable reference is replaced with a glob of all page routes.
5
- */
6
- export declare let ANALOG_ROUTE_FILES: {};
7
- /**
8
- * This variable reference is replaced with a glob of all content routes.
9
- */
10
- export declare let ANALOG_CONTENT_ROUTE_FILES: {};
11
- export type Files = Record<string, () => Promise<RouteExport | string>>;
12
- /**
13
- * A function used to parse list of files and create configuration of routes.
14
- *
15
- * @param files
16
- * @returns Array of routes
17
- */
18
- export declare function createRoutes(files: Files, debug?: boolean): Route[];
19
- export declare const routes: Route[];
@@ -1,32 +0,0 @@
1
- import { SafeHtml } from '@angular/platform-browser';
2
- import * as i0 from "@angular/core";
3
- type ServerProps = Record<string, any>;
4
- type ServerOutputs = Record<string, any>;
5
- /**
6
- * @description
7
- * Component that defines the bridge between the client and server-only
8
- * components. The component passes the component ID and props to the server
9
- * and retrieves the rendered HTML and outputs from the server-only component.
10
- *
11
- * Status: experimental
12
- */
13
- export declare class ServerOnly {
14
- component: import("@angular/core").InputSignal<string>;
15
- props: import("@angular/core").InputSignal<ServerProps | undefined>;
16
- outputs: import("@angular/core").OutputEmitterRef<ServerOutputs>;
17
- private http;
18
- private sanitizer;
19
- protected content: import("@angular/core").WritableSignal<SafeHtml>;
20
- private route;
21
- private baseURL;
22
- private transferState;
23
- constructor();
24
- updateContent(content: {
25
- html: string;
26
- outputs: ServerOutputs;
27
- }): void;
28
- getComponentUrl(componentId: string): string;
29
- static ɵfac: i0.ɵɵFactoryDeclaration<ServerOnly, never>;
30
- static ɵcmp: i0.ɵɵ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>;
31
- }
32
- export {};
@@ -1,12 +0,0 @@
1
- import type { H3Event, H3EventContext } from 'h3';
2
- import type { $Fetch } from 'nitropack';
3
- export type PageServerAction = {
4
- params: H3EventContext['params'];
5
- req: H3Event['node']['req'];
6
- res: H3Event['node']['res'];
7
- fetch: $Fetch;
8
- event: H3Event;
9
- };
10
- export declare function fail<T = object>(status: number, errors: T): Response;
11
- export declare function json<T = object>(data: T, config?: ResponseInit): Response;
12
- export declare function redirect(url: string, config?: number | ResponseInit): Response;
@@ -1,10 +0,0 @@
1
- import { StaticProvider } from '@angular/core';
2
- import { ServerRequest, ServerResponse } from '@analogjs/router/tokens';
3
- export declare function provideServerContext({ req, res, }: {
4
- req: ServerRequest;
5
- res: ServerResponse;
6
- }): StaticProvider[];
7
- export declare function getBaseUrl(req: ServerRequest): string;
8
- export declare function getRequestProtocol(req: ServerRequest, opts?: {
9
- xForwardedProto?: boolean;
10
- }): "https" | "http";
@@ -1,12 +0,0 @@
1
- import { ApplicationConfig, Provider, Type } from '@angular/core';
2
- import type { ServerContext } from '@analogjs/router/tokens';
3
- /**
4
- * Returns a function that accepts the navigation URL,
5
- * the root HTML, and server context.
6
- *
7
- * @param rootComponent
8
- * @param config
9
- * @param platformProviders
10
- * @returns Promise<string | Reponse>
11
- */
12
- export declare function render(rootComponent: Type<unknown>, config: ApplicationConfig, platformProviders?: Provider[]): (url: string, document: string, serverContext: ServerContext) => Promise<string | Response>;
@@ -1,4 +0,0 @@
1
- import { ApplicationConfig } from '@angular/core';
2
- import { ServerContext } from '@analogjs/router/tokens';
3
- export declare function serverComponentRequest(serverContext: ServerContext): string | undefined;
4
- export declare function renderServerComponent(url: string, serverContext: ServerContext, config?: ApplicationConfig): Promise<Response>;
@@ -1,7 +0,0 @@
1
- import { InjectionToken, Provider } from '@angular/core';
2
- export declare const STATIC_PROPS: InjectionToken<Record<string, any>>;
3
- export declare function provideStaticProps<T = Record<string, any>>(props: T): Provider;
4
- export declare function injectStaticProps(): Record<string, any>;
5
- export declare function injectStaticOutputs<T>(): {
6
- set(data: T): void;
7
- };