@pyreon/zero 0.12.2 → 0.12.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 (145) hide show
  1. package/lib/actions.js +97 -0
  2. package/lib/actions.js.map +1 -0
  3. package/lib/ai.js +503 -0
  4. package/lib/ai.js.map +1 -0
  5. package/lib/api-routes.js +137 -0
  6. package/lib/api-routes.js.map +1 -0
  7. package/lib/compression.js +80 -0
  8. package/lib/compression.js.map +1 -0
  9. package/lib/cors.js +57 -0
  10. package/lib/cors.js.map +1 -0
  11. package/lib/csp.js +119 -0
  12. package/lib/csp.js.map +1 -0
  13. package/lib/env.js +217 -0
  14. package/lib/env.js.map +1 -0
  15. package/lib/favicon.js +424 -0
  16. package/lib/favicon.js.map +1 -0
  17. package/lib/i18n-routing.js +167 -0
  18. package/lib/i18n-routing.js.map +1 -0
  19. package/lib/index.js +340 -4015
  20. package/lib/index.js.map +1 -1
  21. package/lib/link.js +5 -0
  22. package/lib/link.js.map +1 -1
  23. package/lib/logger.js +78 -0
  24. package/lib/logger.js.map +1 -0
  25. package/lib/meta.js +310 -0
  26. package/lib/meta.js.map +1 -0
  27. package/lib/middleware.js +53 -0
  28. package/lib/middleware.js.map +1 -0
  29. package/lib/og-image.js +233 -0
  30. package/lib/og-image.js.map +1 -0
  31. package/lib/rate-limit.js +76 -0
  32. package/lib/rate-limit.js.map +1 -0
  33. package/lib/server.js +1534 -0
  34. package/lib/server.js.map +1 -0
  35. package/lib/testing.js +179 -0
  36. package/lib/testing.js.map +1 -0
  37. package/lib/theme.js +11 -2
  38. package/lib/theme.js.map +1 -1
  39. package/lib/types/actions.d.ts +27 -24
  40. package/lib/types/actions.d.ts.map +1 -1
  41. package/lib/types/ai.d.ts +76 -95
  42. package/lib/types/ai.d.ts.map +1 -1
  43. package/lib/types/api-routes.d.ts +37 -33
  44. package/lib/types/api-routes.d.ts.map +1 -1
  45. package/lib/types/cache.d.ts +26 -22
  46. package/lib/types/cache.d.ts.map +1 -1
  47. package/lib/types/client.d.ts +13 -9
  48. package/lib/types/client.d.ts.map +1 -1
  49. package/lib/types/compression.d.ts +14 -10
  50. package/lib/types/compression.d.ts.map +1 -1
  51. package/lib/types/config.d.ts +39 -4
  52. package/lib/types/config.d.ts.map +1 -1
  53. package/lib/types/cors.d.ts +20 -16
  54. package/lib/types/cors.d.ts.map +1 -1
  55. package/lib/types/csp.d.ts +42 -61
  56. package/lib/types/csp.d.ts.map +1 -1
  57. package/lib/types/env.d.ts +26 -26
  58. package/lib/types/env.d.ts.map +1 -1
  59. package/lib/types/favicon.d.ts +58 -54
  60. package/lib/types/favicon.d.ts.map +1 -1
  61. package/lib/types/font.d.ts +68 -65
  62. package/lib/types/font.d.ts.map +1 -1
  63. package/lib/types/i18n-routing.d.ts +43 -37
  64. package/lib/types/i18n-routing.d.ts.map +1 -1
  65. package/lib/types/image-plugin.d.ts +49 -45
  66. package/lib/types/image-plugin.d.ts.map +1 -1
  67. package/lib/types/image.d.ts +47 -36
  68. package/lib/types/image.d.ts.map +1 -1
  69. package/lib/types/index.d.ts +594 -56
  70. package/lib/types/index.d.ts.map +1 -1
  71. package/lib/types/link.d.ts +61 -56
  72. package/lib/types/link.d.ts.map +1 -1
  73. package/lib/types/logger.d.ts +37 -48
  74. package/lib/types/logger.d.ts.map +1 -1
  75. package/lib/types/meta.d.ts +145 -105
  76. package/lib/types/meta.d.ts.map +1 -1
  77. package/lib/types/middleware.d.ts +8 -4
  78. package/lib/types/middleware.d.ts.map +1 -1
  79. package/lib/types/og-image.d.ts +63 -59
  80. package/lib/types/og-image.d.ts.map +1 -1
  81. package/lib/types/rate-limit.d.ts +20 -16
  82. package/lib/types/rate-limit.d.ts.map +1 -1
  83. package/lib/types/script.d.ts +23 -19
  84. package/lib/types/script.d.ts.map +1 -1
  85. package/lib/types/seo.d.ts +47 -43
  86. package/lib/types/seo.d.ts.map +1 -1
  87. package/lib/types/server.d.ts +455 -0
  88. package/lib/types/server.d.ts.map +1 -0
  89. package/lib/types/testing.d.ts +64 -27
  90. package/lib/types/testing.d.ts.map +1 -1
  91. package/lib/types/theme.d.ts +22 -12
  92. package/lib/types/theme.d.ts.map +1 -1
  93. package/package.json +17 -12
  94. package/src/actions.ts +1 -3
  95. package/src/adapters/bun.ts +2 -0
  96. package/src/adapters/cloudflare.ts +2 -0
  97. package/src/adapters/netlify.ts +2 -0
  98. package/src/adapters/node.ts +2 -0
  99. package/src/adapters/validate.ts +16 -0
  100. package/src/adapters/vercel.ts +2 -0
  101. package/src/compression.ts +19 -3
  102. package/src/entry-server.ts +28 -5
  103. package/src/index.ts +20 -182
  104. package/src/link.tsx +6 -0
  105. package/src/meta.tsx +78 -16
  106. package/src/rate-limit.ts +11 -9
  107. package/src/server.ts +70 -0
  108. package/src/theme.tsx +12 -1
  109. package/src/vite-plugin.ts +5 -1
  110. package/lib/fs-router-Dil4IKZR.js +0 -290
  111. package/lib/fs-router-Dil4IKZR.js.map +0 -1
  112. package/lib/types/adapters/bun.d.ts +0 -6
  113. package/lib/types/adapters/bun.d.ts.map +0 -1
  114. package/lib/types/adapters/cloudflare.d.ts +0 -26
  115. package/lib/types/adapters/cloudflare.d.ts.map +0 -1
  116. package/lib/types/adapters/index.d.ts +0 -13
  117. package/lib/types/adapters/index.d.ts.map +0 -1
  118. package/lib/types/adapters/netlify.d.ts +0 -21
  119. package/lib/types/adapters/netlify.d.ts.map +0 -1
  120. package/lib/types/adapters/node.d.ts +0 -6
  121. package/lib/types/adapters/node.d.ts.map +0 -1
  122. package/lib/types/adapters/static.d.ts +0 -7
  123. package/lib/types/adapters/static.d.ts.map +0 -1
  124. package/lib/types/adapters/vercel.d.ts +0 -21
  125. package/lib/types/adapters/vercel.d.ts.map +0 -1
  126. package/lib/types/app.d.ts +0 -24
  127. package/lib/types/app.d.ts.map +0 -1
  128. package/lib/types/entry-server.d.ts +0 -37
  129. package/lib/types/entry-server.d.ts.map +0 -1
  130. package/lib/types/error-overlay.d.ts +0 -6
  131. package/lib/types/error-overlay.d.ts.map +0 -1
  132. package/lib/types/fs-router.d.ts +0 -47
  133. package/lib/types/fs-router.d.ts.map +0 -1
  134. package/lib/types/isr.d.ts +0 -9
  135. package/lib/types/isr.d.ts.map +0 -1
  136. package/lib/types/not-found.d.ts +0 -7
  137. package/lib/types/not-found.d.ts.map +0 -1
  138. package/lib/types/types.d.ts +0 -111
  139. package/lib/types/types.d.ts.map +0 -1
  140. package/lib/types/utils/use-intersection-observer.d.ts +0 -10
  141. package/lib/types/utils/use-intersection-observer.d.ts.map +0 -1
  142. package/lib/types/utils/with-headers.d.ts +0 -6
  143. package/lib/types/utils/with-headers.d.ts.map +0 -1
  144. package/lib/types/vite-plugin.d.ts +0 -17
  145. package/lib/types/vite-plugin.d.ts.map +0 -1
