@stacksjs/stx 0.2.0 → 0.2.3
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 +109 -5
- package/dist/analytics.d.ts +40 -0
- package/dist/animation.d.ts +90 -0
- package/dist/app.d.ts +51 -0
- package/dist/ast.d.ts +286 -0
- package/dist/async-components.d.ts +101 -0
- package/dist/auth.d.ts +1 -3
- package/dist/browser-composables.d.ts +314 -0
- package/dist/build-optimizer.d.ts +126 -0
- package/dist/build-views.d.ts +37 -0
- package/dist/bundle-analyzer/collector.d.ts +66 -0
- package/dist/bundle-analyzer/index.d.ts +60 -0
- package/dist/bundle-analyzer/report.d.ts +39 -0
- package/dist/bundle-analyzer/treemap.d.ts +19 -0
- package/dist/bundle-analyzer.js +499 -0
- package/dist/caching.d.ts +7 -0
- package/dist/cli.js +10880 -1199
- package/dist/client/directive.d.ts +10 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/router.d.ts +36 -0
- package/dist/client/stx-router.browser.d.ts +0 -0
- package/dist/client-script.d.ts +22 -0
- package/dist/component-hmr.d.ts +120 -0
- package/dist/components.d.ts +23 -1
- package/dist/composables/index.d.ts +277 -0
- package/dist/composables/use-battery.d.ts +46 -0
- package/dist/composables/use-broadcast-channel.d.ts +58 -0
- package/dist/composables/use-clipboard.d.ts +34 -0
- package/dist/composables/use-cookie.d.ts +70 -0
- package/dist/composables/use-device-orientation.d.ts +109 -0
- package/dist/composables/use-event-source.d.ts +77 -0
- package/dist/composables/use-eye-dropper.d.ts +107 -0
- package/dist/composables/use-fetch.d.ts +84 -0
- package/dist/composables/use-fullscreen.d.ts +47 -0
- package/dist/composables/use-geolocation.d.ts +62 -0
- package/dist/composables/use-idle.d.ts +84 -0
- package/dist/composables/use-intersection-observer.d.ts +81 -0
- package/dist/composables/use-keyboard.d.ts +100 -0
- package/dist/composables/use-media-query.d.ts +56 -0
- package/dist/composables/use-mouse.d.ts +64 -0
- package/dist/composables/use-mutation-observer.d.ts +101 -0
- package/dist/composables/use-network.d.ts +40 -0
- package/dist/composables/use-notification.d.ts +89 -0
- package/dist/composables/use-permissions.d.ts +109 -0
- package/dist/composables/use-resize-observer.d.ts +60 -0
- package/dist/composables/use-share.d.ts +70 -0
- package/dist/composables/use-speech.d.ts +117 -0
- package/dist/composables/use-storage.d.ts +64 -0
- package/dist/composables/use-text-selection.d.ts +97 -0
- package/dist/composables/use-wake-lock.d.ts +85 -0
- package/dist/composables/use-websocket.d.ts +69 -0
- package/dist/composables/use-window.d.ts +84 -0
- package/dist/composables.d.ts +268 -0
- package/dist/composition-api.d.ts +190 -0
- package/dist/computed.d.ts +137 -0
- package/dist/conditionals.d.ts +14 -2
- package/dist/config.d.ts +35 -2
- package/dist/craft-bridge.d.ts +319 -0
- package/dist/craft-compiler.d.ts +229 -0
- package/dist/craft-components.d.ts +411 -0
- package/dist/craft-entry.d.ts +5 -0
- package/dist/craft-ssr.d.ts +134 -0
- package/dist/craft.js +1553 -0
- package/dist/csp.d.ts +229 -0
- package/dist/database.d.ts +407 -0
- package/dist/database.js +5 -0
- package/dist/defer.d.ts +4 -0
- package/dist/deploy/config-generators.d.ts +75 -0
- package/dist/deploy/index.d.ts +84 -0
- package/dist/deploy/netlify.d.ts +109 -0
- package/dist/dev-server/crosswind.d.ts +54 -0
- package/dist/dev-server/index.d.ts +7 -0
- package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
- package/dist/dev-server/native-window.d.ts +40 -0
- package/dist/dev-server/port-utils.d.ts +27 -0
- package/dist/dev-server/terminal-colors.d.ts +60 -0
- package/dist/dev-server/theme-selector.d.ts +32 -0
- package/dist/dev-server/types.d.ts +92 -0
- package/dist/dev-server.d.ts +21 -0
- package/dist/devtools.d.ts +142 -0
- package/dist/directive-api.d.ts +111 -0
- package/dist/dynamic-components.d.ts +14 -0
- package/dist/edge-runtime.d.ts +200 -0
- package/dist/env.d.ts +9 -0
- package/dist/error-boundaries.d.ts +71 -0
- package/dist/error-handling.d.ts +1 -101
- package/dist/errors/codes.d.ts +99 -0
- package/dist/errors/formatter.d.ts +64 -0
- package/dist/errors/index.d.ts +56 -0
- package/dist/errors/logger.d.ts +74 -0
- package/dist/errors/sanitizer.d.ts +43 -0
- package/dist/errors/types.d.ts +79 -0
- package/dist/events.d.ts +106 -0
- package/dist/expressions.d.ts +86 -11
- package/dist/forms-validation.d.ts +173 -0
- package/dist/forms.d.ts +157 -8
- package/dist/head.d.ts +225 -0
- package/dist/heatmap.d.ts +125 -0
- package/dist/hot-reload.d.ts +87 -0
- package/dist/hydration-runtime.d.ts +47 -0
- package/dist/hydration.d.ts +161 -0
- package/dist/i18n.d.ts +239 -3
- package/dist/image-optimization/build-plugin.d.ts +53 -0
- package/dist/image-optimization/component.d.ts +46 -0
- package/dist/image-optimization/directive.d.ts +30 -0
- package/dist/image-optimization/index.d.ts +86 -0
- package/dist/image-optimization/processor.d.ts +112 -0
- package/dist/includes.d.ts +94 -9
- package/dist/index.d.ts +63 -3
- package/dist/index.js +11603 -1318
- package/dist/init.d.ts +32 -2
- package/dist/interactive.d.ts +14 -0
- package/dist/internal-markdown.d.ts +22 -0
- package/dist/jsx-runtime.d.ts +110 -0
- package/dist/keep-alive.d.ts +87 -0
- package/dist/lazy-loader.d.ts +122 -0
- package/dist/loading-indicator.d.ts +40 -0
- package/dist/loops.d.ts +22 -1
- package/dist/media/client/blur-up.d.ts +65 -0
- package/dist/media/client/index.d.ts +77 -0
- package/dist/media/client/lazy-load.d.ts +73 -0
- package/dist/media/client/upload-handler.d.ts +79 -0
- package/dist/media/image/component.d.ts +46 -0
- package/dist/media/image/directive.d.ts +9 -0
- package/dist/media/image/editing.d.ts +212 -0
- package/dist/media/image/index.d.ts +118 -0
- package/dist/media/image/placeholder.d.ts +78 -0
- package/dist/media/image/processor/cache.d.ts +32 -0
- package/dist/media/image/processor/index.d.ts +12 -0
- package/dist/media/image/processor/optimizer.d.ts +13 -0
- package/dist/media/image/processor/responsive.d.ts +17 -0
- package/dist/media/image/srcset.d.ts +158 -0
- package/dist/media/index.d.ts +295 -0
- package/dist/media/manager/embed.d.ts +25 -0
- package/dist/media/protected/component.d.ts +34 -0
- package/dist/media/protected/index.d.ts +34 -0
- package/dist/media/protected/signature.d.ts +72 -0
- package/dist/media/shared/cache.d.ts +54 -0
- package/dist/media/shared/hash.d.ts +24 -0
- package/dist/media/shared/index.d.ts +2 -0
- package/dist/media/types.d.ts +1051 -0
- package/dist/media/upload/component.d.ts +23 -0
- package/dist/media/upload/index.d.ts +1 -0
- package/dist/media/video/directive.d.ts +9 -0
- package/dist/media/video/index.d.ts +47 -0
- package/dist/media/video/processor/cache.d.ts +33 -0
- package/dist/media/video/processor/index.d.ts +21 -0
- package/dist/media/video/processor/streaming.d.ts +19 -0
- package/dist/media/video/processor/thumbnail.d.ts +28 -0
- package/dist/media/video/processor/transcoder.d.ts +9 -0
- package/dist/middleware.d.ts +42 -3
- package/dist/native-build.d.ts +74 -0
- package/dist/parser/directive-parser.d.ts +79 -0
- package/dist/parser/expression-parser.d.ts +59 -0
- package/dist/parser/index.d.ts +35 -0
- package/dist/parser/tokenizer.d.ts +81 -0
- package/dist/partial-hydration.d.ts +88 -0
- package/dist/performance-utils.d.ts +146 -3
- package/dist/plugin-system.d.ts +128 -0
- package/dist/precompiler.d.ts +108 -0
- package/dist/production-build.d.ts +199 -0
- package/dist/props.d.ts +199 -0
- package/dist/pwa/audit.d.ts +42 -0
- package/dist/pwa/directives.d.ts +29 -0
- package/dist/pwa/icons.d.ts +39 -0
- package/dist/pwa/index.d.ts +59 -0
- package/dist/pwa/inject.d.ts +22 -0
- package/dist/pwa/manifest.d.ts +104 -0
- package/dist/pwa/offline.d.ts +8 -0
- package/dist/pwa/precache.d.ts +29 -0
- package/dist/pwa/service-worker.d.ts +21 -0
- package/dist/pwa/workbox-strategies.d.ts +100 -0
- package/dist/pwa/workbox.d.ts +52 -0
- package/dist/pwa.d.ts +51 -0
- package/dist/pwa.js +8124 -0
- package/dist/reactive-bindings.d.ts +24 -0
- package/dist/reactive.d.ts +100 -0
- package/dist/reactivity.d.ts +253 -0
- package/dist/route-middleware.d.ts +232 -0
- package/dist/router.d.ts +31 -0
- package/dist/routes.d.ts +0 -7
- package/dist/runtime.d.ts +140 -0
- package/dist/safe-evaluator.d.ts +117 -3
- package/dist/scaffolding.d.ts +113 -0
- package/dist/seo.d.ts +120 -7
- package/dist/server-components.d.ts +134 -0
- package/dist/signals.d.ts +501 -0
- package/dist/slots.d.ts +63 -0
- package/dist/source-maps.d.ts +117 -0
- package/dist/ssg.d.ts +157 -0
- package/dist/ssg.js +6831 -0
- package/dist/ssr.d.ts +107 -0
- package/dist/state-management.d.ts +324 -0
- package/dist/stores-client.d.ts +70 -0
- package/dist/story/addons.d.ts +123 -0
- package/dist/story/analytics.d.ts +92 -0
- package/dist/story/auto-stories.d.ts +38 -0
- package/dist/story/bookmarks.d.ts +53 -0
- package/dist/story/bun-test.d.ts +44 -0
- package/dist/story/cli.d.ts +34 -0
- package/dist/story/collect/analyzer.d.ts +33 -0
- package/dist/story/collect/index.d.ts +27 -0
- package/dist/story/collect/parser.d.ts +17 -0
- package/dist/story/collect/scanner.d.ts +13 -0
- package/dist/story/collect/tree.d.ts +17 -0
- package/dist/story/commands/build.d.ts +14 -0
- package/dist/story/commands/dev.d.ts +16 -0
- package/dist/story/commands/index.d.ts +6 -0
- package/dist/story/commands/preview.d.ts +15 -0
- package/dist/story/compiled-output.d.ts +26 -0
- package/dist/story/composition.d.ts +47 -0
- package/dist/story/config-watcher.d.ts +26 -0
- package/dist/story/config.d.ts +26 -0
- package/dist/story/context.d.ts +21 -0
- package/dist/story/controls/index.d.ts +54 -0
- package/dist/story/crosswind.d.ts +29 -0
- package/dist/story/desktop-preview.d.ts +34 -0
- package/dist/story/docs-generator.d.ts +30 -0
- package/dist/story/errors.d.ts +47 -0
- package/dist/story/figma-export.d.ts +169 -0
- package/dist/story/generator.d.ts +21 -0
- package/dist/story/hmr.d.ts +64 -0
- package/dist/story/hot-swap.d.ts +35 -0
- package/dist/story/index.d.ts +51 -0
- package/dist/story/interactions.d.ts +52 -0
- package/dist/story/keyboard-shortcuts.d.ts +34 -0
- package/dist/story/output.d.ts +85 -0
- package/dist/story/performance.d.ts +76 -0
- package/dist/story/presets.d.ts +62 -0
- package/dist/story/props-validation.d.ts +45 -0
- package/dist/story/renderer.d.ts +53 -0
- package/dist/story/search-index.d.ts +47 -0
- package/dist/story/search.d.ts +45 -0
- package/dist/story/server.d.ts +21 -0
- package/dist/story/setup.d.ts +47 -0
- package/dist/story/snapshots.d.ts +65 -0
- package/dist/story/testing.d.ts +58 -0
- package/dist/story/theme.d.ts +68 -0
- package/dist/story/types.d.ts +249 -0
- package/dist/story/ui/code-panel.d.ts +42 -0
- package/dist/story/ui/controls-panel.d.ts +25 -0
- package/dist/story/ui/index.d.ts +4 -0
- package/dist/story/ui/navigation.d.ts +55 -0
- package/dist/story/ui/preview.d.ts +46 -0
- package/dist/story/visual-testing.d.ts +45 -0
- package/dist/streaming.d.ts +82 -2
- package/dist/suspense.d.ts +83 -0
- package/dist/teleport.d.ts +9 -0
- package/dist/testing.d.ts +289 -0
- package/dist/transitions.d.ts +87 -0
- package/dist/type-checker.d.ts +109 -0
- package/dist/types/component-types.d.ts +129 -0
- package/dist/types/config-types.d.ts +336 -0
- package/dist/types/context-types.d.ts +99 -0
- package/dist/types/csp-types.d.ts +79 -0
- package/dist/types/directive-types.d.ts +259 -0
- package/dist/types/index.d.ts +98 -0
- package/dist/types/pwa-types.d.ts +218 -0
- package/dist/types.d.ts +1 -315
- package/dist/typescript-templates.d.ts +178 -0
- package/dist/utils.d.ts +52 -6
- package/dist/validator.d.ts +77 -0
- package/dist/variable-extractor.d.ts +39 -0
- package/dist/view-composers.d.ts +154 -9
- package/dist/virtual-scrolling.d.ts +103 -0
- package/dist/visual-editor.d.ts +209 -0
- package/dist/visual-testing.d.ts +109 -0
- package/dist/visual-testing.js +126 -0
- package/dist/vue-template.d.ts +16 -0
- package/dist/web-components/css-scoping.d.ts +54 -0
- package/dist/web-components/index.d.ts +20 -0
- package/dist/web-components/reactive-generator.d.ts +72 -0
- package/dist/web-components.d.ts +222 -2
- package/dist/x-element.d.ts +35 -0
- package/package.json +41 -11
package/dist/ssg.d.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate static site
|
|
3
|
+
*/
|
|
4
|
+
export declare function generateStaticSite(options?: SSGConfig): Promise<SSGResult>;
|
|
5
|
+
/**
|
|
6
|
+
* Create ISR handler for runtime revalidation
|
|
7
|
+
*/
|
|
8
|
+
export declare function createISRHandler(options?: SSGConfig): {
|
|
9
|
+
get: (route: string) => Promise<{ html: string; headers: Record<string, string> } | null>
|
|
10
|
+
revalidate: (route: string) => Promise<void>
|
|
11
|
+
invalidate: (route: string | RegExp) => Promise<void>
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Define static paths for dynamic routes (used in templates)
|
|
15
|
+
*/
|
|
16
|
+
export declare function defineStaticPaths(pathsFn: () => Promise<StaticPath[]> | StaticPath[]): () => Promise<StaticPathsResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Create a markdown content loader
|
|
19
|
+
*/
|
|
20
|
+
export declare function createMarkdownLoader(): ContentLoader;
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// Types
|
|
23
|
+
// =============================================================================
|
|
24
|
+
export declare interface SSGConfig {
|
|
25
|
+
pagesDir?: string
|
|
26
|
+
outputDir?: string
|
|
27
|
+
baseUrl?: string
|
|
28
|
+
domain?: string
|
|
29
|
+
revalidate?: number | false
|
|
30
|
+
sitemap?: boolean
|
|
31
|
+
rss?: boolean | RSSConfig
|
|
32
|
+
concurrency?: number
|
|
33
|
+
cache?: boolean
|
|
34
|
+
cacheDir?: string
|
|
35
|
+
contentLoaders?: ContentLoader[]
|
|
36
|
+
hooks?: SSGHooks
|
|
37
|
+
minify?: boolean
|
|
38
|
+
generate404?: boolean
|
|
39
|
+
publicDir?: string
|
|
40
|
+
trailingSlash?: boolean
|
|
41
|
+
cleanOutput?: boolean
|
|
42
|
+
}
|
|
43
|
+
export declare interface RSSConfig {
|
|
44
|
+
title: string
|
|
45
|
+
description: string
|
|
46
|
+
link: string
|
|
47
|
+
language?: string
|
|
48
|
+
copyright?: string
|
|
49
|
+
getItems?: () => Promise<RSSItem[]>
|
|
50
|
+
}
|
|
51
|
+
export declare interface RSSItem {
|
|
52
|
+
title: string
|
|
53
|
+
link: string
|
|
54
|
+
description?: string
|
|
55
|
+
pubDate?: Date
|
|
56
|
+
author?: string
|
|
57
|
+
categories?: string[]
|
|
58
|
+
guid?: string
|
|
59
|
+
}
|
|
60
|
+
export declare interface StaticPath {
|
|
61
|
+
params: Record<string, string>
|
|
62
|
+
props?: Record<string, unknown>
|
|
63
|
+
revalidate?: number | false
|
|
64
|
+
}
|
|
65
|
+
export declare interface StaticPathsResult {
|
|
66
|
+
paths: StaticPath[]
|
|
67
|
+
fallback?: 'blocking' | 'static' | false
|
|
68
|
+
}
|
|
69
|
+
export declare interface ContentLoader {
|
|
70
|
+
name: string
|
|
71
|
+
extensions: string[]
|
|
72
|
+
load: (filePath: string) => Promise<ContentResult>
|
|
73
|
+
}
|
|
74
|
+
export declare interface ContentResult {
|
|
75
|
+
content: string
|
|
76
|
+
data: Record<string, unknown>
|
|
77
|
+
toc?: TocItem[]
|
|
78
|
+
}
|
|
79
|
+
export declare interface TocItem {
|
|
80
|
+
id: string
|
|
81
|
+
text: string
|
|
82
|
+
level: number
|
|
83
|
+
children?: TocItem[]
|
|
84
|
+
}
|
|
85
|
+
export declare interface SSGHooks {
|
|
86
|
+
onBuildStart?: () => void | Promise<void>
|
|
87
|
+
onBuildEnd?: (result: SSGResult) => void | Promise<void>
|
|
88
|
+
onPageStart?: (route: string) => void | Promise<void>
|
|
89
|
+
onPageEnd?: (route: string, html: string) => void | Promise<void>
|
|
90
|
+
onError?: (error: Error, route?: string) => void | Promise<void>
|
|
91
|
+
}
|
|
92
|
+
export declare interface SSGResult {
|
|
93
|
+
totalPages: number
|
|
94
|
+
successCount: number
|
|
95
|
+
failedCount: number
|
|
96
|
+
cachedCount: number
|
|
97
|
+
buildTime: number
|
|
98
|
+
sitemapPath?: string
|
|
99
|
+
rssPath?: string
|
|
100
|
+
pages: PageResult[]
|
|
101
|
+
errors: PageError[]
|
|
102
|
+
}
|
|
103
|
+
export declare interface PageResult {
|
|
104
|
+
route: string
|
|
105
|
+
outputPath: string
|
|
106
|
+
size: number
|
|
107
|
+
cached: boolean
|
|
108
|
+
revalidateAt?: number
|
|
109
|
+
}
|
|
110
|
+
export declare interface PageError {
|
|
111
|
+
route: string
|
|
112
|
+
error: Error
|
|
113
|
+
}
|
|
114
|
+
export declare interface ISRCache {
|
|
115
|
+
get: (route: string) => Promise<CachedPage | null>
|
|
116
|
+
set: (route: string, page: CachedPage) => Promise<void>
|
|
117
|
+
invalidate: (route: string) => Promise<void>
|
|
118
|
+
invalidatePattern: (pattern: RegExp) => Promise<void>
|
|
119
|
+
needsRevalidation: (route: string) => Promise<boolean>
|
|
120
|
+
}
|
|
121
|
+
export declare interface CachedPage {
|
|
122
|
+
html: string
|
|
123
|
+
generatedAt: number
|
|
124
|
+
revalidateAfter: number
|
|
125
|
+
etag: string
|
|
126
|
+
headers?: Record<string, string>
|
|
127
|
+
}
|
|
128
|
+
declare class BuildCache {
|
|
129
|
+
private cacheDir: string;
|
|
130
|
+
private cache: Map<string, BuildCacheEntry>;
|
|
131
|
+
private loaded: any;
|
|
132
|
+
constructor(cacheDir: string);
|
|
133
|
+
load(): Promise<void>;
|
|
134
|
+
save(): Promise<void>;
|
|
135
|
+
getHash(filePath: string, dependencies: string[]): string;
|
|
136
|
+
get(route: string, filePath: string, dependencies: string[]): string | null;
|
|
137
|
+
set(route: string, filePath: string, dependencies: string[], html: string): void;
|
|
138
|
+
}
|
|
139
|
+
// =============================================================================
|
|
140
|
+
// ISR Cache Implementation
|
|
141
|
+
// =============================================================================
|
|
142
|
+
declare class FileISRCache implements ISRCache {
|
|
143
|
+
private cacheDir: string;
|
|
144
|
+
constructor(cacheDir: string);
|
|
145
|
+
private getFilePath(route: string): string;
|
|
146
|
+
get(route: string): Promise<CachedPage | null>;
|
|
147
|
+
set(route: string, page: CachedPage): Promise<void>;
|
|
148
|
+
invalidate(route: string): Promise<void>;
|
|
149
|
+
invalidatePattern(pattern: RegExp): Promise<void>;
|
|
150
|
+
needsRevalidation(route: string): Promise<boolean>;
|
|
151
|
+
}
|
|
152
|
+
export default {
|
|
153
|
+
generateStaticSite,
|
|
154
|
+
createISRHandler,
|
|
155
|
+
defineStaticPaths,
|
|
156
|
+
createMarkdownLoader,
|
|
157
|
+
};
|