@real-router/angular 0.24.0 → 0.24.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.
- package/dist/fesm2022/real-router-angular-ssr.mjs +228 -311
- package/dist/fesm2022/real-router-angular-ssr.mjs.map +1 -1
- package/dist/fesm2022/real-router-angular.mjs +1712 -2865
- package/dist/fesm2022/real-router-angular.mjs.map +1 -1
- package/dist/package.json +2 -3
- package/dist/types/real-router-angular-ssr.d.ts +55 -45
- package/dist/types/real-router-angular-ssr.d.ts.map +1 -1
- package/dist/types/real-router-angular.d.ts +540 -302
- package/dist/types/real-router-angular.d.ts.map +1 -1
- package/package.json +14 -15
- package/dist/README.md +0 -801
- package/ssr/components/ClientOnly.ts +0 -27
- package/ssr/components/HttpStatusCode.ts +0 -123
- package/ssr/components/ServerOnly.ts +0 -27
- package/ssr/functions/injectDeferred.ts +0 -92
- package/ssr/functions/provideHttpStatusSink.ts +0 -43
- package/ssr/ng-package.json +0 -6
- package/ssr/public_api.ts +0 -35
- package/ssr/utils/createHttpStatusSink.ts +0 -61
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-router/angular",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Angular 22 integration for Real-Router",
|
|
6
6
|
"exports": {
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
21
|
-
"ssr"
|
|
20
|
+
"dist"
|
|
22
21
|
],
|
|
23
22
|
"homepage": "https://github.com/greydragon888/real-router",
|
|
24
23
|
"repository": {
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EnvironmentProviders, InjectionToken, OnInit, Signal, TemplateRef } from "@angular/core";
|
|
3
|
+
export declare class ClientOnly {
|
|
4
|
+
readonly fallback: import("@angular/core").InputSignal<TemplateRef<unknown> | undefined>;
|
|
5
|
+
readonly mounted: import("@angular/core").WritableSignal<boolean>;
|
|
6
|
+
constructor();
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClientOnly, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ClientOnly, "client-only", never, {
|
|
9
|
+
"fallback": {
|
|
10
|
+
"alias": "fallback";
|
|
11
|
+
"required": false;
|
|
12
|
+
"isSignal": true;
|
|
13
|
+
};
|
|
14
|
+
}, {}, never, ["*"], true, never>;
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
export declare class ServerOnly {
|
|
17
|
+
readonly fallback: import("@angular/core").InputSignal<TemplateRef<unknown> | undefined>;
|
|
18
|
+
readonly mounted: import("@angular/core").WritableSignal<boolean>;
|
|
19
|
+
constructor();
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ServerOnly, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ServerOnly, "server-only", never, {
|
|
22
|
+
"fallback": {
|
|
23
|
+
"alias": "fallback";
|
|
24
|
+
"required": false;
|
|
25
|
+
"isSignal": true;
|
|
26
|
+
};
|
|
27
|
+
}, {}, never, ["*"], true, never>;
|
|
18
28
|
}
|
|
19
|
-
|
|
20
29
|
/**
|
|
21
30
|
* Render-time HTTP status declaration. Mount inside a route component
|
|
22
31
|
* (typical use case: a glob `*` route's NotFound page) when the status is
|
|
@@ -83,25 +92,30 @@ declare class ServerOnly {
|
|
|
83
92
|
* 5xx / dropped connection, not silent corruption. Pass a real HTTP status
|
|
84
93
|
* integer (commonly 4xx/5xx; 100-999 is what Node accepts).
|
|
85
94
|
*/
|
|
86
|
-
declare class HttpStatusCode implements OnInit {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
export declare class HttpStatusCode implements OnInit {
|
|
96
|
+
/**
|
|
97
|
+
* HTTP status to apply to the response. Common values: 404, 410, 451, 503.
|
|
98
|
+
*
|
|
99
|
+
* Declared as optional so the signal is safe to read in `ngOnInit` under
|
|
100
|
+
* both AOT (template binding fires before init hooks) and JIT/TestBed
|
|
101
|
+
* (`componentRef.setInput("code", N)` writes the value before the first
|
|
102
|
+
* change detection). `input.required` would trip `NG0950` in the JIT path
|
|
103
|
+
* because the required-flag is asserted independently of the runtime
|
|
104
|
+
* value. Consumers should always pass a value — `undefined` makes
|
|
105
|
+
* `ngOnInit` skip the sink write rather than throw.
|
|
106
|
+
*/
|
|
107
|
+
readonly code: import("@angular/core").InputSignal<number | undefined>;
|
|
108
|
+
private readonly sink;
|
|
109
|
+
ngOnInit(): void;
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HttpStatusCode, never>;
|
|
111
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HttpStatusCode, "http-status-code", never, {
|
|
112
|
+
"code": {
|
|
113
|
+
"alias": "code";
|
|
114
|
+
"required": false;
|
|
115
|
+
"isSignal": true;
|
|
116
|
+
};
|
|
117
|
+
}, {}, never, never, true, never>;
|
|
103
118
|
}
|
|
104
|
-
|
|
105
119
|
/**
|
|
106
120
|
* Read a deferred promise published by `defer({ deferred: { <key>: Promise } })`
|
|
107
121
|
* inside an SSR data loader. Returns an Angular `Signal<T | undefined>` that
|
|
@@ -135,8 +149,7 @@ declare class HttpStatusCode implements OnInit {
|
|
|
135
149
|
* `@if (signal()) { … } @else { … }` or the `async` pipe with
|
|
136
150
|
* `from(deferredPromise)` instead.
|
|
137
151
|
*/
|
|
138
|
-
declare function injectDeferred<T = unknown>(key: string): Signal<T | undefined>;
|
|
139
|
-
|
|
152
|
+
export declare function injectDeferred<T = unknown>(key: string): Signal<T | undefined>;
|
|
140
153
|
/**
|
|
141
154
|
* Render-scoped HTTP status sink. Created per request on the server and
|
|
142
155
|
* provided via `provideHttpStatusSink(sink)` (or directly through
|
|
@@ -167,9 +180,9 @@ declare function injectDeferred<T = unknown>(key: string): Signal<T | undefined>
|
|
|
167
180
|
* `req` directly silently no-ops.
|
|
168
181
|
*/
|
|
169
182
|
interface HttpStatusSink {
|
|
170
|
-
|
|
183
|
+
code: number | undefined;
|
|
171
184
|
}
|
|
172
|
-
declare function createHttpStatusSink(): HttpStatusSink;
|
|
185
|
+
export declare function createHttpStatusSink(): HttpStatusSink;
|
|
173
186
|
/**
|
|
174
187
|
* DI token for the request-scoped HTTP status sink. Application-side wiring:
|
|
175
188
|
*
|
|
@@ -189,8 +202,7 @@ declare function createHttpStatusSink(): HttpStatusSink;
|
|
|
189
202
|
* response.status(sink.code ?? 200).send(html);
|
|
190
203
|
* ```
|
|
191
204
|
*/
|
|
192
|
-
declare const HTTP_STATUS_SINK: InjectionToken<HttpStatusSink>;
|
|
193
|
-
|
|
205
|
+
export declare const HTTP_STATUS_SINK: InjectionToken<HttpStatusSink>;
|
|
194
206
|
/**
|
|
195
207
|
* Environment providers for a request-scoped `HttpStatusSink`. Pair with
|
|
196
208
|
* `createHttpStatusSink()` and read `sink.code` after the SSR render pass
|
|
@@ -220,8 +232,6 @@ declare const HTTP_STATUS_SINK: InjectionToken<HttpStatusSink>;
|
|
|
220
232
|
* Use the explicit `useValue` form when you need to compose with other
|
|
221
233
|
* application providers in a single `providers: [...]` block.
|
|
222
234
|
*/
|
|
223
|
-
declare function provideHttpStatusSink(sink: HttpStatusSink): EnvironmentProviders;
|
|
224
|
-
|
|
225
|
-
export { ClientOnly, HTTP_STATUS_SINK, HttpStatusCode, ServerOnly, createHttpStatusSink, injectDeferred, provideHttpStatusSink };
|
|
235
|
+
export declare function provideHttpStatusSink(sink: HttpStatusSink): EnvironmentProviders;
|
|
226
236
|
export type { HttpStatusSink };
|
|
227
|
-
//# sourceMappingURL=real-router-angular-ssr.d.ts.map
|
|
237
|
+
//# sourceMappingURL=real-router-angular-ssr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real-router-angular-ssr.d.ts","sources":["../../ssr/components/ClientOnly.ts","../../ssr/components/ServerOnly.ts","../../ssr/components/HttpStatusCode.ts","../../ssr/functions/injectDeferred.ts","../../ssr/utils/createHttpStatusSink.ts","../../ssr/functions/provideHttpStatusSink.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"real-router-angular-ssr.d.ts","names":[],"sources":["../../src/ssr/components/ClientOnly.ts","../../src/ssr/components/ServerOnly.ts","../../src/ssr/components/HttpStatusCode.ts","../../src/ssr/functions/injectDeferred.ts","../../src/ssr/utils/createHttpStatusSink.ts","../../src/ssr/functions/provideHttpStatusSink.ts"],"mappings":";;qBAgBa;WACF,kCAAQ,YAAA;WAER,iCAAO;;SAHL,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAU;MAAA;MAAA;MAAA;;;;qBCAV;WACF,kCAAQ,YAAA;WAER,iCAAO;;SAHL,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAU;MAAA;MAAA;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBC4DV,0BAA0B;;;;;;;;;;;;WAY5B,8BAAI;mBAII;EAEjB;SAlBW,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAc;MAAA;MAAA;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBC3BX,eAAe,aAC7B,cACC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCpBO;EACf;;wBAGc,wBAAwB;;;;;;;;;;;;;;;;;;;;qBAuB3B,kBAAgB,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBCtBb,sBACd,MAAM,iBACL"}
|