@askrjs/askr 0.0.2 → 0.0.4

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 (79) hide show
  1. package/README.md +8 -5
  2. package/dist/chunk-64C7W2AE.js +43 -0
  3. package/dist/chunk-64C7W2AE.js.map +1 -0
  4. package/dist/chunk-6FLMH4EL.js +124 -0
  5. package/dist/chunk-6FLMH4EL.js.map +1 -0
  6. package/dist/chunk-FJUXFA72.js +16 -0
  7. package/dist/chunk-FJUXFA72.js.map +1 -0
  8. package/dist/chunk-SALJX5PZ.js +26 -0
  9. package/dist/{chunk-KR6HG7HF.js.map → chunk-SALJX5PZ.js.map} +1 -1
  10. package/dist/{chunk-RJWOOUYV.js → chunk-VRAEBIJ3.js} +7 -9
  11. package/dist/chunk-VRAEBIJ3.js.map +1 -0
  12. package/dist/chunk-WTFWRSHB.js +98 -0
  13. package/dist/chunk-WTFWRSHB.js.map +1 -0
  14. package/dist/chunk-XHKZGJE3.js +2907 -0
  15. package/dist/chunk-XHKZGJE3.js.map +1 -0
  16. package/dist/chunk-Z5ZSTLYF.js +420 -0
  17. package/dist/chunk-Z5ZSTLYF.js.map +1 -0
  18. package/dist/fx/index.cjs +1193 -0
  19. package/dist/fx/index.cjs.map +1 -0
  20. package/dist/fx/index.d.cts +186 -0
  21. package/dist/fx/index.d.ts +186 -0
  22. package/dist/fx/index.js +418 -0
  23. package/dist/fx/index.js.map +1 -0
  24. package/dist/index.cjs +3020 -3506
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +74 -364
  27. package/dist/index.d.ts +74 -364
  28. package/dist/index.js +88 -656
  29. package/dist/index.js.map +1 -1
  30. package/dist/jsx/jsx-dev-runtime.cjs +1 -1
  31. package/dist/jsx/jsx-dev-runtime.cjs.map +1 -1
  32. package/dist/jsx/jsx-dev-runtime.d.cts +3 -2
  33. package/dist/jsx/jsx-dev-runtime.d.ts +3 -2
  34. package/dist/jsx/jsx-dev-runtime.js +2 -5
  35. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  36. package/dist/jsx/jsx-runtime.d.cts +2 -1
  37. package/dist/jsx/jsx-runtime.d.ts +2 -1
  38. package/dist/jsx/jsx-runtime.js +2 -4
  39. package/dist/{types-DLTViI21.d.cts → jsx-AzPM8gMS.d.cts} +6 -21
  40. package/dist/{types-DLTViI21.d.ts → jsx-AzPM8gMS.d.ts} +6 -21
  41. package/dist/navigate-LUVYHYZZ.js +17 -0
  42. package/dist/resources/index.cjs +1200 -0
  43. package/dist/resources/index.cjs.map +1 -0
  44. package/dist/resources/index.d.cts +21 -0
  45. package/dist/resources/index.d.ts +21 -0
  46. package/dist/resources/index.js +278 -0
  47. package/dist/resources/index.js.map +1 -0
  48. package/dist/{route-P5YQBT4T.js → route-BCND6MPK.js} +5 -4
  49. package/dist/router/index.cjs +3247 -0
  50. package/dist/router/index.cjs.map +1 -0
  51. package/dist/router/index.d.cts +64 -0
  52. package/dist/router/index.d.ts +64 -0
  53. package/dist/router/index.js +49 -0
  54. package/dist/router/index.js.map +1 -0
  55. package/dist/router-DaGtH1Sq.d.cts +36 -0
  56. package/dist/router-DaGtH1Sq.d.ts +36 -0
  57. package/dist/ssr/index.cjs +4059 -0
  58. package/dist/ssr/index.cjs.map +1 -0
  59. package/dist/ssr/index.d.cts +123 -0
  60. package/dist/ssr/index.d.ts +123 -0
  61. package/dist/ssr/index.js +666 -0
  62. package/dist/ssr/index.js.map +1 -0
  63. package/dist/types-CZ5sWur5.d.cts +23 -0
  64. package/dist/types-CZHOAiC1.d.ts +23 -0
  65. package/package.json +21 -7
  66. package/src/jsx/types.ts +4 -17
  67. package/dist/chunk-KR6HG7HF.js +0 -38
  68. package/dist/chunk-MIPES65F.js +0 -3023
  69. package/dist/chunk-MIPES65F.js.map +0 -1
  70. package/dist/chunk-PFOLLB6A.js +0 -524
  71. package/dist/chunk-PFOLLB6A.js.map +0 -1
  72. package/dist/chunk-QECQ2TF6.js +0 -28
  73. package/dist/chunk-QECQ2TF6.js.map +0 -1
  74. package/dist/chunk-RJWOOUYV.js.map +0 -1
  75. package/dist/navigate-SDZNA2ZE.js +0 -16
  76. package/dist/ssr-65K3IJ6B.js +0 -28
  77. package/dist/ssr-65K3IJ6B.js.map +0 -1
  78. /package/dist/{navigate-SDZNA2ZE.js.map → navigate-LUVYHYZZ.js.map} +0 -0
  79. /package/dist/{route-P5YQBT4T.js.map → route-BCND6MPK.js.map} +0 -0
