@stacksjs/stx 0.2.4 → 0.2.6
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/a11y.d.ts +2 -6
- package/dist/analytics.d.ts +1 -1
- package/dist/analyzer.d.ts +1 -1
- package/dist/animation.d.ts +10 -86
- package/dist/app.d.ts +2 -4
- package/dist/assets.d.ts +1 -1
- package/dist/ast.d.ts +3 -24
- package/dist/async-components.d.ts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/browser-composables.d.ts +6 -4
- package/dist/build-optimizer.d.ts +4 -29
- package/dist/build-views.d.ts +20 -1
- package/dist/bundle-analyzer/collector.d.ts +1 -1
- package/dist/bundle-analyzer/index.d.ts +40 -4
- package/dist/bundle-analyzer/report.d.ts +1 -1
- package/dist/bundle-analyzer/treemap.d.ts +1 -1
- package/dist/caching.d.ts +1 -1
- package/dist/cli.js +1323 -511
- package/dist/client/directive.d.ts +1 -1
- package/dist/client/index.d.ts +6 -1
- package/dist/client/router.d.ts +3 -11
- package/dist/client/stx-router.browser.d.ts +1 -0
- package/dist/client-script.d.ts +2 -1
- package/dist/client.d.ts +2 -2
- package/dist/component-hmr.d.ts +4 -18
- package/dist/components.d.ts +1 -1
- package/dist/composables/index.d.ts +114 -1
- package/dist/composables/use-battery.d.ts +1 -1
- package/dist/composables/use-broadcast-channel.d.ts +2 -2
- package/dist/composables/use-clipboard.d.ts +1 -1
- package/dist/composables/use-color-mode.d.ts +52 -0
- package/dist/composables/use-cookie.d.ts +1 -1
- package/dist/composables/use-device-orientation.d.ts +1 -1
- package/dist/composables/use-event-listener.d.ts +35 -0
- package/dist/composables/use-event-source.d.ts +1 -1
- package/dist/composables/use-eye-dropper.d.ts +3 -2
- package/dist/composables/use-fetch.d.ts +1 -1
- package/dist/composables/use-fullscreen.d.ts +1 -1
- package/dist/composables/use-geolocation.d.ts +1 -1
- package/dist/composables/use-idle.d.ts +2 -2
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables/use-keyboard.d.ts +1 -2
- package/dist/composables/use-media-query.d.ts +1 -1
- package/dist/composables/use-meta.d.ts +35 -0
- package/dist/composables/use-mouse.d.ts +1 -1
- package/dist/composables/use-mutation-observer.d.ts +1 -1
- package/dist/composables/use-network.d.ts +1 -1
- package/dist/composables/use-notification.d.ts +10 -1
- package/dist/composables/use-permissions.d.ts +17 -7
- package/dist/composables/use-query.d.ts +43 -0
- package/dist/composables/use-resize-observer.d.ts +1 -1
- package/dist/composables/use-router.d.ts +59 -0
- package/dist/composables/use-share.d.ts +1 -1
- package/dist/composables/use-speech.d.ts +1 -1
- package/dist/composables/use-storage.d.ts +1 -1
- package/dist/composables/use-text-selection.d.ts +1 -1
- package/dist/composables/use-timer.d.ts +92 -0
- package/dist/composables/use-utilities.d.ts +103 -0
- package/dist/composables/use-wake-lock.d.ts +1 -1
- package/dist/composables/use-websocket.d.ts +3 -3
- package/dist/composables/use-window.d.ts +1 -1
- package/dist/composables.d.ts +10 -7
- package/dist/composition-api.d.ts +1 -14
- package/dist/computed.d.ts +10 -4
- package/dist/conditionals.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/craft-bridge.d.ts +1 -1
- package/dist/craft-compiler.d.ts +6 -3
- package/dist/craft-components.d.ts +1 -8
- package/dist/craft-entry.d.ts +1 -1
- package/dist/craft-ssr.d.ts +1 -1
- package/dist/csp.d.ts +2 -2
- package/dist/csrf.d.ts +1 -1
- package/dist/custom-directives.d.ts +1 -1
- package/dist/database.d.ts +8 -26
- package/dist/defer.d.ts +1 -1
- package/dist/deploy/config-generators.d.ts +1 -1
- package/dist/deploy/index.d.ts +6 -3
- package/dist/deploy/netlify.d.ts +1 -1
- package/dist/dev-server/crosswind.d.ts +11 -1
- package/dist/dev-server/index.d.ts +16 -1
- package/dist/dev-server/keyboard-shortcuts.d.ts +1 -1
- package/dist/dev-server/native-window.d.ts +1 -1
- package/dist/dev-server/port-utils.d.ts +2 -2
- package/dist/dev-server/terminal-colors.d.ts +1 -5
- package/dist/dev-server/theme-selector.d.ts +1 -1
- package/dist/dev-server/types.d.ts +3 -8
- package/dist/dev-server.d.ts +1 -4
- package/dist/devtools.d.ts +4 -1
- package/dist/directive-api.d.ts +3 -3
- package/dist/docs.d.ts +2 -2
- package/dist/dynamic-components.d.ts +1 -1
- package/dist/edge-runtime.d.ts +3 -3
- package/dist/env.d.ts +1 -1
- package/dist/error-boundaries.d.ts +1 -1
- package/dist/error-handling.d.ts +14 -1
- package/dist/errors/codes.d.ts +2 -17
- package/dist/errors/formatter.d.ts +1 -1
- package/dist/errors/index.d.ts +13 -1
- package/dist/errors/logger.d.ts +2 -15
- package/dist/errors/sanitizer.d.ts +1 -1
- package/dist/errors/types.d.ts +1 -1
- package/dist/events.d.ts +1 -1
- package/dist/expressions.d.ts +64 -90
- package/dist/formatter.d.ts +1 -1
- package/dist/forms-validation.d.ts +23 -24
- package/dist/forms.d.ts +5 -22
- package/dist/head.d.ts +5 -1
- package/dist/heatmap.d.ts +4 -7
- package/dist/hot-reload.d.ts +3 -8
- package/dist/hydration-runtime.d.ts +1 -1
- package/dist/hydration.d.ts +5 -32
- package/dist/i18n.d.ts +1 -9
- package/dist/image-optimization/build-plugin.d.ts +2 -2
- package/dist/image-optimization/component.d.ts +2 -2
- package/dist/image-optimization/directive.d.ts +2 -2
- package/dist/image-optimization/index.d.ts +55 -1
- package/dist/image-optimization/processor.d.ts +9 -4
- package/dist/includes.d.ts +1 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +1387 -542
- package/dist/init.d.ts +1 -1
- package/dist/interactive.d.ts +1 -1
- package/dist/internal-markdown.d.ts +1 -1
- package/dist/js-ts.d.ts +1 -1
- package/dist/jsx-runtime.d.ts +1 -20
- package/dist/keep-alive.d.ts +1 -1
- package/dist/lazy-loader.d.ts +3 -35
- package/dist/loading-indicator.d.ts +2 -1
- package/dist/loops.d.ts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/media/client/blur-up.d.ts +1 -1
- package/dist/media/client/index.d.ts +17 -1
- package/dist/media/client/lazy-load.d.ts +1 -1
- package/dist/media/client/upload-handler.d.ts +1 -1
- package/dist/media/image/component.d.ts +2 -4
- package/dist/media/image/directive.d.ts +1 -1
- package/dist/media/image/editing.d.ts +1 -1
- package/dist/media/image/index.d.ts +25 -1
- package/dist/media/image/placeholder.d.ts +1 -1
- package/dist/media/image/processor/cache.d.ts +3 -4
- package/dist/media/image/processor/index.d.ts +9 -1
- package/dist/media/image/processor/optimizer.d.ts +2 -2
- package/dist/media/image/processor/responsive.d.ts +3 -2
- package/dist/media/image/srcset.d.ts +6 -4
- package/dist/media/index.d.ts +37 -1
- package/dist/media/manager/embed.d.ts +1 -1
- package/dist/media/protected/component.d.ts +2 -3
- package/dist/media/protected/index.d.ts +14 -1
- package/dist/media/protected/signature.d.ts +2 -2
- package/dist/media/shared/cache.d.ts +1 -1
- package/dist/media/shared/hash.d.ts +1 -1
- package/dist/media/shared/index.d.ts +6 -1
- package/dist/media/types.d.ts +16 -72
- package/dist/media/upload/component.d.ts +2 -16
- package/dist/media/upload/index.d.ts +8 -1
- package/dist/media/video/directive.d.ts +1 -1
- package/dist/media/video/index.d.ts +11 -2
- package/dist/media/video/processor/cache.d.ts +3 -4
- package/dist/media/video/processor/index.d.ts +9 -1
- package/dist/media/video/processor/streaming.d.ts +2 -2
- package/dist/media/video/processor/thumbnail.d.ts +2 -2
- package/dist/media/video/processor/transcoder.d.ts +2 -2
- package/dist/method-spoofing.d.ts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/native-build.d.ts +3 -6
- package/dist/parser/directive-parser.d.ts +1 -1
- package/dist/parser/expression-parser.d.ts +2 -1
- package/dist/parser/index.d.ts +14 -1
- package/dist/parser/tokenizer.d.ts +2 -18
- package/dist/partial-hydration.d.ts +5 -6
- package/dist/performance-utils.d.ts +5 -18
- package/dist/plugin-system.d.ts +2 -8
- package/dist/plugin.d.ts +1 -1
- package/dist/precompiler.d.ts +2 -67
- package/dist/process.d.ts +12 -2
- package/dist/production-build.d.ts +1 -37
- package/dist/props.d.ts +3 -30
- package/dist/pwa/audit.d.ts +1 -1
- package/dist/pwa/directives.d.ts +1 -1
- package/dist/pwa/icons.d.ts +7 -4
- package/dist/pwa/index.d.ts +46 -1
- package/dist/pwa/inject.d.ts +1 -1
- package/dist/pwa/manifest.d.ts +1 -1
- package/dist/pwa/offline.d.ts +1 -1
- package/dist/pwa/precache.d.ts +1 -1
- package/dist/pwa/service-worker.d.ts +1 -1
- package/dist/pwa/workbox-strategies.d.ts +1 -1
- package/dist/pwa/workbox.d.ts +1 -10
- package/dist/pwa.d.ts +1 -1
- package/dist/pwa.js +1242 -430
- package/dist/reactive-bindings.d.ts +1 -1
- package/dist/reactive.d.ts +1 -1
- package/dist/reactivity.d.ts +6 -50
- package/dist/release.d.ts +1 -1
- package/dist/route-middleware.d.ts +3 -3
- package/dist/router.d.ts +1 -1
- package/dist/routes.d.ts +2 -2
- package/dist/runtime.d.ts +4 -4
- package/dist/safe-evaluator.d.ts +1 -4
- package/dist/scaffolding.d.ts +1 -1
- package/dist/seo.d.ts +1 -5
- package/dist/serve.d.ts +1 -1
- package/dist/server-components.d.ts +1 -1
- package/dist/signals.d.ts +8 -168
- package/dist/slots.d.ts +2 -2
- package/dist/source-maps.d.ts +3 -22
- package/dist/spa-shell.d.ts +20 -0
- package/dist/ssg.d.ts +4 -6
- package/dist/ssg.js +1242 -430
- package/dist/ssr.d.ts +6 -14
- package/dist/state-management.d.ts +5 -45
- package/dist/stores-client.d.ts +3 -3
- package/dist/story/addons.d.ts +1 -1
- package/dist/story/analytics.d.ts +4 -11
- package/dist/story/auto-stories.d.ts +1 -1
- package/dist/story/bookmarks.d.ts +2 -6
- package/dist/story/bun-test.d.ts +1 -1
- package/dist/story/cli.d.ts +0 -25
- package/dist/story/collect/analyzer.d.ts +1 -1
- package/dist/story/collect/index.d.ts +5 -1
- package/dist/story/collect/parser.d.ts +1 -1
- package/dist/story/collect/scanner.d.ts +1 -1
- package/dist/story/collect/tree.d.ts +2 -2
- package/dist/story/commands/build.d.ts +1 -1
- package/dist/story/commands/dev.d.ts +1 -1
- package/dist/story/commands/index.d.ts +4 -1
- package/dist/story/commands/preview.d.ts +1 -1
- package/dist/story/compiled-output.d.ts +1 -1
- package/dist/story/composition.d.ts +1 -1
- package/dist/story/config-watcher.d.ts +1 -1
- package/dist/story/config.d.ts +2 -2
- package/dist/story/context.d.ts +1 -1
- package/dist/story/controls/index.d.ts +1 -1
- package/dist/story/crosswind.d.ts +1 -1
- package/dist/story/desktop-preview.d.ts +1 -1
- package/dist/story/docs-generator.d.ts +1 -1
- package/dist/story/errors.d.ts +1 -1
- package/dist/story/figma-export.d.ts +2 -2
- package/dist/story/generator.d.ts +1 -1
- package/dist/story/hmr.d.ts +1 -1
- package/dist/story/hot-swap.d.ts +1 -1
- package/dist/story/index.d.ts +49 -1
- package/dist/story/interactions.d.ts +1 -1
- package/dist/story/keyboard-shortcuts.d.ts +1 -1
- package/dist/story/output.d.ts +1 -1
- package/dist/story/performance.d.ts +3 -12
- package/dist/story/presets.d.ts +3 -8
- package/dist/story/props-validation.d.ts +11 -1
- package/dist/story/renderer.d.ts +1 -1
- package/dist/story/search-index.d.ts +2 -2
- package/dist/story/search.d.ts +2 -2
- package/dist/story/server.d.ts +1 -1
- package/dist/story/setup.d.ts +1 -1
- package/dist/story/snapshots.d.ts +1 -1
- package/dist/story/testing.d.ts +1 -1
- package/dist/story/theme.d.ts +1 -1
- package/dist/story/types.d.ts +3 -12
- package/dist/story/ui/code-panel.d.ts +1 -1
- package/dist/story/ui/controls-panel.d.ts +1 -1
- package/dist/story/ui/index.d.ts +5 -1
- package/dist/story/ui/navigation.d.ts +1 -1
- package/dist/story/ui/preview.d.ts +1 -1
- package/dist/story/visual-testing.d.ts +1 -1
- package/dist/streaming.d.ts +0 -59
- package/dist/suspense.d.ts +1 -1
- package/dist/teleport.d.ts +1 -1
- package/dist/testing.d.ts +62 -80
- package/dist/transitions.d.ts +1 -1
- package/dist/type-checker.d.ts +2 -26
- package/dist/types/component-types.d.ts +3 -3
- package/dist/types/config-types.d.ts +15 -30
- package/dist/types/context-types.d.ts +6 -5
- package/dist/types/csp-types.d.ts +2 -2
- package/dist/types/directive-types.d.ts +5 -5
- package/dist/types/index.d.ts +21 -1
- package/dist/types/pwa-types.d.ts +1 -6
- package/dist/types.d.ts +28 -1
- package/dist/typescript-templates.d.ts +1 -34
- package/dist/utils.d.ts +2 -1
- package/dist/validator.d.ts +1 -1
- package/dist/variable-extractor.d.ts +1 -1
- package/dist/view-composers.d.ts +1 -1
- package/dist/virtual-scrolling.d.ts +4 -1
- package/dist/visual-editor.d.ts +2 -30
- package/dist/visual-testing.d.ts +4 -1
- package/dist/vue-template.d.ts +1 -1
- package/dist/web-components/css-scoping.d.ts +1 -1
- package/dist/web-components/index.d.ts +10 -1
- package/dist/web-components/reactive-generator.d.ts +1 -1
- package/dist/web-components.d.ts +1 -1
- package/dist/x-element.d.ts +13 -6
- package/package.json +4 -4
package/dist/expressions.d.ts
CHANGED
|
@@ -1,54 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Register a custom filter
|
|
3
|
-
*
|
|
4
|
-
* @param name - Filter name (used in templates as {{ value | filterName }})
|
|
5
|
-
* @param fn - Filter function
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* // Register a custom filter
|
|
10
|
-
* registerFilter('reverse', (value) => {
|
|
11
|
-
* return String(value).split('').reverse().join('')
|
|
12
|
-
* })
|
|
13
|
-
*
|
|
14
|
-
* // Use in template: {{ name | reverse }}
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare function registerFilter(name: string, fn: FilterFunction): void;
|
|
18
|
-
/**
|
|
19
|
-
* Register multiple custom filters at once
|
|
20
|
-
*
|
|
21
|
-
* @param filters - Object mapping filter names to functions
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* registerFilters({
|
|
26
|
-
* reverse: (value) => String(value).split('').reverse().join(''),
|
|
27
|
-
* double: (value) => Number(value) * 2,
|
|
28
|
-
* })
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function registerFilters(filters: Record<string, FilterFunction>): void;
|
|
32
|
-
/**
|
|
33
|
-
* Get all available filters (built-in + custom)
|
|
34
|
-
*/
|
|
35
|
-
export declare function getAllFilters(): Record<string, FilterFunction>;
|
|
36
|
-
/**
|
|
37
|
-
* Clear all custom filters (useful for testing)
|
|
38
|
-
*/
|
|
39
|
-
export declare function clearCustomFilters(): void;
|
|
40
|
-
/**
|
|
41
|
-
* HTML escape function to prevent XSS
|
|
42
|
-
*/
|
|
43
|
-
export declare function escapeHtml(unsafe: string): string;
|
|
44
|
-
/**
|
|
45
|
-
* Process template expressions including variables, filters, and operations
|
|
46
|
-
*/
|
|
47
|
-
export declare function processExpressions(template: string, context: Record<string, any>, filePath: string): string;
|
|
48
|
-
/**
|
|
49
|
-
* Apply filters to a value
|
|
50
|
-
*/
|
|
51
|
-
export declare function applyFilters(value: any, filterExpression: string, context: Record<string, any>): any;
|
|
52
1
|
/**
|
|
53
2
|
* Evaluate an expression within the given context
|
|
54
3
|
* @param {string} expression - The expression to evaluate
|
|
@@ -65,59 +14,84 @@ export declare function unescapeHtml(html: string): string;
|
|
|
65
14
|
// Built-in Filters
|
|
66
15
|
// =============================================================================
|
|
67
16
|
export declare const defaultFilters: {
|
|
68
|
-
// String transformation filters
|
|
69
17
|
uppercase: (value: any, _context: Record<string, any>) => unknown;
|
|
70
18
|
lowercase: (value: any, _context: Record<string, any>) => unknown;
|
|
71
19
|
capitalize: (value: any, _context: Record<string, any>) => unknown;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
join: () => unknown;
|
|
76
|
-
// Safety filters
|
|
20
|
+
number: (value: any, _context: Record<string, any>, decimals?: number) => unknown;
|
|
21
|
+
fmt: (value: any, _context: Record<string, any>, locale?: string) => unknown;
|
|
22
|
+
join: (value: any, _context: Record<string, any>, separator?: string) => unknown;
|
|
77
23
|
escape: (value: any, _context: Record<string, any>) => unknown;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// Additional Utility Filters
|
|
84
|
-
// =========================================================================
|
|
85
|
-
|
|
86
|
-
// Truncate string to specified length with ellipsis
|
|
87
|
-
truncate: (value: any, _context: Record<string, any>, length: number?, suffix: string?) => unknown;
|
|
88
|
-
// Format date using Intl.DateTimeFormat
|
|
89
|
-
date: (value: any, _context: Record<string, any>, format: string?, locale: string?) => unknown;
|
|
90
|
-
// Format number as currency
|
|
91
|
-
currency: (value: any, _context: Record<string, any>, currencyCode: string?, locale: string?) => unknown;
|
|
92
|
-
// Pluralize word based on count
|
|
24
|
+
translate: (value: any, context: Record<string, any>, params?: Record<string, any>) => unknown;
|
|
25
|
+
t: (value: any, context: Record<string, any>, params?: Record<string, any>) => unknown;
|
|
26
|
+
truncate: (value: any, _context: Record<string, any>, length?: number, suffix?: string) => unknown;
|
|
27
|
+
date: (value: any, _context: Record<string, any>, format?: string, locale?: string) => unknown;
|
|
28
|
+
currency: (value: any, _context: Record<string, any>, currencyCode?: string, locale?: string) => unknown;
|
|
93
29
|
pluralize: (value: any, _context: Record<string, any>, singular: string, plural?: string) => unknown;
|
|
94
|
-
// Get first item from array or first character from string
|
|
95
30
|
first: (value: any, _context: Record<string, any>) => unknown;
|
|
96
|
-
// Get last item from array or last character from string
|
|
97
31
|
last: (value: any, _context: Record<string, any>) => unknown;
|
|
98
|
-
// Get length of array or string
|
|
99
32
|
length: (value: any, _context: Record<string, any>) => unknown;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// Default value if null/undefined
|
|
103
|
-
default: (value: any, _context: Record<string, any>, defaultValue: any?) => unknown;
|
|
104
|
-
// Reverse string or array
|
|
33
|
+
json: (value: any, _context: Record<string, any>, pretty?: boolean) => unknown;
|
|
34
|
+
default: (value: any, _context: Record<string, any>, defaultValue?: any) => unknown;
|
|
105
35
|
reverse: (value: any, _context: Record<string, any>) => unknown;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
// Replace text
|
|
109
|
-
replace: (value: any, _context: Record<string, any>, search: string, replacement: string?) => unknown;
|
|
110
|
-
// Strip HTML tags
|
|
36
|
+
slice: (value: any, _context: Record<string, any>, start?: number, end?: number) => unknown;
|
|
37
|
+
replace: (value: any, _context: Record<string, any>, search: string, replacement?: string) => unknown;
|
|
111
38
|
stripTags: (value: any, _context: Record<string, any>) => unknown;
|
|
112
|
-
// URL encode
|
|
113
39
|
urlencode: (value: any, _context: Record<string, any>) => unknown;
|
|
114
|
-
// Absolute value
|
|
115
40
|
abs: (value: any, _context: Record<string, any>) => unknown;
|
|
116
|
-
|
|
117
|
-
|
|
41
|
+
round: (value: any, _context: Record<string, any>, decimals?: number) => unknown;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Register a custom filter
|
|
47
|
+
*
|
|
48
|
+
* @param name - Filter name (used in templates as {{ value | filterName }})
|
|
49
|
+
* @param fn - Filter function
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* // Register a custom filter
|
|
54
|
+
* registerFilter('reverse', (value) => {
|
|
55
|
+
* return String(value).split('').reverse().join('')
|
|
56
|
+
* })
|
|
57
|
+
*
|
|
58
|
+
* // Use in template: {{ name | reverse }}
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export function registerFilter(name: unknown;
|
|
62
|
+
fn: () => unknown;
|
|
63
|
+
FilterFunction>): void {
|
|
64
|
+
for: (const [name, fn] of Object.entries(filters)) => unknown;
|
|
65
|
+
'console']
|
|
66
|
+
|
|
67
|
+
let exprWithoutStrings = expr
|
|
68
|
+
.replace(/'[^']*'/g, '') // Remove single-quoted strings
|
|
69
|
+
.replace(/"[^"]*"/g, '') // Remove double-quoted strings
|
|
70
|
+
.replace(/`[^`]*`/g, '') // Remove template literals
|
|
71
|
+
|
|
72
|
+
// Find all identifiers (variable names at the start of property access chains)
|
|
73
|
+
const identifierRegex = /\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g
|
|
74
|
+
let identifierMatch: RegExpExecArray | null
|
|
75
|
+
|
|
76
|
+
while ((identifierMatch = identifierRegex.exec(exprWithoutStrings)) !== null) {
|
|
77
|
+
const identifier = identifierMatch[1]
|
|
78
|
+
// Check if this identifier is a property access (preceded by a dot)
|
|
79
|
+
const beforeIdentifier = exprWithoutStrings.substring(0, identifierMatch.index)
|
|
80
|
+
const isPropAccess = beforeIdentifier.trimEnd().endsWith('.')
|
|
81
|
+
|
|
82
|
+
// Only check top-level identifiers (not property accesses like .foo)
|
|
83
|
+
if (!isPropAccess) {
|
|
84
|
+
// If this identifier is not a JS built-in and not in context, it's a runtime variable
|
|
85
|
+
if (!jsBuiltins.includes: (identifier) => unknown;
|
|
86
|
+
'undefined']
|
|
87
|
+
|
|
88
|
+
const identifierPattern = /^([a-zA-Z_$][a-zA-Z0-9_$]*)/
|
|
89
|
+
const identifierMatch = trimmedExpr.match(identifierPattern)
|
|
90
|
+
const firstVarName = identifierMatch?.[1]
|
|
91
|
+
const firstVarInContext = firstVarName && (firstVarName in context || jsBuiltins.includes: (firstVarName) => unknown
|
|
118
92
|
};
|
|
119
93
|
/**
|
|
120
94
|
* Add basic filter support to expressions
|
|
121
95
|
* Filter functions receive the value to transform, optional args, and the context object
|
|
122
96
|
*/
|
|
123
|
-
export type FilterFunction = (value: any, context: Record<string, any>, ...args: any[]) => any
|
|
97
|
+
export type FilterFunction = (value: any, context: Record<string, any>, ...args: any[]) => any;
|
package/dist/formatter.d.ts
CHANGED
|
@@ -125,44 +125,40 @@ declare interface FormState<T extends Record<string, Validator>> {
|
|
|
125
125
|
// =============================================================================
|
|
126
126
|
// Types
|
|
127
127
|
// =============================================================================
|
|
128
|
-
declare type ValidatorFn = (value: unknown, formValues?: Record<string, unknown>) => true | string
|
|
129
|
-
declare type AsyncValidatorFn = (value: unknown, formValues?: Record<string, unknown>) => Promise<true | string
|
|
128
|
+
declare type ValidatorFn = (value: unknown, formValues?: Record<string, unknown>) => true | string;
|
|
129
|
+
declare type AsyncValidatorFn = (value: unknown, formValues?: Record<string, unknown>) => Promise<true | string>;
|
|
130
130
|
// =============================================================================
|
|
131
131
|
// Validator Class
|
|
132
132
|
// =============================================================================
|
|
133
133
|
declare class Validator {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
required(message?: any): Validator;
|
|
138
|
-
email(message?: any): Validator;
|
|
139
|
-
url(message?: any): Validator;
|
|
134
|
+
required(message?: string): Validator;
|
|
135
|
+
email(message?: string): Validator;
|
|
136
|
+
url(message?: string): Validator;
|
|
140
137
|
min(length: number, message?: string): Validator;
|
|
141
138
|
max(length: number, message?: string): Validator;
|
|
142
139
|
length(min: number, max: number, message?: string): Validator;
|
|
143
|
-
pattern(regex: RegExp, message?:
|
|
144
|
-
hasUppercase(message?:
|
|
145
|
-
hasLowercase(message?:
|
|
146
|
-
hasNumber(message?:
|
|
147
|
-
hasSpecial(message?:
|
|
148
|
-
alphanumeric(message?:
|
|
149
|
-
startsWithLetter(message?:
|
|
150
|
-
noSpaces(message?:
|
|
151
|
-
number(message?:
|
|
152
|
-
integer(message?:
|
|
153
|
-
positive(message?:
|
|
154
|
-
negative(message?:
|
|
140
|
+
pattern(regex: RegExp, message?: string): Validator;
|
|
141
|
+
hasUppercase(message?: string): Validator;
|
|
142
|
+
hasLowercase(message?: string): Validator;
|
|
143
|
+
hasNumber(message?: string): Validator;
|
|
144
|
+
hasSpecial(message?: string): Validator;
|
|
145
|
+
alphanumeric(message?: string): Validator;
|
|
146
|
+
startsWithLetter(message?: string): Validator;
|
|
147
|
+
noSpaces(message?: string): Validator;
|
|
148
|
+
number(message?: string): Validator;
|
|
149
|
+
integer(message?: string): Validator;
|
|
150
|
+
positive(message?: string): Validator;
|
|
151
|
+
negative(message?: string): Validator;
|
|
155
152
|
minValue(min: number, message?: string): Validator;
|
|
156
153
|
maxValue(max: number, message?: string): Validator;
|
|
157
154
|
between(min: number, max: number, message?: string): Validator;
|
|
158
155
|
matches(fieldName: string, message?: string): Validator;
|
|
159
156
|
oneOf(values: unknown[], message?: string): Validator;
|
|
160
157
|
notOneOf(values: unknown[], message?: string): Validator;
|
|
161
|
-
date(message?:
|
|
158
|
+
date(message?: string): Validator;
|
|
162
159
|
before(date: Date | string, message?: string): Validator;
|
|
163
160
|
after(date: Date | string, message?: string): Validator;
|
|
164
|
-
custom(fn: ValidatorFn, message?:
|
|
165
|
-
async(fn: AsyncValidatorFn, message?: any): Validator;
|
|
161
|
+
custom(fn: ValidatorFn, message?: string): Validator;
|
|
166
162
|
when(condition: (value: unknown, formValues: Record<string, unknown>) => boolean, thenValidator: Validator): Validator;
|
|
167
163
|
getRules(): ValidatorRule[];
|
|
168
164
|
getDefaultValue(): unknown;
|
|
@@ -170,4 +166,7 @@ declare class Validator {
|
|
|
170
166
|
validate(value: unknown, formValues?: Record<string, unknown>): Promise<string[]>;
|
|
171
167
|
validateSync(value: unknown, formValues?: Record<string, unknown>): string[];
|
|
172
168
|
}
|
|
173
|
-
|
|
169
|
+
// =============================================================================
|
|
170
|
+
// Re-exports
|
|
171
|
+
// =============================================================================
|
|
172
|
+
export { Validator };
|
package/dist/forms.d.ts
CHANGED
|
@@ -111,27 +111,10 @@ export declare const defaultFormClasses: FormClassConfig;
|
|
|
111
111
|
/**
|
|
112
112
|
* Enhanced validation rules registry with full validation support
|
|
113
113
|
*/
|
|
114
|
-
export declare const enhancedValidationRules: {
|
|
115
|
-
required: {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
numeric: { name: 'numeric'; validate: (value) => unknown; toHtml5: () => unknown };
|
|
119
|
-
integer: { name: 'integer'; validate: (value) => unknown; message: 'Please enter a whole number' };
|
|
120
|
-
alpha: { name: 'alpha'; validate: (value) => unknown; toHtml5: () => unknown };
|
|
121
|
-
alphanumeric: { name: 'alphanumeric'; validate: (value) => unknown; toHtml5: () => unknown };
|
|
122
|
-
min: { name: 'min'; validate: (value, params) => unknown };
|
|
123
|
-
max: { name: 'max'; validate: (value, params) => unknown };
|
|
124
|
-
between: { name: 'between'; validate: (value, params) => unknown; toHtml5: unknown };
|
|
125
|
-
confirmed: { name: 'confirmed'; validate: (value, _params, allValues) => unknown };
|
|
126
|
-
in: { name: 'in'; validate: (value, params) => unknown; message: 'Must be one of: {{values}}' };
|
|
127
|
-
notIn: { name: 'notIn'; validate: (value, params) => unknown; message: 'Must not be: {{values}}' };
|
|
128
|
-
regex: { name: 'regex'; validate: (value, params) => unknown };
|
|
129
|
-
date: { name: 'date'; validate: (value) => unknown };
|
|
130
|
-
before: { name: 'before'; validate: (value, params) => unknown };
|
|
131
|
-
after: { name: 'after'; validate: (value, params) => unknown };
|
|
132
|
-
size: { name: 'size'; validate: (value, params) => unknown };
|
|
133
|
-
phone: { name: 'phone'; validate: (value) => unknown }
|
|
134
|
-
};
|
|
114
|
+
export declare const enhancedValidationRules: ({
|
|
115
|
+
required: {
|
|
116
|
+
name: 'required',
|
|
117
|
+
validate: (value)) => unknown;
|
|
135
118
|
/**
|
|
136
119
|
* Default CSS class names for form elements.
|
|
137
120
|
* Based on Bootstrap conventions but fully customizable.
|
|
@@ -167,4 +150,4 @@ export declare interface EnhancedValidationRule {
|
|
|
167
150
|
validate: (value: unknown, params: string[], allValues: Record<string, unknown>) => true | string
|
|
168
151
|
toHtml5?: (params: string[]) => string[]
|
|
169
152
|
message: string
|
|
170
|
-
}
|
|
153
|
+
}
|
package/dist/head.d.ts
CHANGED
|
@@ -219,7 +219,11 @@ export declare interface PageMeta {
|
|
|
219
219
|
transition?: string | { name: string; mode?: string }
|
|
220
220
|
keepAlive?: boolean
|
|
221
221
|
key?: string | ((route: unknown) => string)
|
|
222
|
+
[key: string]: unknown
|
|
222
223
|
}
|
|
224
|
+
// =============================================================================
|
|
225
|
+
// Exports
|
|
226
|
+
// =============================================================================
|
|
223
227
|
export {
|
|
224
228
|
usePageTitle as useTitle
|
|
225
|
-
};
|
|
229
|
+
};
|
package/dist/heatmap.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StxOptions } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Generate heatmap tracking script based on configuration
|
|
4
4
|
*/
|
|
@@ -16,10 +16,6 @@ export declare function createHeatmapAggregator(): HeatmapAggregator;
|
|
|
16
16
|
* Default heatmap configuration
|
|
17
17
|
*/
|
|
18
18
|
export declare const defaultHeatmapConfig: HeatmapConfig;
|
|
19
|
-
/**
|
|
20
|
-
* Custom @heatmap directive for explicit placement
|
|
21
|
-
*/
|
|
22
|
-
export declare const heatmapDirective: CustomDirective;
|
|
23
19
|
/**
|
|
24
20
|
* Heatmap Module
|
|
25
21
|
*
|
|
@@ -112,7 +108,6 @@ export declare interface HeatmapSession {
|
|
|
112
108
|
* For processing collected heatmap data into visualizations
|
|
113
109
|
*/
|
|
114
110
|
export declare class HeatmapAggregator {
|
|
115
|
-
private sessions: Map<string, HeatmapSession>;
|
|
116
111
|
addSession(data: HeatmapSession): void;
|
|
117
112
|
getPageData(page: string): HeatmapDataPoint[];
|
|
118
113
|
getClickData(page: string): HeatmapDataPoint[];
|
|
@@ -122,4 +117,6 @@ export declare class HeatmapAggregator {
|
|
|
122
117
|
generateGridData(page: string, gridSize?: number): { x: number, y: number, intensity: number }[][];
|
|
123
118
|
exportJSON(): string;
|
|
124
119
|
clear(): void;
|
|
125
|
-
|
|
120
|
+
get sessionCount(): number;
|
|
121
|
+
get totalPoints(): number;
|
|
122
|
+
}
|
package/dist/hot-reload.d.ts
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
* Generate the hot reload client script to inject into HTML
|
|
3
3
|
*/
|
|
4
4
|
export declare function generateHotReloadScript(wsPort: number, options?: HotReloadOptions): string;
|
|
5
|
-
/**
|
|
6
|
-
* Inject hot reload script into HTML content
|
|
7
|
-
*/
|
|
8
|
-
export declare function injectHotReload(html: string, wsPort: number, options?: HotReloadOptions): string;
|
|
9
5
|
/**
|
|
10
6
|
* Determine if a file change should trigger a CSS-only update
|
|
11
7
|
*/
|
|
@@ -74,9 +70,6 @@ export declare interface HotReloadMessage {
|
|
|
74
70
|
* Manages WebSocket connections and broadcasts reload messages to browsers.
|
|
75
71
|
*/
|
|
76
72
|
export declare class HotReloadServer {
|
|
77
|
-
private clients: Set<WebSocketClient>;
|
|
78
|
-
private server: ReturnType<typeof Bun.serve> | null;
|
|
79
|
-
private options: Required<HotReloadOptions>;
|
|
80
73
|
constructor(options?: HotReloadOptions);
|
|
81
74
|
start(port?: number): number;
|
|
82
75
|
stop(): void;
|
|
@@ -84,4 +77,6 @@ export declare class HotReloadServer {
|
|
|
84
77
|
reload(filePath?: string): void;
|
|
85
78
|
updateCss(filePath: string, content?: string): void;
|
|
86
79
|
error(message: string): void;
|
|
87
|
-
|
|
80
|
+
get clientCount(): number;
|
|
81
|
+
get port(): number;
|
|
82
|
+
}
|
package/dist/hydration.d.ts
CHANGED
|
@@ -113,42 +113,15 @@ export declare interface ComponentHydrationConfig {
|
|
|
113
113
|
* Main hydration class
|
|
114
114
|
*/
|
|
115
115
|
export declare class HydrationRuntime {
|
|
116
|
-
private state: HydrationState | null;
|
|
117
|
-
private options: Required<HydrationOptions>;
|
|
118
|
-
private root: HTMLElement | null;
|
|
119
|
-
private isHydrated: any;
|
|
120
|
-
private pendingComponents: Map<string, ComponentHydrationConfig>;
|
|
121
|
-
private hydratedComponents: Set<string>;
|
|
122
116
|
constructor(options?: HydrationOptions);
|
|
123
117
|
hydrate(): Promise<void>;
|
|
124
|
-
|
|
125
|
-
private restoreGlobalState(): void;
|
|
126
|
-
private hydrateComponents(): Promise<void>;
|
|
127
|
-
private hydrateComponent(el: HTMLElement, config: ComponentHydrationConfig): Promise<void>;
|
|
128
|
-
private restoreComponentState(el: HTMLElement, state: unknown): void;
|
|
129
|
-
private setupVisibleHydration(el: HTMLElement, config: ComponentHydrationConfig): void;
|
|
130
|
-
private setupIdleHydration(el: HTMLElement, config: ComponentHydrationConfig): void;
|
|
131
|
-
private setupInteractionHydration(el: HTMLElement, config: ComponentHydrationConfig): void;
|
|
132
|
-
private bindEventHandlers(): void;
|
|
133
|
-
private bindElementEvents(el: HTMLElement): void;
|
|
134
|
-
private bindDirectiveEvents(): void;
|
|
135
|
-
private parseModifiers(el: HTMLElement, eventType: string): string[];
|
|
136
|
-
private bindSingleEvent(el: HTMLElement, event: EventBinding): void;
|
|
137
|
-
private resolveHandler(handlerStr: string): ((e: Event) => void) | null;
|
|
138
|
-
private bindComponentEvents(el: HTMLElement): void;
|
|
139
|
-
private initializeComponentReactivity(el: HTMLElement, config: ComponentHydrationConfig): void;
|
|
140
|
-
private initializeReactiveBindings(): void;
|
|
141
|
-
private getTextNodesWithExpressions(root: HTMLElement): Array<{
|
|
142
|
-
node: Text
|
|
143
|
-
expressions: string[]
|
|
144
|
-
}>;
|
|
145
|
-
private setupTextNodeBinding(node: Text, expression: string): void;
|
|
146
|
-
private setupAttributeBinding(el: HTMLElement, attr: string, expression: string): void;
|
|
147
|
-
private setupReactiveBinding(el: HTMLElement, expression: string): void;
|
|
148
|
-
private setupRouterIntegration(): void;
|
|
118
|
+
get hydrated(): boolean;
|
|
149
119
|
getState(): HydrationState | null;
|
|
150
120
|
hydrateById(componentId: string): Promise<void>;
|
|
151
121
|
}
|
|
122
|
+
// =============================================================================
|
|
123
|
+
// Exports
|
|
124
|
+
// =============================================================================
|
|
152
125
|
export default {
|
|
153
126
|
HydrationRuntime,
|
|
154
127
|
serializeState,
|
|
@@ -158,4 +131,4 @@ export default {
|
|
|
158
131
|
extractState,
|
|
159
132
|
getHydrationRuntime,
|
|
160
133
|
hydrate,
|
|
161
|
-
};
|
|
134
|
+
};
|
package/dist/i18n.d.ts
CHANGED
|
@@ -230,14 +230,6 @@ export declare function createTranslateFilter(translations: Record<string, any>,
|
|
|
230
230
|
// =============================================================================
|
|
231
231
|
// Default i18n configuration
|
|
232
232
|
export declare const defaultI18nConfig: I18nConfig;
|
|
233
|
-
/**
|
|
234
|
-
* Pending load tracking for deduplication
|
|
235
|
-
*/
|
|
236
|
-
declare interface PendingLoad {
|
|
237
|
-
promise: Promise<Record<string, any>>
|
|
238
|
-
state: LoadingState
|
|
239
|
-
error?: Error
|
|
240
|
-
}
|
|
241
233
|
/**
|
|
242
234
|
* Preload configuration
|
|
243
235
|
*/
|
|
@@ -252,4 +244,4 @@ export declare interface PreloadConfig {
|
|
|
252
244
|
/**
|
|
253
245
|
* Loading state for async translation loading
|
|
254
246
|
*/
|
|
255
|
-
declare type LoadingState = 'idle' | 'loading' | 'loaded' | 'error'
|
|
247
|
+
declare type LoadingState = 'idle' | 'loading' | 'loaded' | 'error';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ImageOptions,
|
|
1
|
+
import { type ImageOptions, type ImageFormat, type ProcessedImage, type ImageVariant } from './processor';
|
|
2
2
|
import type { BuildPlugin } from '../production-build';
|
|
3
3
|
/**
|
|
4
4
|
* Create the image optimization build plugin
|
|
@@ -50,4 +50,4 @@ export declare interface ImageBuildContext {
|
|
|
50
50
|
savedBytes: number
|
|
51
51
|
variants: number
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ImageFormat,
|
|
1
|
+
import { type ImageFormat, type ImageVariant, type ProcessedImage } from './processor';
|
|
2
2
|
/**
|
|
3
3
|
* Render an optimized <Image> component
|
|
4
4
|
*/
|
|
@@ -43,4 +43,4 @@ export declare interface ImageRenderResult {
|
|
|
43
43
|
html: string
|
|
44
44
|
preloadLink?: string
|
|
45
45
|
placeholderCss?: string
|
|
46
|
-
}
|
|
46
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ImageFormat
|
|
1
|
+
import { type ImageFormat } from './processor';
|
|
2
2
|
import type { CustomDirective } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Clear the image cache
|
|
@@ -27,4 +27,4 @@ export declare interface ImageDirectiveOptions {
|
|
|
27
27
|
style?: string
|
|
28
28
|
priority?: boolean
|
|
29
29
|
placeholder?: 'blur' | 'color' | 'none'
|
|
30
|
-
}
|
|
30
|
+
}
|
|
@@ -17,6 +17,51 @@ export declare interface ImageConfig {
|
|
|
17
17
|
outputDir?: string
|
|
18
18
|
baseUrl?: string
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* STX Image Optimization
|
|
22
|
+
*
|
|
23
|
+
* Comprehensive image optimization for improved Core Web Vitals (LCP).
|
|
24
|
+
*
|
|
25
|
+
* Features:
|
|
26
|
+
* - Responsive images with srcset/sizes
|
|
27
|
+
* - Modern format conversion (WebP, AVIF)
|
|
28
|
+
* - Lazy loading with blur placeholders
|
|
29
|
+
* - Build-time optimization
|
|
30
|
+
* - <Image> component and @image directive
|
|
31
|
+
*
|
|
32
|
+
* @module image-optimization
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```html
|
|
36
|
+
* <!-- Image Component -->
|
|
37
|
+
* <Image
|
|
38
|
+
* src="/images/hero.jpg"
|
|
39
|
+
* alt="Hero image"
|
|
40
|
+
* width="1200"
|
|
41
|
+
* height="600"
|
|
42
|
+
* sizes="(max-width: 768px) 100vw, 50vw"
|
|
43
|
+
* priority
|
|
44
|
+
* />
|
|
45
|
+
*
|
|
46
|
+
* <!-- @image Directive -->
|
|
47
|
+
* @image('/images/photo.jpg', 'A photo', { width: 800, lazy: true })
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* // Build plugin
|
|
53
|
+
* import { createImagePlugin } from 'stx/image-optimization'
|
|
54
|
+
*
|
|
55
|
+
* const plugin = createImagePlugin({
|
|
56
|
+
* formats: ['webp', 'avif', 'jpeg'],
|
|
57
|
+
* widths: [320, 640, 1024, 1920],
|
|
58
|
+
* quality: 80,
|
|
59
|
+
* })
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// Processor Exports
|
|
64
|
+
// ============================================================================
|
|
20
65
|
export {
|
|
21
66
|
// Core processing
|
|
22
67
|
processImage,
|
|
@@ -50,6 +95,9 @@ export {
|
|
|
50
95
|
type ImageVariant,
|
|
51
96
|
type ImageMetadata,
|
|
52
97
|
} from './processor';
|
|
98
|
+
// ============================================================================
|
|
99
|
+
// Component Exports
|
|
100
|
+
// ============================================================================
|
|
53
101
|
export {
|
|
54
102
|
// Rendering
|
|
55
103
|
renderImageComponent,
|
|
@@ -61,6 +109,9 @@ export {
|
|
|
61
109
|
type ImageRenderContext,
|
|
62
110
|
type ImageRenderResult,
|
|
63
111
|
} from './component';
|
|
112
|
+
// ============================================================================
|
|
113
|
+
// Directive Exports
|
|
114
|
+
// ============================================================================
|
|
64
115
|
export {
|
|
65
116
|
// Directive
|
|
66
117
|
imageDirective,
|
|
@@ -70,6 +121,9 @@ export {
|
|
|
70
121
|
// Types
|
|
71
122
|
type ImageDirectiveOptions,
|
|
72
123
|
} from './directive';
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// Build Plugin Exports
|
|
126
|
+
// ============================================================================
|
|
73
127
|
export {
|
|
74
128
|
// Plugin
|
|
75
129
|
createImagePlugin,
|
|
@@ -83,4 +137,4 @@ export {
|
|
|
83
137
|
// Types
|
|
84
138
|
type ImageBuildOptions,
|
|
85
139
|
type ImageBuildContext,
|
|
86
|
-
} from './build-plugin';
|
|
140
|
+
} from './build-plugin';
|
|
@@ -43,10 +43,13 @@ export declare function getTotalSize(variants: ImageVariant[]): number;
|
|
|
43
43
|
* Format file size for display
|
|
44
44
|
*/
|
|
45
45
|
export declare function formatSize(bytes: number): string;
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* ============================================================================
|
|
47
48
|
// Constants
|
|
48
49
|
// ============================================================================
|
|
49
|
-
|
|
50
|
+
* @defaultValue `[320, 640, 768, 1024, 1280, 1536, 1920]`
|
|
51
|
+
*/
|
|
52
|
+
export declare const DEFAULT_WIDTHS: number[];
|
|
50
53
|
export declare const DEFAULT_FORMATS: ImageFormat[];
|
|
51
54
|
export declare const DEFAULT_QUALITY: 80;
|
|
52
55
|
// ============================================================================
|
|
@@ -84,7 +87,7 @@ export declare interface ImageMetadata {
|
|
|
84
87
|
format: string
|
|
85
88
|
hasAlpha?: boolean
|
|
86
89
|
}
|
|
87
|
-
export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png'
|
|
90
|
+
export type ImageFormat = 'webp' | 'avif' | 'jpeg' | 'png';
|
|
88
91
|
// ============================================================================
|
|
89
92
|
// Sharp Integration
|
|
90
93
|
// ============================================================================
|
|
@@ -103,10 +106,12 @@ declare type SharpModule = {
|
|
|
103
106
|
(input: Buffer | string): SharpInstance
|
|
104
107
|
default?: (input: Buffer | string) => SharpInstance
|
|
105
108
|
}
|
|
109
|
+
declare type = : 'blur' | 'dominant-color',
|
|
110
|
+
): Promise<string> {;
|
|
106
111
|
// ============================================================================
|
|
107
112
|
// Error Handling
|
|
108
113
|
// ============================================================================
|
|
109
114
|
export declare class ImageProcessingError extends Error {
|
|
110
115
|
code: string;
|
|
111
116
|
constructor(message: string, code: string);
|
|
112
|
-
}
|
|
117
|
+
}
|
package/dist/includes.d.ts
CHANGED
|
@@ -106,4 +106,4 @@ export declare const partialsCache: LRUCache<string, string>;
|
|
|
106
106
|
// Global store to track what has been included via @once
|
|
107
107
|
// WARNING: This persists across requests in long-running servers!
|
|
108
108
|
// Use clearOnceStore() at the start of each request, or use request-scoped tracking via context.__onceStore
|
|
109
|
-
export declare const onceStore: Set<string>;
|
|
109
|
+
export declare const onceStore: Set<string>;
|