@pyreon/zero 0.4.1 → 0.11.0

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 (110) hide show
  1. package/lib/cache.js.map +1 -1
  2. package/lib/client.js.map +1 -1
  3. package/lib/config.js.map +1 -1
  4. package/lib/font.js.map +1 -1
  5. package/lib/fs-router-BkbIWqek.js.map +1 -1
  6. package/lib/fs-router-n4VA4lxu.js.map +1 -1
  7. package/lib/image-plugin.js.map +1 -1
  8. package/lib/image.js +5 -5
  9. package/lib/image.js.map +1 -1
  10. package/lib/index.js +14 -14
  11. package/lib/index.js.map +1 -1
  12. package/lib/link.js +9 -9
  13. package/lib/link.js.map +1 -1
  14. package/lib/script.js +1 -1
  15. package/lib/script.js.map +1 -1
  16. package/lib/seo.js.map +1 -1
  17. package/lib/theme.js +2 -2
  18. package/lib/theme.js.map +1 -1
  19. package/package.json +14 -13
  20. package/src/actions.ts +20 -28
  21. package/src/adapters/bun.ts +7 -7
  22. package/src/adapters/index.ts +12 -14
  23. package/src/adapters/node.ts +8 -11
  24. package/src/adapters/static.ts +3 -3
  25. package/src/api-routes.ts +23 -50
  26. package/src/app.ts +9 -13
  27. package/src/cache.ts +16 -29
  28. package/src/client.ts +8 -8
  29. package/src/compression.ts +21 -28
  30. package/src/config.ts +6 -7
  31. package/src/cors.ts +20 -28
  32. package/src/entry-server.ts +15 -19
  33. package/src/error-overlay.ts +10 -13
  34. package/src/font.ts +44 -55
  35. package/src/fs-router.ts +44 -63
  36. package/src/image-plugin.ts +53 -79
  37. package/src/image.tsx +41 -43
  38. package/src/index.ts +36 -36
  39. package/src/isr.ts +8 -8
  40. package/src/link.tsx +35 -38
  41. package/src/rate-limit.ts +15 -15
  42. package/src/script.tsx +21 -22
  43. package/src/seo.ts +47 -57
  44. package/src/sharp.d.ts +2 -6
  45. package/src/testing.ts +8 -12
  46. package/src/theme.tsx +19 -21
  47. package/src/types.ts +6 -6
  48. package/src/utils/use-intersection-observer.ts +2 -2
  49. package/src/utils/with-headers.ts +1 -4
  50. package/src/vite-plugin.ts +21 -28
  51. package/lib/types/actions.d.ts +0 -57
  52. package/lib/types/actions.d.ts.map +0 -1
  53. package/lib/types/adapters/bun.d.ts +0 -6
  54. package/lib/types/adapters/bun.d.ts.map +0 -1
  55. package/lib/types/adapters/index.d.ts +0 -10
  56. package/lib/types/adapters/index.d.ts.map +0 -1
  57. package/lib/types/adapters/node.d.ts +0 -6
  58. package/lib/types/adapters/node.d.ts.map +0 -1
  59. package/lib/types/adapters/static.d.ts +0 -7
  60. package/lib/types/adapters/static.d.ts.map +0 -1
  61. package/lib/types/api-routes.d.ts +0 -66
  62. package/lib/types/api-routes.d.ts.map +0 -1
  63. package/lib/types/app.d.ts +0 -24
  64. package/lib/types/app.d.ts.map +0 -1
  65. package/lib/types/cache.d.ts +0 -54
  66. package/lib/types/cache.d.ts.map +0 -1
  67. package/lib/types/client.d.ts +0 -19
  68. package/lib/types/client.d.ts.map +0 -1
  69. package/lib/types/compression.d.ts +0 -33
  70. package/lib/types/compression.d.ts.map +0 -1
  71. package/lib/types/config.d.ts +0 -18
  72. package/lib/types/config.d.ts.map +0 -1
  73. package/lib/types/cors.d.ts +0 -32
  74. package/lib/types/cors.d.ts.map +0 -1
  75. package/lib/types/entry-server.d.ts +0 -34
  76. package/lib/types/entry-server.d.ts.map +0 -1
  77. package/lib/types/error-overlay.d.ts +0 -6
  78. package/lib/types/error-overlay.d.ts.map +0 -1
  79. package/lib/types/font.d.ts +0 -119
  80. package/lib/types/font.d.ts.map +0 -1
  81. package/lib/types/fs-router.d.ts +0 -38
  82. package/lib/types/fs-router.d.ts.map +0 -1
  83. package/lib/types/image-plugin.d.ts +0 -79
  84. package/lib/types/image-plugin.d.ts.map +0 -1
  85. package/lib/types/image.d.ts +0 -51
  86. package/lib/types/image.d.ts.map +0 -1
  87. package/lib/types/index.d.ts +0 -37
  88. package/lib/types/index.d.ts.map +0 -1
  89. package/lib/types/isr.d.ts +0 -9
  90. package/lib/types/isr.d.ts.map +0 -1
  91. package/lib/types/link.d.ts +0 -116
  92. package/lib/types/link.d.ts.map +0 -1
  93. package/lib/types/rate-limit.d.ts +0 -34
  94. package/lib/types/rate-limit.d.ts.map +0 -1
  95. package/lib/types/script.d.ts +0 -35
  96. package/lib/types/script.d.ts.map +0 -1
  97. package/lib/types/seo.d.ts +0 -88
  98. package/lib/types/seo.d.ts.map +0 -1
  99. package/lib/types/testing.d.ts +0 -85
  100. package/lib/types/testing.d.ts.map +0 -1
  101. package/lib/types/theme.d.ts +0 -39
  102. package/lib/types/theme.d.ts.map +0 -1
  103. package/lib/types/types.d.ts +0 -109
  104. package/lib/types/types.d.ts.map +0 -1
  105. package/lib/types/utils/use-intersection-observer.d.ts +0 -10
  106. package/lib/types/utils/use-intersection-observer.d.ts.map +0 -1
  107. package/lib/types/utils/with-headers.d.ts +0 -6
  108. package/lib/types/utils/with-headers.d.ts.map +0 -1
  109. package/lib/types/vite-plugin.d.ts +0 -17
  110. package/lib/types/vite-plugin.d.ts.map +0 -1