@@ -0,0 +1,123 @@
1
+ import { P as Props, J as JSXElement } from '../jsx-AzPM8gMS.cjs';
2
+ import { b as RouteHandler } from '../router-DaGtH1Sq.cjs';
3
+
4
+ /**
5
+ * Common call contracts: SSR error types
6
+ */
7
+ declare class SSRDataMissingError extends Error {
8
+ readonly code = "SSR_DATA_MISSING";
9
+ constructor(message?: string);
10
+ }
11
+
12
+ /**
13
+ * Common call contracts: SSR types
14
+ */
15
+ type SSRData = Record<string, unknown>;
16
+ /** Lightweight context for synchronous render passes */
17
+ type RenderContext = {
18
+ seed: number;
19
+ };
20
+
21
+ /**
22
+ * Shared SSR types
23
+ */
24
+
25
+ /** VNode representation for SSR rendering */
26
+ type VNode = {
27
+ type: string | SSRComponent;
28
+ props?: Props;
29
+ children?: unknown[];
30
+ };
31
+ /**
32
+ * Component function signature for SSR.
33
+ * Components receive props and an optional context with signal and SSR context.
34
+ */
35
+ type SSRComponent = (props: Props, context?: {
36
+ signal?: AbortSignal;
37
+ ssr?: RenderContext;
38
+ }) => VNode | JSXElement | string | number | boolean | null;
39
+
40
+ /**
41
+ * SSR Data Management
42
+ *
43
+ * Manages render-phase keying for deterministic SSR data lookup.
44
+ * Note: SSR collection/prepass APIs have been removed — SSR is strictly synchronous.
45
+ */
46
+
47
+ type ResourceDescriptor = {
48
+ key: string;
49
+ fn: (opts: {
50
+ signal?: AbortSignal;
51
+ }) => Promise<unknown> | unknown;
52
+ deps: unknown[];
53
+ index: number;
54
+ };
55
+ type ResourcePlan = {
56
+ resources: ResourceDescriptor[];
57
+ };
58
+ /** @deprecated SSR prepass has been removed */
59
+ declare function resolvePlan(_plan: ResourcePlan): Promise<Record<string, unknown>>;
60
+ /** @deprecated SSR prepass has been removed */
61
+ declare function collectResources(_opts: {
62
+ url: string;
63
+ routes: SSRRoute[];
64
+ }): ResourcePlan;
65
+ /** @deprecated Alias for resolvePlan */
66
+ declare const resolveResources: typeof resolvePlan;
67
+
68
+ /**
69
+ * SSR - Server-Side Rendering
70
+ *
71
+ * Renders Askr components to static HTML strings for server-side rendering.
72
+ * SSR is synchronous: async components are not supported; async work should use
73
+ * `resource()` which is rejected during synchronous SSR. This module throws
74
+ * when an async component or async resource is encountered during sync SSR.
75
+ */
76
+
77
+ type Component = SSRComponent;
78
+ declare function pushSSRStrictPurityGuard(): void;
79
+ declare function popSSRStrictPurityGuard(): void;
80
+ /**
81
+ * Single synchronous SSR entrypoint: render a component to an HTML string.
82
+ * This is strictly synchronous and deterministic. Optionally provide a seed
83
+ * for deterministic randomness via `options.seed`.
84
+ */
85
+ declare function renderToStringSync(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | null, props?: Record<string, unknown>, options?: {
86
+ seed?: number;
87
+ data?: SSRData;
88
+ }): string;
89
+ declare function renderToStringSyncForUrl(opts: {
90
+ url: string;
91
+ routes: Array<{
92
+ path: string;
93
+ handler: RouteHandler;
94
+ namespace?: string;
95
+ }>;
96
+ options?: {
97
+ seed?: number;
98
+ data?: SSRData;
99
+ };
100
+ }): string;
101
+
102
+ type SSRRoute = {
103
+ path: string;
104
+ handler: RouteHandler;
105
+ namespace?: string;
106
+ };
107
+ declare function renderToString(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | null): string;
108
+ declare function renderToString(opts: {
109
+ url: string;
110
+ routes: SSRRoute[];
111
+ seed?: number;
112
+ data?: SSRData;
113
+ }): string;
114
+ declare function renderToStream(opts: {
115
+ url: string;
116
+ routes: SSRRoute[];
117
+ seed?: number;
118
+ data?: SSRData;
119
+ onChunk(html: string): void;
120
+ onComplete(): void;
121
+ }): void;
122
+
123
+ export { type Component, type ResourcePlan, type SSRComponent, SSRDataMissingError, type SSRRoute, type VNode, collectResources, popSSRStrictPurityGuard, pushSSRStrictPurityGuard, renderToStream, renderToString, renderToStringSync, renderToStringSyncForUrl, resolvePlan, resolveResources };
@@ -0,0 +1,123 @@
1
+ import { P as Props, J as JSXElement } from '../jsx-AzPM8gMS.js';
2
+ import { b as RouteHandler } from '../router-DaGtH1Sq.js';
3
+
4
+ /**
5
+ * Common call contracts: SSR error types
6
+ */
7
+ declare class SSRDataMissingError extends Error {
8
+ readonly code = "SSR_DATA_MISSING";
9
+ constructor(message?: string);
10
+ }
11
+
12
+ /**
13
+ * Common call contracts: SSR types
14
+ */
15
+ type SSRData = Record<string, unknown>;
16
+ /** Lightweight context for synchronous render passes */
17
+ type RenderContext = {
18
+ seed: number;
19
+ };
20
+
21
+ /**
22
+ * Shared SSR types
23
+ */
24
+
25
+ /** VNode representation for SSR rendering */
26
+ type VNode = {
27
+ type: string | SSRComponent;
28
+ props?: Props;
29
+ children?: unknown[];
30
+ };
31
+ /**
32
+ * Component function signature for SSR.
33
+ * Components receive props and an optional context with signal and SSR context.
34
+ */
35
+ type SSRComponent = (props: Props, context?: {
36
+ signal?: AbortSignal;
37
+ ssr?: RenderContext;
38
+ }) => VNode | JSXElement | string | number | boolean | null;
39
+
40
+ /**
41
+ * SSR Data Management
42
+ *
43
+ * Manages render-phase keying for deterministic SSR data lookup.
44
+ * Note: SSR collection/prepass APIs have been removed — SSR is strictly synchronous.
45
+ */
46
+
47
+ type ResourceDescriptor = {
48
+ key: string;
49
+ fn: (opts: {
50
+ signal?: AbortSignal;
51
+ }) => Promise<unknown> | unknown;
52
+ deps: unknown[];
53
+ index: number;
54
+ };
55
+ type ResourcePlan = {
56
+ resources: ResourceDescriptor[];
57
+ };
58
+ /** @deprecated SSR prepass has been removed */
59
+ declare function resolvePlan(_plan: ResourcePlan): Promise<Record<string, unknown>>;
60
+ /** @deprecated SSR prepass has been removed */
61
+ declare function collectResources(_opts: {
62
+ url: string;
63
+ routes: SSRRoute[];
64
+ }): ResourcePlan;
65
+ /** @deprecated Alias for resolvePlan */
66
+ declare const resolveResources: typeof resolvePlan;
67
+
68
+ /**
69
+ * SSR - Server-Side Rendering
70
+ *
71
+ * Renders Askr components to static HTML strings for server-side rendering.
72
+ * SSR is synchronous: async components are not supported; async work should use
73
+ * `resource()` which is rejected during synchronous SSR. This module throws
74
+ * when an async component or async resource is encountered during sync SSR.
75
+ */
76
+
77
+ type Component = SSRComponent;
78
+ declare function pushSSRStrictPurityGuard(): void;
79
+ declare function popSSRStrictPurityGuard(): void;
80
+ /**
81
+ * Single synchronous SSR entrypoint: render a component to an HTML string.
82
+ * This is strictly synchronous and deterministic. Optionally provide a seed
83
+ * for deterministic randomness via `options.seed`.
84
+ */
85
+ declare function renderToStringSync(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | null, props?: Record<string, unknown>, options?: {
86
+ seed?: number;
87
+ data?: SSRData;
88
+ }): string;
89
+ declare function renderToStringSyncForUrl(opts: {
90
+ url: string;
91
+ routes: Array<{
92
+ path: string;
93
+ handler: RouteHandler;
94
+ namespace?: string;
95
+ }>;
96
+ options?: {
97
+ seed?: number;
98
+ data?: SSRData;
99
+ };
100
+ }): string;
101
+
102
+ type SSRRoute = {
103
+ path: string;
104
+ handler: RouteHandler;
105
+ namespace?: string;
106
+ };
107
+ declare function renderToString(component: (props?: Record<string, unknown>) => VNode | JSXElement | string | number | null): string;
108
+ declare function renderToString(opts: {
109
+ url: string;
110
+ routes: SSRRoute[];
111
+ seed?: number;
112
+ data?: SSRData;
113
+ }): string;
114
+ declare function renderToStream(opts: {
115
+ url: string;
116
+ routes: SSRRoute[];
117
+ seed?: number;
118
+ data?: SSRData;
119
+ onChunk(html: string): void;
120
+ onComplete(): void;
121
+ }): void;
122
+
123
+ export { type Component, type ResourcePlan, type SSRComponent, SSRDataMissingError, type SSRRoute, type VNode, collectResources, popSSRStrictPurityGuard, pushSSRStrictPurityGuard, renderToStream, renderToString, renderToStringSync, renderToStringSyncForUrl, resolvePlan, resolveResources };