@@ -1,51 +1,55 @@
1
- import type { Plugin } from 'vite';
2
- export interface I18nRoutingConfig {
3
- /** Supported locales. e.g. ["en", "de", "cs"] */
4
- locales: string[];
5
- /** Default locale — served without prefix (/ instead of /en/). */
6
- defaultLocale: string;
7
- /** Redirect root to detected locale. Default: true */
8
- detectLocale?: boolean;
9
- /** Cookie name to persist locale preference. Default: "locale" */
10
- cookieName?: string;
11
- /** URL strategy. Default: "prefix-except-default" */
12
- strategy?: 'prefix' | 'prefix-except-default';
1
+ import * as _pyreon_core0 from "@pyreon/core";
2
+ import * as _pyreon_reactivity0 from "@pyreon/reactivity";
3
+ import { Plugin } from "vite";
4
+
5
+ //#region src/i18n-routing.d.ts
6
+ interface I18nRoutingConfig {
7
+ /** Supported locales. e.g. ["en", "de", "cs"] */
8
+ locales: string[];
9
+ /** Default locale served without prefix (/ instead of /en/). */
10
+ defaultLocale: string;
11
+ /** Redirect root to detected locale. Default: true */
12
+ detectLocale?: boolean;
13
+ /** Cookie name to persist locale preference. Default: "locale" */
14
+ cookieName?: string;
15
+ /** URL strategy. Default: "prefix-except-default" */
16
+ strategy?: 'prefix' | 'prefix-except-default';
13
17
  }
14
- export interface LocaleContext {
15
- /** Current locale code. e.g. "en", "de" */
18
+ interface LocaleContext {
19
+ /** Current locale code. e.g. "en", "de" */
20
+ locale: string;
21
+ /** All supported locales. */
22
+ locales: string[];
23
+ /** Default locale. */
24
+ defaultLocale: string;
25
+ /** Build a localized path. e.g. localePath("/about", "de") → "/de/about" */
26
+ localePath: (path: string, locale?: string) => string;
27
+ /** Get hreflang alternates for the current path. */
28
+ alternates: () => Array<{
16
29
  locale: string;
17
- /** All supported locales. */
18
- locales: string[];
19
- /** Default locale. */
20
- defaultLocale: string;
21
- /** Build a localized path. e.g. localePath("/about", "de") → "/de/about" */
22
- localePath: (path: string, locale?: string) => string;
23
- /** Get hreflang alternates for the current path. */
24
- alternates: () => Array<{
25
- locale: string;
26
- url: string;
27
- }>;
30
+ url: string;
31
+ }>;
28
32
  }
29
33
  /**
30
34
  * Detect preferred locale from Accept-Language header.
31
35
  */
32
- export declare function detectLocaleFromHeader(acceptLanguage: string | null | undefined, locales: string[], defaultLocale: string): string;
36
+ declare function detectLocaleFromHeader(acceptLanguage: string | null | undefined, locales: string[], defaultLocale: string): string;
33
37
  /**
34
38
  * Extract locale from a URL path.
35
39
  * Returns { locale, pathWithoutLocale }.
36
40
  */
37
- export declare function extractLocaleFromPath(path: string, locales: string[], defaultLocale: string): {
38
- locale: string;
39
- pathWithoutLocale: string;
41
+ declare function extractLocaleFromPath(path: string, locales: string[], defaultLocale: string): {
42
+ locale: string;
43
+ pathWithoutLocale: string;
40
44
  };
41
45
  /**
42
46
  * Build a localized path.
43
47
  */
44
- export declare function buildLocalePath(path: string, locale: string, defaultLocale: string, strategy: 'prefix' | 'prefix-except-default'): string;
48
+ declare function buildLocalePath(path: string, locale: string, defaultLocale: string, strategy: 'prefix' | 'prefix-except-default'): string;
45
49
  /**
46
50
  * Create a LocaleContext for use in components and loaders.
47
51
  */
48
- export declare function createLocaleContext(locale: string, path: string, config: I18nRoutingConfig): LocaleContext;
52
+ declare function createLocaleContext(locale: string, path: string, config: I18nRoutingConfig): LocaleContext;
49
53
  /**
50
54
  * I18n routing middleware for Zero's server.
51
55
  *
@@ -68,11 +72,11 @@ export declare function createLocaleContext(locale: string, path: string, config
68
72
  * })
69
73
  * ```
70
74
  */
71
- export declare function i18nRouting(config: I18nRoutingConfig): Plugin;
75
+ declare function i18nRouting(config: I18nRoutingConfig): Plugin;
72
76
  /** @internal Context for the current locale. */
73
- export declare const LocaleCtx: import("@pyreon/core").Context<string>;
77
+ declare const LocaleCtx: _pyreon_core0.Context<string>;
74
78
  /** Current locale signal — set by the server middleware or client-side detection. */
75
- export declare const localeSignal: import("@pyreon/reactivity").Signal<string>;
79
+ declare const localeSignal: _pyreon_reactivity0.Signal<string>;
76
80
  /**
77
81
  * Read the current locale reactively.
78
82
  *
@@ -85,7 +89,7 @@ export declare const localeSignal: import("@pyreon/reactivity").Signal<string>;
85
89
  * const locale = useLocale() // "en", "de", etc.
86
90
  * ```
87
91
  */
88
- export declare function useLocale(): string;
92
+ declare function useLocale(): string;
89
93
  /**
90
94
  * Set the locale client-side and update the URL.
91
95
  *
@@ -94,5 +98,7 @@ export declare function useLocale(): string;
94
98
  * <button onClick={() => setLocale('de')}>Deutsch</button>
95
99
  * ```
96
100
  */
97
- export declare function setLocale(locale: string, config: I18nRoutingConfig): void;
98
- //# sourceMappingURL=i18n-routing.d.ts.map
101
+ declare function setLocale(locale: string, config: I18nRoutingConfig): void;
102
+ //#endregion
103
+ export { I18nRoutingConfig, LocaleContext, LocaleCtx, buildLocalePath, createLocaleContext, detectLocaleFromHeader, extractLocaleFromPath, i18nRouting, localeSignal, setLocale, useLocale };
104
+ //# sourceMappingURL=i18n-routing2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-routing.d.ts","sourceRoot":"","sources":["../../src/i18n-routing.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAelC,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,OAAO,EAAE,MAAM,EAAE,CA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A,EAA2B,mBAAA,CAAf,MAAA;;;;;;;;AAHzB;;;;;iBAiBgB,SAAA,CAAA;;;;;AAAhB;;;;iBAYgB,SAAA,CACd,MAAA,UACA,MAAA,EAAQ,iBAAA"}
@@ -1,45 +1,47 @@
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;
1
+ import { Plugin } from "vite";
2
+
3
+ //#region src/image-plugin.d.ts
4
+ interface ImagePluginConfig {
5
+ /** Output directory for processed images. Default: "assets/img" */
6
+ outDir?: string;
7
+ /** Default widths for responsive images. Default: [640, 1024, 1920] */
8
+ widths?: number[];
9
+ /** Output formats. Default: ["webp"] */
10
+ formats?: ImageFormat[];
11
+ /** Quality for lossy formats (1-100). Default: 80 */
12
+ quality?: number;
13
+ /** Blur placeholder size in px. Default: 16 */
14
+ placeholderSize?: number;
15
+ /** File patterns to process. Default: /\.(jpe?g|png|webp|avif)$/i */
16
+ include?: RegExp;
15
17
  }
16
- export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png';
18
+ type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png';
17
19
  /** 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;
20
+ interface FormatSource {
21
+ /** MIME type. e.g. "image/webp", "image/avif" */
22
+ type: string;
23
+ /** srcset string for this format. e.g. "/img-640.webp 640w, /img-1920.webp 1920w" */
24
+ srcset: string;
23
25
  }
24
- export interface ProcessedImage {
25
- /** Fallback source path (last format, largest width). */
26
+ interface ProcessedImage {
27
+ /** Fallback source path (last format, largest width). */
28
+ src: string;
29
+ /** Fallback srcset string (last format). */
30
+ srcset: string;
31
+ /** Intrinsic width. */
32
+ width: number;
33
+ /** Intrinsic height. */
34
+ height: number;
35
+ /** Base64 blur placeholder data URI. */
36
+ placeholder: string;
37
+ /** Per-format source sets for <picture> element. Ordered by priority (best format first). */
38
+ formats: FormatSource[];
39
+ /** Flat list of all sources. */
40
+ sources: Array<{
26
41
  src: string;
27
- /** Fallback srcset string (last format). */
28
- srcset: string;
29
- /** Intrinsic width. */
30
42
  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
+ format: string;
44
+ }>;
43
45
  }
44
46
  /**
45
47
  * Zero image processing Vite plugin.
@@ -65,15 +67,17 @@ export interface ProcessedImage {
65
67
  *
66
68
  * <Image {...hero} alt="Hero" priority />
67
69
  */
68
- export declare function imagePlugin(config?: ImagePluginConfig): Plugin;
70
+ declare function imagePlugin(config?: ImagePluginConfig): Plugin;
69
71
  /** @internal Exported for testing */
70
- export declare function parseJpegDimensions(buffer: Buffer): {
71
- width: number;
72
- height: number;
72
+ declare function parseJpegDimensions(buffer: Buffer): {
73
+ width: number;
74
+ height: number;
73
75
  };
74
76
  /** @internal Exported for testing */
75
- export declare function parseWebPDimensions(buffer: Buffer): {
76
- width: number;
77
- height: number;
77
+ declare function parseWebPDimensions(buffer: Buffer): {
78
+ width: number;
79
+ height: number;
78
80
  };
79
- //# sourceMappingURL=image-plugin.d.ts.map
81
+ //#endregion
82
+ export { FormatSource, ImageFormat, ImagePluginConfig, ProcessedImage, imagePlugin, parseJpegDimensions, parseWebPDimensions };
83
+ //# sourceMappingURL=image-plugin2.d.ts.map
@@ -1 +1 @@
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,CAwDlE;AAmKD,qCAAqC;AACrC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAeA;AAED,qCAAqC;AACrC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAuBA"}
1
+ {"version":3,"file":"image-plugin2.d.ts","names":[],"sources":["../../../src/image-plugin.ts"],"mappings":";;;UA+BiB,iBAAA;;EAEf,MAAA;EAFgC;EAIhC,MAAA;EAQgB;EANhB,OAAA,GAAU,WAAA;EAFV;EAIA,OAAA;EAFU;EAIV,eAAA;EAAA;EAEA,OAAA,GAAU,MAAA;AAAA;AAAA,KAGA,WAAA;;UAGK,YAAA;EAHM;EAKrB,IAAA;EALqB;EAOrB,MAAA;AAAA;AAAA,UAGe,cAAA;;EAEf,GAAA;EALM;EAON,MAAA;EAJ6B;EAM7B,KAAA;EAQc;EANd,MAAA;EAJA;EAMA,WAAA;EAFA;EAIA,OAAA,EAAS,YAAA;EAAT;EAEA,OAAA,EAAS,KAAA;IAAQ,GAAA;IAAa,KAAA;IAAe,MAAA;EAAA;AAAA;;;AA6B/C;;;;;;;;;AA4NA;;;;;;;;;;AAqBA;;;iBAjPgB,WAAA,CAAY,MAAA,GAAQ,iBAAA,GAAyB,MAAA;;iBA4N7C,mBAAA,CAAoB,MAAA,EAAQ,MAAA;EAC1C,KAAA;EACA,MAAA;AAAA;;iBAmBc,mBAAA,CAAoB,MAAA,EAAQ,MAAA;EAC1C,KAAA;EACA,MAAA;AAAA"}
@@ -1,38 +1,47 @@
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';
1
+ import { VNodeChild } from "@pyreon/core";
2
+ //#region src/image-plugin.d.ts
3
+ /** Per-format source set for <picture> <source> elements. */
4
+ interface FormatSource {
5
+ /** MIME type. e.g. "image/webp", "image/avif" */
6
+ type: string;
7
+ /** srcset string for this format. e.g. "/img-640.webp 640w, /img-1920.webp 1920w" */
8
+ srcset: string;
32
9
  }
33
- export interface ImageSource {
34
- src: string;
35
- width: number;
10
+ //#endregion
11
+ //#region src/image.d.ts
12
+ interface ImageProps {
13
+ /** Image source URL. */
14
+ src: string;
15
+ /** Alt text (required for accessibility). */
16
+ alt: string;
17
+ /** Intrinsic width of the image. */
18
+ width: number;
19
+ /** Intrinsic height of the image. */
20
+ height: number;
21
+ /** Responsive sizes attribute. Default: "100vw" */
22
+ sizes?: string;
23
+ /** Responsive srcset string or source array. */
24
+ srcset?: string | ImageSource[];
25
+ /** Per-format source sets for <picture>. Provided automatically by imagePlugin. */
26
+ formats?: FormatSource[];
27
+ /** Loading strategy. "lazy" uses IntersectionObserver, "eager" loads immediately. Default: "lazy" */
28
+ loading?: 'lazy' | 'eager';
29
+ /** Mark as priority (LCP image). Disables lazy loading, adds fetchPriority="high". */
30
+ priority?: boolean;
31
+ /** Low-quality placeholder image URL or base64 data URI for blur-up effect. */
32
+ placeholder?: string;
33
+ /** CSS class name. */
34
+ class?: string;
35
+ /** Inline styles. */
36
+ style?: string;
37
+ /** CSS object-fit. Default: "cover" */
38
+ fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
39
+ /** Decode async. Default: true */
40
+ decoding?: 'sync' | 'async' | 'auto';
41
+ }
42
+ interface ImageSource {
43
+ src: string;
44
+ width: number;
36
45
  }
37
46
  /**
38
47
  * Optimized image component with lazy loading, responsive images,
@@ -47,5 +56,7 @@ export interface ImageSource {
47
56
  * // Manual usage
48
57
  * <Image src="/hero.jpg" alt="Hero" width={1200} height={630} />
49
58
  */
50
- export declare function Image(props: ImageProps): VNodeChild;
51
- //# sourceMappingURL=image.d.ts.map
59
+ declare function Image(props: ImageProps): VNodeChild;
60
+ //#endregion
61
+ export { Image, ImageProps, ImageSource };
62
+ //# sourceMappingURL=image2.d.ts.map
@@ -1 +1 @@
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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