@@ -1,33 +0,0 @@
1
- import type { Middleware } from '@pyreon/server';
2
- export interface CompressionConfig {
3
- /** Minimum response size in bytes to compress. Default: `1024` (1KB) */
4
- threshold?: number;
5
- /** Encoding preference order. Default: `["gzip", "deflate"]` */
6
- encodings?: ('gzip' | 'deflate')[];
7
- }
8
- /**
9
- * Compression middleware — compresses responses using gzip or deflate
10
- * based on the client's Accept-Encoding header.
11
- *
12
- * Only compresses text-based content types (HTML, JSON, JS, CSS, XML, SVG).
13
- * Skips responses below the size threshold and already-encoded responses.
14
- *
15
- * @example
16
- * import { compressionMiddleware } from "@pyreon/zero/compression"
17
- *
18
- * compressionMiddleware() // gzip with 1KB threshold
19
- * compressionMiddleware({ threshold: 512, encodings: ["gzip"] })
20
- */
21
- export declare function compressionMiddleware(config?: CompressionConfig): Middleware;
22
- /**
23
- * Compress a Response body if it meets the criteria.
24
- * Use this to post-process responses after the handler runs.
25
- *
26
- * @example
27
- * const response = await handler(request)
28
- * const compressed = await compressResponse(response, 'gzip', 1024)
29
- */
30
- export declare function compressResponse(response: Response, encoding: 'gzip' | 'deflate', threshold: number): Promise<Response>;
31
- /** Check if a content type is compressible. Exported for testing. */
32
- export declare function isCompressible(contentType: string): boolean;
33
- //# sourceMappingURL=compression.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../../src/compression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAA;AAInE,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gEAAgE;IAChE,SAAS,CAAC,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;CACnC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,iBAAsB,GAC7B,UAAU,CAeZ;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,QAAQ,CAAC,CA0BnB;AAWD,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE3D"}
@@ -1,18 +0,0 @@
1
- import type { ZeroConfig } from './types';
2
- /**
3
- * Define a Zero configuration.
4
- * Used in `zero.config.ts` at the project root.
5
- *
6
- * @example
7
- * import { defineConfig } from "@pyreon/zero/config"
8
- *
9
- * export default defineConfig({
10
- * mode: "ssr",
11
- * ssr: { mode: "stream" },
12
- * port: 3000,
13
- * })
14
- */
15
- export declare function defineConfig(config: ZeroConfig): ZeroConfig;
16
- /** Merge user config with defaults. */
17
- export declare function resolveConfig(userConfig?: ZeroConfig): Required<Pick<ZeroConfig, 'mode' | 'base' | 'port' | 'adapter'>> & ZeroConfig;
18
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE3D;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAe,GAC1B,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC,GACjE,UAAU,CAYX"}
@@ -1,32 +0,0 @@
1
- import type { Middleware } from '@pyreon/server';
2
- export interface CorsConfig {
3
- /** Allowed origins. Use `"*"` for any origin. Default: `"*"` */
4
- origin?: string | string[] | ((origin: string) => boolean);
5
- /** Allowed HTTP methods. Default: `["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]` */
6
- methods?: string[];
7
- /** Allowed request headers. Default: `["Content-Type", "Authorization"]` */
8
- allowedHeaders?: string[];
9
- /** Headers exposed to the client. Default: `[]` */
10
- exposedHeaders?: string[];
11
- /** Allow credentials (cookies, auth headers). Default: `false` */
12
- credentials?: boolean;
13
- /** Preflight cache duration in seconds. Default: `86400` (24 hours) */
14
- maxAge?: number;
15
- }
16
- /**
17
- * CORS middleware — handles preflight requests and sets appropriate
18
- * Access-Control headers on all responses.
19
- *
20
- * @example
21
- * import { corsMiddleware } from "@pyreon/zero/cors"
22
- *
23
- * corsMiddleware({ origin: "https://example.com", credentials: true })
24
- *
25
- * // Allow any origin
26
- * corsMiddleware({ origin: "*" })
27
- *
28
- * // Multiple origins
29
- * corsMiddleware({ origin: ["https://app.com", "https://admin.com"] })
30
- */
31
- export declare function corsMiddleware(config?: CorsConfig): Middleware;
32
- //# sourceMappingURL=cors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAA;AAInE,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,CAAA;IAC1D,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAKD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,MAAM,GAAE,UAAe,GAAG,UAAU,CA+ClE"}
@@ -1,34 +0,0 @@
1
- import type { RouteRecord } from '@pyreon/router';
2
- import type { Middleware } from '@pyreon/server';
3
- import type { ApiRouteEntry } from './api-routes';
4
- import type { RouteMiddlewareEntry, ZeroConfig } from './types';
5
- export interface CreateServerOptions {
6
- /** Route definitions. */
7
- routes: RouteRecord[];
8
- /** Zero config. */
9
- config?: ZeroConfig;
10
- /** Additional middleware. */
11
- middleware?: Middleware[];
12
- /** Per-route middleware from virtual:zero/route-middleware. */
13
- routeMiddleware?: RouteMiddlewareEntry[];
14
- /** API route entries from virtual:zero/api-routes. */
15
- apiRoutes?: ApiRouteEntry[];
16
- /** HTML template override. */
17
- template?: string;
18
- /** Client entry path. */
19
- clientEntry?: string;
20
- }
21
- /** Simple URL pattern matcher supporting :param and :param* segments. */
22
- export declare function matchPattern(pattern: string, path: string): boolean;
23
- /**
24
- * Create the SSR request handler for production.
25
- *
26
- * @example
27
- * import { routes } from "virtual:zero/routes"
28
- * import { routeMiddleware } from "virtual:zero/route-middleware"
29
- * import { createServer } from "@pyreon/zero"
30
- *
31
- * export default createServer({ routes, routeMiddleware, apiRoutes })
32
- */
33
- export declare function createServer(options: CreateServerOptions): (req: Request) => Promise<Response>;
34
- //# sourceMappingURL=entry-server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry-server.d.ts","sourceRoot":"","sources":["../../src/entry-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAA;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/D,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,mBAAmB;IACnB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,6BAA6B;IAC7B,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC,sDAAsD;IACtD,SAAS,CAAC,EAAE,aAAa,EAAE,CAAA;IAC3B,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAuBD,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAanE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,uCAgCxD"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Dev-only error overlay for SSR/loader errors.
3
- * Renders a styled HTML page with the error stack trace.
4
- */
5
- export declare function renderErrorOverlay(error: Error): string;
6
- //# sourceMappingURL=error-overlay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-overlay.d.ts","sourceRoot":"","sources":["../../src/error-overlay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA0FvD"}
@@ -1,119 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface FontConfig {
3
- /**
4
- * Google Fonts families.
5
- *
6
- * Accepts both string shorthand and structured objects:
7
- * - String: "Inter:wght@400;500;700" or "Inter:wght@100..900"
8
- * - Object: { family: "Inter", weights: [400, 500, 700] }
9
- * - Variable: { family: "Inter", variable: true, weightRange: [100, 900] }
10
- */
11
- google?: GoogleFontInput[];
12
- /** Local font files. */
13
- local?: LocalFont[];
14
- /** Default font-display strategy. Default: "swap" */
15
- display?: FontDisplay;
16
- /** Preload critical fonts. Default: true */
17
- preload?: boolean;
18
- /** Self-host Google Fonts at build time. Default: true */
19
- selfHost?: boolean;
20
- /** Fallback font metrics for reducing CLS. */
21
- fallbacks?: Record<string, FallbackMetrics>;
22
- }
23
- /** Static Google Font config. */
24
- export interface GoogleFontStatic {
25
- family: string;
26
- weights: number[];
27
- italic?: boolean;
28
- variable?: false;
29
- }
30
- /** Variable Google Font config. */
31
- export interface GoogleFontVariable {
32
- family: string;
33
- /** Weight range as [min, max] tuple. e.g. [100, 900] */
34
- weightRange: [number, number];
35
- italic?: boolean;
36
- variable: true;
37
- }
38
- /** Google font input: structured object or string shorthand. */
39
- export type GoogleFontInput = GoogleFontStatic | GoogleFontVariable | string;
40
- export interface LocalFont {
41
- family: string;
42
- src: string;
43
- /** Single weight (400) or variable range ("100 900"). */
44
- weight?: number | `${number} ${number}`;
45
- style?: 'normal' | 'italic';
46
- display?: FontDisplay;
47
- }
48
- export type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
49
- /** Metrics for generating size-adjusted fallback fonts to reduce CLS. */
50
- export interface FallbackMetrics {
51
- /** The fallback font to adjust. e.g. "Arial", "Georgia" */
52
- fallback: string;
53
- /** Size adjustment factor. e.g. 1.05 */
54
- sizeAdjust?: number;
55
- /** Ascent override percentage. e.g. 90 */
56
- ascentOverride?: number;
57
- /** Descent override percentage. e.g. 22 */
58
- descentOverride?: number;
59
- /** Line gap override percentage. e.g. 0 */
60
- lineGapOverride?: number;
61
- }
62
- interface ResolvedFontBase {
63
- family: string;
64
- italic: boolean;
65
- }
66
- interface StaticFont extends ResolvedFontBase {
67
- variable: false;
68
- weights: number[];
69
- }
70
- interface VariableFont extends ResolvedFontBase {
71
- variable: true;
72
- weightRange: [number, number];
73
- }
74
- type ResolvedFont = StaticFont | VariableFont;
75
- /**
76
- * Normalize a GoogleFontInput (string or object) into a ResolvedFont.
77
- */
78
- export declare function resolveGoogleFont(input: GoogleFontInput): ResolvedFont;
79
- /**
80
- * Parse Google Fonts family string shorthand.
81
- *
82
- * Static weights: "Inter:wght@400;500;700"
83
- * Variable range: "Inter:wght@100..900"
84
- * Variable with italic: "Inter:ital,wght@100..900"
85
- */
86
- export declare function parseGoogleFamily(input: string): ResolvedFont;
87
- /**
88
- * Generate a Google Fonts CSS URL.
89
- */
90
- export declare function googleFontsUrl(families: ResolvedFont[], display?: FontDisplay): string;
91
- /**
92
- * Zero font optimization Vite plugin.
93
- *
94
- * Dev mode: injects Google Fonts CDN link for fast startup.
95
- * Build mode: downloads and self-hosts fonts for maximum performance + privacy.
96
- *
97
- * @example
98
- * import { fontPlugin } from "@pyreon/zero/font"
99
- *
100
- * export default {
101
- * plugins: [
102
- * pyreon(),
103
- * zero(),
104
- * fontPlugin({
105
- * google: ["Inter:wght@400;500;600;700", "JetBrains Mono:wght@400"],
106
- * fallbacks: {
107
- * "Inter": { fallback: "Arial", sizeAdjust: 1.07, ascentOverride: 90 },
108
- * },
109
- * }),
110
- * ],
111
- * }
112
- */
113
- export declare function fontPlugin(config?: FontConfig): Plugin;
114
- /**
115
- * Generate CSS variables for font families.
116
- */
117
- export declare function fontVariables(families: Record<string, string>): string;
118
- export {};
119
- //# sourceMappingURL=font.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/font.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAYlC,MAAM,WAAW,UAAU;IACzB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,eAAe,EAAE,CAAA;IAC1B,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CAC5C;AAED,iCAAiC;AACjC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED,mCAAmC;AACnC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,IAAI,CAAA;CACf;AAED,gEAAgE;AAChE,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,MAAM,CAAA;AAE5E,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAA;IACvC,KA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AAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAKtE"}
@@ -1,38 +0,0 @@
1
- import type { FileRoute, RenderMode } from './types';
2
- /**
3
- * Parse a set of file paths (relative to routes dir) into FileRoute objects.
4
- *
5
- * @param files Array of file paths like ["index.tsx", "users/[id].tsx"]
6
- * @param defaultMode Default rendering mode from config
7
- */
8
- export declare function parseFileRoutes(files: string[], defaultMode?: RenderMode): FileRoute[];
9
- /**
10
- * Convert a file path (without extension) to a URL path pattern.
11
- *
12
- * Examples:
13
- * "index" → "/"
14
- * "about" → "/about"
15
- * "users/index" → "/users"
16
- * "users/[id]" → "/users/:id"
17
- * "blog/[...slug]" → "/blog/:slug*"
18
- * "(auth)/login" → "/login" (group stripped)
19
- * "_layout" → "/" (layout marker)
20
- */
21
- export declare function filePathToUrlPath(filePath: string): string;
22
- /**
23
- * Generate a virtual module that exports a nested route tree.
24
- * Wires up layouts as parent routes with children, loaders, guards,
25
- * error/loading components, middleware, and meta from route module exports.
26
- */
27
- export declare function generateRouteModule(files: string[], routesDir: string): string;
28
- /**
29
- * Generate a virtual module that maps URL patterns to their middleware exports.
30
- * Used by the server entry to dispatch per-route middleware.
31
- */
32
- export declare function generateMiddlewareModule(files: string[], routesDir: string): string;
33
- /**
34
- * Scan a directory for route files.
35
- * Returns paths relative to the routes directory.
36
- */
37
- export declare function scanRouteFiles(routesDir: string): Promise<string[]>;
38
- //# sourceMappingURL=fs-router.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs-router.d.ts","sourceRoot":"","sources":["../../src/fs-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AA6BpD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EAAE,EACf,WAAW,GAAE,UAAkB,GAC9B,SAAS,EAAE,CAKb;AA0CD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiC1D;AA0ED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,SAAS,EAAE,MAAM,GAChB,MAAM,CA6IR;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EAAE,EACf,SAAS,EAAE,MAAM,GAChB,MAAM,CAuBR;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoBzE"}
@@ -1,79 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface ImagePluginConfig {
3
- /** Output directory for processed images. Default: "assets/img" */
4
- outDir?: string;
5
- /** Default widths for responsive images. Default: [640, 1024, 1920] */
6
- widths?: number[];
7
- /** Output formats. Default: ["webp"] */
8
- formats?: ImageFormat[];
9
- /** Quality for lossy formats (1-100). Default: 80 */
10
- quality?: number;
11
- /** Blur placeholder size in px. Default: 16 */
12
- placeholderSize?: number;
13
- /** File patterns to process. Default: /\.(jpe?g|png|webp|avif)$/i */
14
- include?: RegExp;
15
- }
16
- export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png';
17
- /** Per-format source set for <picture> <source> elements. */
18
- export interface FormatSource {
19
- /** MIME type. e.g. "image/webp", "image/avif" */
20
- type: string;
21
- /** srcset string for this format. e.g. "/img-640.webp 640w, /img-1920.webp 1920w" */
22
- srcset: string;
23
- }
24
- export interface ProcessedImage {
25
- /** Fallback source path (last format, largest width). */
26
- src: string;
27
- /** Fallback srcset string (last format). */
28
- srcset: string;
29
- /** Intrinsic width. */
30
- width: number;
31
- /** Intrinsic height. */
32
- height: number;
33
- /** Base64 blur placeholder data URI. */
34
- placeholder: string;
35
- /** Per-format source sets for <picture> element. Ordered by priority (best format first). */
36
- formats: FormatSource[];
37
- /** Flat list of all sources. */
38
- sources: Array<{
39
- src: string;
40
- width: number;
41
- format: string;
42
- }>;
43
- }
44
- /**
45
- * Zero image processing Vite plugin.
46
- *
47
- * Transforms image imports with query params into optimized responsive images:
48
- *
49
- * @example
50
- * // vite.config.ts
51
- * import { imagePlugin } from "@pyreon/zero/image-plugin"
52
- *
53
- * export default {
54
- * plugins: [
55
- * pyreon(),
56
- * zero(),
57
- * imagePlugin({ widths: [480, 960, 1440], quality: 85 }),
58
- * ],
59
- * }
60
- *
61
- * @example
62
- * // In a component — import with ?optimize
63
- * import hero from "./images/hero.jpg?optimize"
64
- * // hero = { src, srcset, width, height, placeholder }
65
- *
66
- * <Image {...hero} alt="Hero" priority />
67
- */
68
- export declare function imagePlugin(config?: ImagePluginConfig): Plugin;
69
- /** @internal Exported for testing */
70
- export declare function parseJpegDimensions(buffer: Buffer): {
71
- width: number;
72
- height: number;
73
- };
74
- /** @internal Exported for testing */
75
- export declare function parseWebPDimensions(buffer: Buffer): {
76
- width: number;
77
- height: number;
78
- };
79
- //# sourceMappingURL=image-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image-plugin.d.ts","sourceRoot":"","sources":["../../src/image-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA4BlC,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,wCAAwC;IACxC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;AAE1D,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAA;IACX,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,6FAA6F;IAC7F,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/D;AAID;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAE,iBAAsB,GAAG,MAAM,CA2DlE;AA+KD,qCAAqC;AACrC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAqBA;AAED,qCAAqC;AACrC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAyBA"}
@@ -1,51 +0,0 @@
1
- import type { VNodeChild } from '@pyreon/core';
2
- import type { FormatSource } from './image-plugin';
3
- export interface ImageProps {
4
- /** Image source URL. */
5
- src: string;
6
- /** Alt text (required for accessibility). */
7
- alt: string;
8
- /** Intrinsic width of the image. */
9
- width: number;
10
- /** Intrinsic height of the image. */
11
- height: number;
12
- /** Responsive sizes attribute. Default: "100vw" */
13
- sizes?: string;
14
- /** Responsive srcset string or source array. */
15
- srcset?: string | ImageSource[];
16
- /** Per-format source sets for <picture>. Provided automatically by imagePlugin. */
17
- formats?: FormatSource[];
18
- /** Loading strategy. "lazy" uses IntersectionObserver, "eager" loads immediately. Default: "lazy" */
19
- loading?: 'lazy' | 'eager';
20
- /** Mark as priority (LCP image). Disables lazy loading, adds fetchpriority="high". */
21
- priority?: boolean;
22
- /** Low-quality placeholder image URL or base64 data URI for blur-up effect. */
23
- placeholder?: string;
24
- /** CSS class name. */
25
- class?: string;
26
- /** Inline styles. */
27
- style?: string;
28
- /** CSS object-fit. Default: "cover" */
29
- fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
30
- /** Decode async. Default: true */
31
- decoding?: 'sync' | 'async' | 'auto';
32
- }
33
- export interface ImageSource {
34
- src: string;
35
- width: number;
36
- }
37
- /**
38
- * Optimized image component with lazy loading, responsive images,
39
- * multi-format <picture> support, and blur-up placeholders.
40
- *
41
- * @example
42
- * // With imagePlugin — spread the import directly
43
- * import hero from "./hero.jpg?optimize"
44
- * <Image {...hero} alt="Hero" priority />
45
- *
46
- * @example
47
- * // Manual usage
48
- * <Image src="/hero.jpg" alt="Hero" width={1200} height={630} />
49
- */
50
- export declare function Image(props: ImageProps): VNodeChild;
51
- //# sourceMappingURL=image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAalD,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAA;IACX,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAAA;IAC/B,mFAAmF;IACnF,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,qGAAqG;IACrG,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC1B,sFAAsF;IACtF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAA;IAC1D,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAsGnD"}
@@ -1,37 +0,0 @@
1
- export type { CreateAppOptions } from './app';
2
- export { createApp } from './app';
3
- export type { CreateServerOptions } from './entry-server';
4
- export { createServer } from './entry-server';
5
- export { zeroPlugin as default } from './vite-plugin';
6
- export { filePathToUrlPath, generateMiddlewareModule, generateRouteModule, parseFileRoutes, scanRouteFiles, } from './fs-router';
7
- export { defineConfig, resolveConfig } from './config';
8
- export { createISRHandler } from './isr';
9
- export { bunAdapter, nodeAdapter, resolveAdapter, staticAdapter, } from './adapters';
10
- export type { ImageProps, ImageSource } from './image';
11
- export { Image } from './image';
12
- export type { LinkProps, LinkRenderProps, UseLinkReturn } from './link';
13
- export { createLink, Link, useLink } from './link';
14
- export type { ScriptProps, ScriptStrategy } from './script';
15
- export { Script } from './script';
16
- export type { CacheConfig, CacheRule } from './cache';
17
- export { cacheMiddleware, securityHeaders, varyEncoding } from './cache';
18
- export type { FallbackMetrics, FontConfig, FontDisplay, GoogleFontInput, GoogleFontStatic, GoogleFontVariable, LocalFont, } from './font';
19
- export { fontPlugin, fontVariables } from './font';
20
- export type { FormatSource, ImageFormat, ImagePluginConfig, ProcessedImage, } from './image-plugin';
21
- export { imagePlugin } from './image-plugin';
22
- export type { Theme } from './theme';
23
- export { initTheme, resolvedTheme, setTheme, ThemeToggle, theme, themeScript, toggleTheme, } from './theme';
24
- export type { ChangeFreq, JsonLdType, RobotsConfig, RobotsRule, SeoPluginConfig, SitemapConfig, SitemapEntry, } from './seo';
25
- export { generateRobots, generateSitemap, jsonLd, seoMiddleware, seoPlugin, } from './seo';
26
- export type { ApiContext, ApiHandler, ApiRouteEntry, ApiRouteModule, HttpMethod, } from './api-routes';
27
- export { createApiMiddleware, generateApiRouteModule } from './api-routes';
28
- export type { CorsConfig } from './cors';
29
- export { corsMiddleware } from './cors';
30
- export type { RateLimitConfig } from './rate-limit';
31
- export { rateLimitMiddleware } from './rate-limit';
32
- export type { CompressionConfig } from './compression';
33
- export { compressionMiddleware, compressResponse, isCompressible, } from './compression';
34
- export type { Action, ActionContext, ActionHandler } from './actions';
35
- export { createActionMiddleware, defineAction } from './actions';
36
- export type { Adapter, AdapterBuildOptions, FileRoute, ISRConfig, LoaderContext, RenderMode, RouteMeta, RouteMiddlewareEntry, RouteModule, ZeroConfig, } from './types';
37
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA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,EACL,SAAS,EACT,aAAa,EACb,QAAQ,EACR,WAAW,EACX,KAAK,EACL,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAA;AAIhB,YAAY,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,OAAO,CAAA;AACd,OAAO,EACL,cAAc,EACd,eAAe,EACf,MAAM,EACN,aAAa,EACb,SAAS,GACV,MAAM,OAAO,CAAA;AAId,YAAY,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,UAAU,GACX,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAI1E,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAIvC,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAIlD,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,GACf,MAAM,eAAe,CAAA;AAItB,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACrE,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIhE,YAAY,EACV,OAAO,EACP,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAA"}
@@ -1,9 +0,0 @@
1
- import type { ISRConfig } from './types';
2
- /**
3
- * In-memory ISR cache with stale-while-revalidate semantics.
4
- *
5
- * Wraps an SSR handler and caches responses per URL path.
6
- * Serves stale content immediately while revalidating in the background.
7
- */
8
- export declare function createISRHandler(handler: (req: Request) => Promise<Response>, config: ISRConfig): (req: Request) => Promise<Response>;
9
- //# sourceMappingURL=isr.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isr.d.ts","sourceRoot":"","sources":["../../src/isr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAUxC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,EAC5C,MAAM,EAAE,SAAS,GAChB,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA2ErC"}
@@ -1,116 +0,0 @@
1
- export interface LinkProps {
2
- /** Target URL path. */
3
- href: string;
4
- /** Link content. */
5
- children?: any;
6
- /** CSS class name. */
7
- class?: string;
8
- /** Class applied when this link matches the current route. */
9
- activeClass?: string;
10
- /** Class applied when this link exactly matches the current route. */
11
- exactActiveClass?: string;
12
- /** Prefetch strategy. Default: "hover" */
13
- prefetch?: 'hover' | 'viewport' | 'none';
14
- /** Open in new tab. */
15
- external?: boolean;
16
- /** Inline styles. */
17
- style?: string;
18
- /** ARIA label. */
19
- 'aria-label'?: string;
20
- }
21
- /** Props passed to a custom component via createLink. */
22
- export interface LinkRenderProps {
23
- href: string;
24
- ref: import('@pyreon/core').Ref<HTMLElement>;
25
- onClick: (e: MouseEvent) => void;
26
- onMouseEnter: () => void;
27
- onTouchStart: () => void;
28
- isActive: () => boolean;
29
- isExactActive: () => boolean;
30
- /** Reactive class string — pass directly to element for auto-updates on route change. */
31
- class: (() => string) | string | undefined;
32
- style?: string;
33
- target?: string;
34
- rel?: string;
35
- 'aria-label'?: string;
36
- children?: any;
37
- }
38
- /** Return type of useLink. */
39
- export interface UseLinkReturn {
40
- /** Ref object — attach to the root element for viewport-based prefetch. */
41
- ref: import('@pyreon/core').Ref<HTMLElement>;
42
- /** Click handler — performs client-side navigation. */
43
- handleClick: (e: MouseEvent) => void;
44
- /** Mouse enter handler — triggers hover prefetch. */
45
- handleMouseEnter: () => void;
46
- /** Touch start handler — triggers prefetch on mobile. */
47
- handleTouchStart: () => void;
48
- /** Whether the link partially matches the current route. */
49
- isActive: () => boolean;
50
- /** Whether the link exactly matches the current route. */
51
- isExactActive: () => boolean;
52
- /** Resolved class string including active classes. */
53
- classes: () => string;
54
- }
55
- /**
56
- * Composable that provides all link behavior — navigation, prefetching,
57
- * active state, and viewport observation.
58
- *
59
- * Use this for full control when `createLink` is too opinionated.
60
- *
61
- * @example
62
- * function MyLink(props: LinkProps) {
63
- * const link = useLink(props)
64
- * return (
65
- * <button ref={link.ref} class={link.classes()} onclick={link.handleClick}>
66
- * {props.children}
67
- * </button>
68
- * )
69
- * }
70
- */
71
- export declare function useLink(props: LinkProps): UseLinkReturn;
72
- /**
73
- * Higher-order component that wraps any component with link behavior.
74
- *
75
- * The wrapped component receives {@link LinkRenderProps} with all handlers,
76
- * active state, and accessibility attributes pre-wired.
77
- *
78
- * @example
79
- * // Custom button link
80
- * const ButtonLink = createLink((props) => (
81
- * <button
82
- * ref={props.ref}
83
- * class={props.class}
84
- * onclick={props.onClick}
85
- * onmouseenter={props.onMouseEnter}
86
- * >
87
- * {props.children}
88
- * </button>
89
- * ))
90
- *
91
- * // Custom styled component
92
- * const CardLink = createLink((props) => (
93
- * <div
94
- * ref={props.ref}
95
- * class={`card ${props.isActive() ? "card--active" : ""}`}
96
- * onclick={props.onClick}
97
- * onmouseenter={props.onMouseEnter}
98
- * >
99
- * {props.children}
100
- * </div>
101
- * ))
102
- *
103
- * // Usage
104
- * <ButtonLink href="/about">About</ButtonLink>
105
- * <CardLink href="/posts" prefetch="viewport">Posts</CardLink>
106
- */
107
- export declare function createLink(Component: (props: LinkRenderProps) => any): (props: LinkProps) => any;
108
- /**
109
- * Default navigation link built on an `<a>` tag.
110
- *
111
- * @example
112
- * <Link href="/about" prefetch="viewport">About</Link>
113
- * <Link href="/posts" activeClass="nav-active">Posts</Link>
114
- */
115
- export declare const Link: (props: LinkProps) => any;
116
- //# sourceMappingURL=link.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/link.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,SAAS;IACxB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,oBAAoB;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,CAAA;IACxC,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,OAAO,cAAc,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;IAC5C,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;IAChC,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,QAAQ,EAAE,MAAM,OAAO,CAAA;IACvB,aAAa,EAAE,MAAM,OAAO,CAAA;IAC5B,yFAAyF;IACzF,KAAK,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC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