@stacksjs/stx 0.2.571 → 0.2.573
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 +51 -111
- package/dist/animation.d.ts +131 -74
- package/dist/api-client.d.ts +11 -21
- package/dist/api-handler.d.ts +4 -4
- package/dist/appearance-bootstrap.d.ts +16 -77
- package/dist/application-layers.d.ts +11 -20
- package/dist/asset-roots.d.ts +7 -27
- package/dist/assets.d.ts +7 -9
- package/dist/async-components.d.ts +56 -78
- package/dist/auth.d.ts +0 -3
- package/dist/browser-core-imports.d.ts +2 -2
- package/dist/build-externalize-repeated.d.ts +0 -25
- package/dist/build-externalize.d.ts +18 -53
- package/dist/build-id.d.ts +40 -28
- package/dist/build-message.d.ts +20 -44
- package/dist/builtins/attrs.d.ts +0 -14
- package/dist/builtins/drawer.d.ts +3 -22
- package/dist/builtins/icon.d.ts +17 -19
- package/dist/builtins/image-alpha.d.ts +8 -8
- package/dist/builtins/image-delivery.d.ts +38 -40
- package/dist/builtins/image-placeholder.d.ts +12 -50
- package/dist/builtins/image-warmup-worker.d.ts +1 -1
- package/dist/builtins/image-worker.d.ts +6 -32
- package/dist/builtins/index.d.ts +16 -6
- package/dist/builtins/modal.d.ts +13 -23
- package/dist/builtins/safe-image.d.ts +2 -42
- package/dist/builtins/stx-image.d.ts +44 -24
- package/dist/builtins/stx-link.d.ts +5 -8
- package/dist/builtins/stx-loading-indicator.d.ts +11 -10
- package/dist/builtins/suspense.d.ts +6 -27
- package/dist/builtins/toast.d.ts +15 -16
- package/dist/builtins/transition-group.d.ts +1 -25
- package/dist/caching.d.ts +24 -21
- package/dist/{chunk-f4jh9vrj.js → chunk-0s647d0b.js} +53 -53
- package/dist/{chunk-09gtbb1w.js → chunk-1bsafdnt.js} +1 -1
- package/dist/{chunk-m6mxqepz.js → chunk-1btr5tme.js} +1 -1
- package/dist/{chunk-01mxer9s.js → chunk-2g6wcnna.js} +1 -1
- package/dist/{chunk-rrj5m9xv.js → chunk-2hg2bqtj.js} +1 -1
- package/dist/{chunk-xckzvbvn.js → chunk-4f0fh2a9.js} +1 -1
- package/dist/chunk-557wtdps.js +2 -0
- package/dist/{chunk-vr36s2en.js → chunk-58vrf6kh.js} +1 -1
- package/dist/{chunk-qzbzn1yf.js → chunk-6tsnz28m.js} +1 -1
- package/dist/{chunk-cvswrbzw.js → chunk-6x8cwscv.js} +1 -1
- package/dist/{chunk-1n64749x.js → chunk-74ew8ajw.js} +1 -1
- package/dist/{chunk-jqefcghh.js → chunk-78d6yyxz.js} +2 -2
- package/dist/{chunk-83fdt4yj.js → chunk-824cnbac.js} +1 -1
- package/dist/{chunk-ntgy4e1q.js → chunk-864xm0jy.js} +1 -1
- package/dist/{chunk-nn174xjh.js → chunk-9fbkdrm8.js} +1 -1
- package/dist/{chunk-kzjrgh0b.js → chunk-a3gvw1q2.js} +1 -1
- package/dist/{chunk-pqcvh9pp.js → chunk-amtrg7pn.js} +1 -1
- package/dist/{chunk-pw9verqx.js → chunk-b5fpsp5n.js} +1 -1
- package/dist/{chunk-5afw7z6v.js → chunk-bcjr3fw7.js} +1 -1
- package/dist/{chunk-n6qp05t9.js → chunk-bkj0j5se.js} +1 -1
- package/dist/{chunk-mzqyv7s5.js → chunk-cf97xdqa.js} +1 -1
- package/dist/{chunk-cgwyd9aq.js → chunk-cr67dpx4.js} +1 -1
- package/dist/{chunk-f1apaqfk.js → chunk-dpqvacd1.js} +1 -1
- package/dist/{chunk-ghy82tsc.js → chunk-et8726at.js} +1 -1
- package/dist/{chunk-4bgfpkwx.js → chunk-ev8t5cxk.js} +1 -1
- package/dist/{chunk-4ssg5xpq.js → chunk-fynh3bkq.js} +12 -2
- package/dist/{chunk-gzgc8zk5.js → chunk-g8757f97.js} +2 -2
- package/dist/{chunk-3gft8zng.js → chunk-hm4j4d8q.js} +1 -1
- package/dist/{chunk-0bt0fbs1.js → chunk-j9qy9t3t.js} +5 -5
- package/dist/{chunk-2a1q5y6r.js → chunk-jhc47xzj.js} +1 -1
- package/dist/{chunk-79vdkvhf.js → chunk-kns5m52j.js} +1 -1
- package/dist/{chunk-2cqbyb8w.js → chunk-mjpewk4r.js} +1 -1
- package/dist/{chunk-2jjff8kv.js → chunk-nj488tj2.js} +2 -2
- package/dist/{chunk-dcpf6kas.js → chunk-q9chv68c.js} +1 -1
- package/dist/{chunk-xq2ck69k.js → chunk-qm280dp3.js} +1 -1
- package/dist/{chunk-ymawe0y5.js → chunk-sjcstv33.js} +1 -1
- package/dist/{chunk-tc5r2vmw.js → chunk-t0zdz8kd.js} +1 -1
- package/dist/{chunk-jwvzvapp.js → chunk-t3dnak1j.js} +1 -1
- package/dist/{chunk-2jsnrfc8.js → chunk-t64nnmmj.js} +1 -1
- package/dist/{chunk-m2a1fxpb.js → chunk-tvb8p7c0.js} +1 -1
- package/dist/{chunk-6f4qrd0s.js → chunk-tyhgq6rw.js} +1 -1
- package/dist/{chunk-4wfr074d.js → chunk-vn7tc8hm.js} +1 -1
- package/dist/{chunk-y4ajd836.js → chunk-xy6g8zb9.js} +1 -1
- package/dist/{chunk-zddzjd60.js → chunk-ya7xks9t.js} +1 -1
- package/dist/chunk-zpz6q2fh.js +2 -0
- package/dist/chunk-zxt94g45.js +2 -0
- package/dist/{chunk-cyg9w31a.js → chunk-zz7tw07b.js} +1 -1
- package/dist/{chunk-ta8bhz27.js → chunk-zzcxacjf.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/client/directive.d.ts +0 -7
- package/dist/client/index.d.ts +1 -0
- package/dist/client/signals-appearance-runtime.d.ts +1 -1
- package/dist/client/signals-binding-utils-runtime.d.ts +1 -1
- package/dist/client/signals-bootstrap-runtime.d.ts +2 -2
- package/dist/client/signals-class-runtime.d.ts +1 -1
- package/dist/client/signals-component-api-runtime.d.ts +1 -1
- package/dist/client/signals-component-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-component-props-runtime.d.ts +1 -1
- package/dist/client/signals-conditional-chain-runtime.d.ts +1 -1
- package/dist/client/signals-conditional-component-runtime.d.ts +1 -1
- package/dist/client/signals-container-cleanup-runtime.d.ts +1 -1
- package/dist/client/signals-context-runtime.d.ts +1 -1
- package/dist/client/signals-cookie-runtime.d.ts +1 -1
- package/dist/client/signals-devtools-runtime.d.ts +1 -1
- package/dist/client/signals-dialog-runtime.d.ts +1 -1
- package/dist/client/signals-dom-ready-runtime.d.ts +1 -1
- package/dist/client/signals-drawer-runtime.d.ts +1 -1
- package/dist/client/signals-effect-runtime.d.ts +1 -1
- package/dist/client/signals-event-shorthand-runtime.d.ts +1 -1
- package/dist/client/signals-expression-compiler-runtime.d.ts +1 -1
- package/dist/client/signals-expression-runtime.d.ts +1 -1
- package/dist/client/signals-fetch-transport-runtime.d.ts +1 -1
- package/dist/client/signals-for-runtime.d.ts +1 -1
- package/dist/client/signals-globals-runtime.d.ts +1 -1
- package/dist/client/signals-handler-runtime.d.ts +1 -1
- package/dist/client/signals-head-runtime.d.ts +1 -1
- package/dist/client/signals-helpers-runtime.d.ts +1 -1
- package/dist/client/signals-host-runtime.d.ts +1 -1
- package/dist/client/signals-hydration-audit-runtime.d.ts +1 -1
- package/dist/client/signals-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-if-chain-runtime.d.ts +1 -1
- package/dist/client/signals-if-runtime.d.ts +1 -1
- package/dist/client/signals-lazy-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-lifecycle-runtime.d.ts +1 -1
- package/dist/client/signals-loop-component-remap-runtime.d.ts +1 -1
- package/dist/client/signals-loop-conditional-runtime.d.ts +1 -1
- package/dist/client/signals-loop-row-runtime.d.ts +1 -1
- package/dist/client/signals-manifest-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-model-runtime.d.ts +1 -1
- package/dist/client/signals-mount-runtime.d.ts +1 -1
- package/dist/client/signals-navigation-runtime.d.ts +1 -1
- package/dist/client/signals-notify-runtime.d.ts +1 -1
- package/dist/client/signals-optimistic-runtime.d.ts +1 -1
- package/dist/client/signals-overlay-runtime.d.ts +1 -1
- package/dist/client/signals-pipe-runtime.d.ts +1 -1
- package/dist/client/signals-proxy-runtime.d.ts +1 -1
- package/dist/client/signals-query-runtime.d.ts +1 -1
- package/dist/client/signals-reactive-runtime.d.ts +1 -1
- package/dist/client/signals-ref-runtime.d.ts +1 -1
- package/dist/client/signals-scope-disposal-runtime.d.ts +1 -1
- package/dist/client/signals-scope-traversal-runtime.d.ts +1 -1
- package/dist/client/signals-show-runtime.d.ts +1 -1
- package/dist/client/signals-spa-load-control-runtime.d.ts +1 -1
- package/dist/client/signals-spa-load-runtime.d.ts +1 -1
- package/dist/client/signals-state-runtime.d.ts +1 -1
- package/dist/client/signals-storage-runtime.d.ts +1 -1
- package/dist/client/signals-store-registry-runtime.d.ts +1 -1
- package/dist/client/signals-style-runtime.d.ts +1 -1
- package/dist/client/signals-suspense-runtime.d.ts +1 -1
- package/dist/client/signals-timer-runtime.d.ts +1 -1
- package/dist/client/signals-toast-runtime.d.ts +1 -1
- package/dist/client/signals-tooltip-runtime.d.ts +1 -1
- package/dist/client/signals-transition-group-runtime.d.ts +1 -1
- package/dist/client/signals-websocket-runtime.d.ts +1 -1
- package/dist/client-helpers.d.ts +1 -312
- package/dist/client-module-registry.d.ts +4 -27
- package/dist/client-parameter-bindings.d.ts +1 -4
- package/dist/client-script-bundler.d.ts +55 -103
- package/dist/client-script.d.ts +69 -127
- package/dist/color-mode-boot.d.ts +21 -58
- package/dist/component-client-factories.d.ts +8 -9
- package/dist/component-contract-checks.d.ts +15 -18
- package/dist/component-contract.d.ts +6 -6
- package/dist/component-hmr.d.ts +8 -7
- package/dist/component-model.d.ts +14 -20
- package/dist/component-processing.d.ts +51 -59
- package/dist/component-registry.d.ts +28 -99
- package/dist/component-renderer.d.ts +19 -16
- package/dist/component-resolution.d.ts +8 -8
- package/dist/component-tags.d.ts +1 -1
- package/dist/composable-loader.d.ts +6 -41
- package/dist/composables/use-fetch.d.ts +45 -114
- package/dist/composables/use-form.d.ts +2 -56
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables.d.ts +75 -74
- package/dist/composition-api.d.ts +19 -43
- package/dist/computed.d.ts +93 -86
- package/dist/conditionals.d.ts +0 -24
- package/dist/config.d.ts +30 -24
- package/dist/config.js +3 -0
- package/dist/craft-bridge.d.ts +1 -467
- package/dist/craft-components.d.ts +234 -680
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/csp.d.ts +41 -107
- package/dist/database.d.ts +1 -1
- package/dist/defer.d.ts +0 -24
- package/dist/dev-server/terminal-colors.d.ts +32 -32
- package/dist/dev-server/ts-css.d.ts +26 -35
- package/dist/dev-server/types.d.ts +33 -29
- package/dist/directive-api.d.ts +42 -85
- package/dist/directive-arguments.d.ts +14 -39
- package/dist/document-shell.d.ts +49 -81
- package/dist/dynamic-components.d.ts +0 -9
- package/dist/engine-bindings.d.ts +1 -1
- package/dist/env.d.ts +26 -0
- package/dist/error-boundaries.d.ts +36 -43
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +43 -51
- package/dist/errors/formatter.d.ts +38 -58
- package/dist/errors/index.d.ts +61 -5
- package/dist/errors/logger.d.ts +40 -114
- package/dist/errors/sanitizer.d.ts +28 -53
- package/dist/errors/types.d.ts +31 -44
- package/dist/events.d.ts +32 -94
- package/dist/expressions.d.ts +57 -62
- package/dist/find-body-tag.d.ts +5 -34
- package/dist/first-script-tag.d.ts +0 -23
- package/dist/forms-validation.d.ts +117 -149
- package/dist/forms.d.ts +161 -120
- package/dist/framework-composables.d.ts +0 -32
- package/dist/head-injection.d.ts +30 -32
- package/dist/head-keys.d.ts +12 -15
- package/dist/head.d.ts +110 -139
- package/dist/heatmap.d.ts +76 -152
- package/dist/html-masking.d.ts +38 -62
- package/dist/hydration-runtime.d.ts +24 -20
- package/dist/hydration.d.ts +11 -10
- package/dist/i18n.d.ts +34 -95
- package/dist/image-optimization/auto-sibling.d.ts +4 -32
- package/dist/imported-signals.d.ts +0 -36
- package/dist/includes.d.ts +6 -69
- package/dist/index.d.ts +2 -1
- package/dist/init.d.ts +12 -20
- package/dist/internal-markdown.d.ts +8 -12
- package/dist/interpolation-context.d.ts +15 -15
- package/dist/island-chunking.d.ts +13 -30
- package/dist/keep-alive.d.ts +52 -72
- package/dist/layout-types.d.ts +2 -27
- package/dist/lazy-module.d.ts +0 -10
- package/dist/loading-indicator.d.ts +8 -5
- package/dist/loop-binding.d.ts +4 -7
- package/dist/loops.d.ts +25 -67
- package/dist/markdown.d.ts +1 -0
- package/dist/media/image/component.d.ts +9 -25
- package/dist/media/image/directive.d.ts +1 -15
- package/dist/media/image/placeholder.d.ts +9 -20
- package/dist/media/image/processor/cache.d.ts +18 -40
- package/dist/media/image/processor/index.d.ts +10 -1
- package/dist/media/image/processor/optimizer.d.ts +1 -12
- package/dist/media/image/processor/responsive.d.ts +6 -16
- package/dist/media/image/srcset.d.ts +49 -47
- package/dist/media/shared/cache.d.ts +31 -51
- package/dist/media/shared/hash.d.ts +0 -7
- package/dist/media/types.d.ts +754 -1235
- package/dist/media/video/directive.d.ts +1 -15
- package/dist/media/video/index.d.ts +17 -39
- package/dist/media/video/processor/cache.d.ts +19 -42
- package/dist/media/video/processor/index.d.ts +18 -1
- package/dist/media/video/processor/streaming.d.ts +10 -17
- package/dist/media/video/processor/thumbnail.d.ts +15 -21
- package/dist/media/video/processor/transcoder.d.ts +1 -11
- package/dist/meta-arguments.d.ts +14 -39
- package/dist/method-spoofing.d.ts +0 -7
- package/dist/middleware.d.ts +0 -60
- package/dist/native/bridge/protocol.d.ts +2 -1
- package/dist/native/compiler/bundle.js +11 -1
- package/dist/native/compiler/headwind-to-style.d.ts +383 -359
- package/dist/native/compiler/icons.d.ts +249 -243
- package/dist/native/compiler/svg.d.ts +35 -24
- package/dist/native/runtime/jsc-globals.d.ts +1 -1
- package/dist/native/runtime/native-host.d.ts +1 -1
- package/dist/native/runtime/native-host.js +3 -0
- package/dist/offline/app-service-worker.d.ts +50 -114
- package/dist/offline/kept-store.d.ts +23 -37
- package/dist/offline/query-cache.d.ts +55 -126
- package/dist/owned-routes.d.ts +0 -31
- package/dist/page-response.d.ts +8 -39
- package/dist/parser/directive-parser.d.ts +45 -57
- package/dist/parser/expression-parser.d.ts +35 -33
- package/dist/parser/index.d.ts +39 -4
- package/dist/parser/tokenizer.d.ts +49 -61
- package/dist/partial-hydration.d.ts +51 -82
- package/dist/performance-utils.d.ts +115 -255
- package/dist/placeholder.d.ts +9 -18
- package/dist/plugin-system.d.ts +115 -264
- package/dist/process.d.ts +4 -9
- package/dist/process.js +6 -4
- package/dist/prop-sentinels.d.ts +11 -11
- package/dist/public-env.d.ts +0 -14
- package/dist/pwa/directives.d.ts +20 -12
- package/dist/pwa/inject.d.ts +0 -10
- package/dist/pwa/precache.d.ts +16 -22
- package/dist/pwa/service-worker.d.ts +0 -12
- package/dist/pwa.js +1 -1
- package/dist/reactive-bindings.d.ts +11 -34
- package/dist/reactive-tracking.d.ts +0 -36
- package/dist/reactive.d.ts +41 -58
- package/dist/render-memo.d.ts +5 -23
- package/dist/resolve-stx-targets.d.ts +6 -44
- package/dist/route-middleware.d.ts +35 -2
- package/dist/route-rules.d.ts +10 -13
- package/dist/router.d.ts +9 -8
- package/dist/routes.d.ts +3 -1
- package/dist/runtime-config-server.d.ts +14 -17
- package/dist/runtime-config.d.ts +2 -3
- package/dist/runtime-globals.d.ts +90 -122
- package/dist/runtime-injection.d.ts +0 -8
- package/dist/scaffolding.d.ts +30 -26
- package/dist/script-emit.d.ts +0 -30
- package/dist/script-validation.d.ts +6 -12
- package/dist/seo.d.ts +75 -153
- package/dist/server-api.d.ts +9 -12
- package/dist/server-bindings.d.ts +1 -26
- package/dist/server-data.d.ts +4 -5
- package/dist/sfc-template.d.ts +8 -8
- package/dist/signal-processing.d.ts +37 -53
- package/dist/signals-api.d.ts +58 -135
- package/dist/signals.d.ts +18 -24
- package/dist/site-url.d.ts +31 -28
- package/dist/slots.d.ts +20 -86
- package/dist/source-signature.d.ts +5 -28
- package/dist/ssg.d.ts +158 -337
- package/dist/ssg.js +2 -2
- package/dist/state-dir.d.ts +4 -4
- package/dist/store-loader.d.ts +0 -10
- package/dist/story/analytics.d.ts +60 -138
- package/dist/story/bookmarks.d.ts +34 -87
- package/dist/story/cli.d.ts +69 -123
- package/dist/story/collect/scanner.d.ts +0 -4
- package/dist/story/collect/tree.d.ts +1 -8
- package/dist/story/commands/build.d.ts +6 -11
- package/dist/story/commands/dev.d.ts +8 -15
- package/dist/story/commands/preview.d.ts +7 -13
- package/dist/story/config-watcher.d.ts +13 -20
- package/dist/story/config.d.ts +8 -11
- package/dist/story/context.d.ts +8 -14
- package/dist/story/hmr.d.ts +26 -24
- package/dist/story/hot-swap.d.ts +23 -34
- package/dist/story/keyboard-shortcuts.d.ts +18 -23
- package/dist/story/output.d.ts +44 -46
- package/dist/story/performance.d.ts +45 -107
- package/dist/story/presets.d.ts +41 -107
- package/dist/story/renderer.d.ts +27 -41
- package/dist/story/search.d.ts +12 -23
- package/dist/story/server.d.ts +11 -21
- package/dist/story/setup.d.ts +15 -23
- package/dist/story/testing.d.ts +40 -65
- package/dist/story/types.d.ts +160 -262
- package/dist/streaming.d.ts +57 -119
- package/dist/strip-literals.d.ts +1 -25
- package/dist/stx-module-imports.d.ts +7 -0
- package/dist/stx-virtual-ts.d.ts +102 -253
- package/dist/style-scoping.d.ts +8 -21
- package/dist/suspense.d.ts +52 -67
- package/dist/teleport.d.ts +0 -22
- package/dist/template-syntax-escape.d.ts +8 -8
- package/dist/template-tag-balance.d.ts +6 -22
- package/dist/testing.d.ts +26 -11
- package/dist/theme-tokens.d.ts +388 -134
- package/dist/transitions.d.ts +55 -66
- package/dist/ts-css-config.d.ts +12 -70
- package/dist/types/component-types.d.ts +122 -187
- package/dist/types/config-types.d.ts +341 -956
- package/dist/types/context-types.d.ts +24 -46
- package/dist/types/csp-types.d.ts +66 -70
- package/dist/types/directive-types.d.ts +156 -223
- package/dist/types/index.d.ts +110 -6
- package/dist/types/pwa-types.d.ts +148 -273
- package/dist/types.d.ts +1 -0
- package/dist/unresolved-identifiers.d.ts +22 -24
- package/dist/url-safety.d.ts +32 -32
- package/dist/utils.d.ts +21 -36
- package/dist/validator.d.ts +26 -28
- package/dist/variable-extractor.d.ts +19 -49
- package/dist/view-composers.d.ts +81 -80
- package/dist/virtual-scrolling.d.ts +82 -101
- package/dist/visual-testing.d.ts +10 -9
- package/dist/vue-template.d.ts +0 -23
- package/dist/web-components/css-scoping.d.ts +11 -21
- package/dist/web-components.d.ts +58 -81
- package/dist/x-element.d.ts +1 -0
- package/package.json +6 -6
- package/stx.d.ts +2 -2
- package/dist/app-service-worker.d.ts +0 -165
- package/dist/chunk-49gwmcrn.js +0 -2
- package/dist/chunk-6va5pe2m.js +0 -2
- package/dist/chunk-bm2q1srp.js +0 -2
- package/dist/signals-context-runtime.d.ts +0 -2
- package/dist/signals-drawer-runtime.d.ts +0 -2
- package/dist/signals-host-runtime.d.ts +0 -9
- package/dist/signals-loop-conditional-runtime.d.ts +0 -2
- package/dist/signals-manifest-hydration-runtime.d.ts +0 -2
- package/dist/signals-notify-runtime.d.ts +0 -2
- package/dist/signals-optimistic-runtime.d.ts +0 -2
- package/dist/signals-overlay-runtime.d.ts +0 -2
- package/dist/signals-scope-disposal-runtime.d.ts +0 -2
- package/dist/signals-spa-load-control-runtime.d.ts +0 -2
- package/dist/signals-storage-runtime.d.ts +0 -2
|
@@ -1,338 +1,213 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progressive Web App (PWA) Types
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* PWA caching strategy for service worker routes
|
|
6
|
-
*/
|
|
7
|
-
export type PwaCacheStrategy = 'cache-first' | 'network-first' | 'stale-while-revalidate' | 'network-only' | 'cache-only';
|
|
8
1
|
/**
|
|
9
2
|
* PWA route cache configuration
|
|
10
3
|
* Defines how specific routes should be cached by the service worker
|
|
11
4
|
*/
|
|
12
|
-
export interface PwaRouteCache {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
cacheName?: string;
|
|
19
|
-
/** Cache expiration in seconds */
|
|
20
|
-
maxAgeSeconds?: number;
|
|
21
|
-
/** Maximum number of entries in cache */
|
|
22
|
-
maxEntries?: number;
|
|
5
|
+
export declare interface PwaRouteCache {
|
|
6
|
+
pattern: string
|
|
7
|
+
strategy: PwaCacheStrategy
|
|
8
|
+
cacheName?: string
|
|
9
|
+
maxAgeSeconds?: number
|
|
10
|
+
maxEntries?: number
|
|
23
11
|
}
|
|
24
12
|
/**
|
|
25
13
|
* PWA icon configuration for automatic generation
|
|
26
14
|
*/
|
|
27
|
-
export interface PwaIconConfig {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/** Generate Apple touch icon variants */
|
|
35
|
-
generateAppleIcons?: boolean;
|
|
36
|
-
/** Output directory for generated icons (relative to output dir) */
|
|
37
|
-
outputDir?: string;
|
|
38
|
-
/** Icon purpose for manifest ('any', 'maskable', 'monochrome') */
|
|
39
|
-
purpose?: ('any' | 'maskable' | 'monochrome')[];
|
|
15
|
+
export declare interface PwaIconConfig {
|
|
16
|
+
src: string
|
|
17
|
+
sizes?: number[]
|
|
18
|
+
generateWebP?: boolean
|
|
19
|
+
generateAppleIcons?: boolean
|
|
20
|
+
outputDir?: string
|
|
21
|
+
purpose?: ('any' | 'maskable' | 'monochrome')[]
|
|
40
22
|
}
|
|
41
23
|
/**
|
|
42
24
|
* PWA shortcut definition for app shortcuts menu
|
|
43
25
|
*/
|
|
44
|
-
export interface PwaShortcut {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
description?: string;
|
|
51
|
-
/** URL to navigate to */
|
|
52
|
-
url: string;
|
|
53
|
-
/** Icons for the shortcut */
|
|
54
|
-
icons?: Array<{
|
|
55
|
-
src: string;
|
|
56
|
-
sizes: string;
|
|
57
|
-
type?: string;
|
|
58
|
-
}>;
|
|
26
|
+
export declare interface PwaShortcut {
|
|
27
|
+
name: string
|
|
28
|
+
shortName?: string
|
|
29
|
+
description?: string
|
|
30
|
+
url: string
|
|
31
|
+
icons?: Array<{ src: string, sizes: string, type?: string }>
|
|
59
32
|
}
|
|
60
33
|
/**
|
|
61
34
|
* PWA screenshot definition for app store listings
|
|
62
35
|
*/
|
|
63
|
-
export interface PwaScreenshot {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
type?: string;
|
|
70
|
-
/** Screenshot label/description */
|
|
71
|
-
label?: string;
|
|
72
|
-
/** Platform: 'wide' for desktop, 'narrow' for mobile */
|
|
73
|
-
platform?: 'wide' | 'narrow';
|
|
36
|
+
export declare interface PwaScreenshot {
|
|
37
|
+
src: string
|
|
38
|
+
sizes: string
|
|
39
|
+
type?: string
|
|
40
|
+
label?: string
|
|
41
|
+
platform?: 'wide' | 'narrow'
|
|
74
42
|
}
|
|
75
43
|
/**
|
|
76
44
|
* PWA Web App Manifest configuration
|
|
77
45
|
*/
|
|
78
|
-
export interface PwaManifestConfig {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/** Text direction */
|
|
102
|
-
dir?: 'ltr' | 'rtl' | 'auto';
|
|
103
|
-
/** Unique app ID */
|
|
104
|
-
id?: string;
|
|
105
|
-
/** App categories for store listings */
|
|
106
|
-
categories?: string[];
|
|
107
|
-
/** App shortcuts for quick actions */
|
|
108
|
-
shortcuts?: PwaShortcut[];
|
|
109
|
-
/** Screenshots for app store listings */
|
|
110
|
-
screenshots?: PwaScreenshot[];
|
|
111
|
-
/** Launch handler behavior */
|
|
112
|
-
launchHandler?: 'auto' | 'focus-existing' | 'navigate-new' | 'navigate-existing';
|
|
113
|
-
/** How to handle links */
|
|
114
|
-
handleLinks?: 'auto' | 'preferred' | 'not-preferred';
|
|
115
|
-
/** Edge side panel configuration */
|
|
116
|
-
edgeSidePanel?: {
|
|
117
|
-
enabled: boolean;
|
|
118
|
-
preferredWidth?: number;
|
|
119
|
-
};
|
|
46
|
+
export declare interface PwaManifestConfig {
|
|
47
|
+
name: string
|
|
48
|
+
shortName?: string
|
|
49
|
+
description?: string
|
|
50
|
+
startUrl?: string
|
|
51
|
+
display?: 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser'
|
|
52
|
+
displayOverride?: string[]
|
|
53
|
+
orientation?: 'portrait' | 'landscape' | 'any' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary'
|
|
54
|
+
themeColor?: string
|
|
55
|
+
backgroundColor?: string
|
|
56
|
+
scope?: string
|
|
57
|
+
lang?: string
|
|
58
|
+
dir?: 'ltr' | 'rtl' | 'auto'
|
|
59
|
+
id?: string
|
|
60
|
+
categories?: string[]
|
|
61
|
+
shortcuts?: PwaShortcut[]
|
|
62
|
+
screenshots?: PwaScreenshot[]
|
|
63
|
+
launchHandler?: 'auto' | 'focus-existing' | 'navigate-new' | 'navigate-existing'
|
|
64
|
+
handleLinks?: 'auto' | 'preferred' | 'not-preferred'
|
|
65
|
+
edgeSidePanel?: {
|
|
66
|
+
enabled: boolean
|
|
67
|
+
preferredWidth?: number
|
|
68
|
+
}
|
|
120
69
|
}
|
|
121
70
|
/**
|
|
122
71
|
* PWA offline fallback page configuration
|
|
123
72
|
*/
|
|
124
|
-
export interface PwaOfflineConfig {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
fallbackTitle?: string;
|
|
131
|
-
/** Fallback message when offline */
|
|
132
|
-
fallbackMessage?: string;
|
|
133
|
-
/** Additional assets to precache for offline access */
|
|
134
|
-
precacheAssets?: string[];
|
|
73
|
+
export declare interface PwaOfflineConfig {
|
|
74
|
+
enabled: boolean
|
|
75
|
+
page?: string
|
|
76
|
+
fallbackTitle?: string
|
|
77
|
+
fallbackMessage?: string
|
|
78
|
+
precacheAssets?: string[]
|
|
135
79
|
}
|
|
136
80
|
/**
|
|
137
81
|
* Service worker configuration
|
|
138
82
|
*/
|
|
139
|
-
export interface PwaServiceWorkerConfig {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
/** Enable navigation preload */
|
|
149
|
-
navigationPreload?: boolean;
|
|
150
|
-
/** Routes to exclude from caching (glob patterns) */
|
|
151
|
-
excludeRoutes?: string[];
|
|
152
|
-
/** File types to cache (extensions without dot) */
|
|
153
|
-
cacheFileTypes?: string[];
|
|
154
|
-
/** Use Workbox library instead of custom SW (requires workbox-* packages) */
|
|
155
|
-
useWorkbox?: boolean;
|
|
83
|
+
export declare interface PwaServiceWorkerConfig {
|
|
84
|
+
fileName?: string
|
|
85
|
+
cacheVersion?: string
|
|
86
|
+
skipWaiting?: boolean
|
|
87
|
+
clientsClaim?: boolean
|
|
88
|
+
navigationPreload?: boolean
|
|
89
|
+
excludeRoutes?: string[]
|
|
90
|
+
cacheFileTypes?: string[]
|
|
91
|
+
useWorkbox?: boolean
|
|
156
92
|
}
|
|
157
93
|
/**
|
|
158
94
|
* Push notification configuration
|
|
159
95
|
*/
|
|
160
|
-
export interface PwaPushConfig {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
defaultBadge?: string;
|
|
171
|
-
/** Default notification options */
|
|
172
|
-
defaultOptions?: {
|
|
173
|
-
/** Enable vibration */
|
|
174
|
-
vibrate?: number[];
|
|
175
|
-
/** Require interaction to dismiss */
|
|
176
|
-
requireInteraction?: boolean;
|
|
177
|
-
};
|
|
96
|
+
export declare interface PwaPushConfig {
|
|
97
|
+
enabled: boolean
|
|
98
|
+
vapidPublicKey?: string
|
|
99
|
+
subscriptionEndpoint?: string
|
|
100
|
+
defaultIcon?: string
|
|
101
|
+
defaultBadge?: string
|
|
102
|
+
defaultOptions?: {
|
|
103
|
+
vibrate?: number[]
|
|
104
|
+
requireInteraction?: boolean
|
|
105
|
+
}
|
|
178
106
|
}
|
|
179
107
|
/**
|
|
180
108
|
* Background sync configuration
|
|
181
109
|
*/
|
|
182
|
-
export interface PwaBackgroundSyncConfig {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
maxRetries?: number;
|
|
191
|
-
/** Minimum interval between retries in ms */
|
|
192
|
-
minInterval?: number;
|
|
193
|
-
/** Forms to enable background sync for (CSS selectors) */
|
|
194
|
-
forms?: string[];
|
|
195
|
-
/** API endpoints to queue when offline */
|
|
196
|
-
endpoints?: string[];
|
|
110
|
+
export declare interface PwaBackgroundSyncConfig {
|
|
111
|
+
enabled: boolean
|
|
112
|
+
queueName?: string
|
|
113
|
+
maxRetentionMinutes?: number
|
|
114
|
+
maxRetries?: number
|
|
115
|
+
minInterval?: number
|
|
116
|
+
forms?: string[]
|
|
117
|
+
endpoints?: string[]
|
|
197
118
|
}
|
|
198
119
|
/**
|
|
199
120
|
* Share target configuration for receiving shared content
|
|
200
121
|
*/
|
|
201
|
-
export interface PwaShareTargetConfig {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
text?: string;
|
|
216
|
-
/** Parameter name for shared URL */
|
|
217
|
-
url?: string;
|
|
218
|
-
};
|
|
219
|
-
/** Accept file types for sharing */
|
|
220
|
-
acceptFiles?: Array<{
|
|
221
|
-
name: string;
|
|
222
|
-
accept: string[];
|
|
223
|
-
}>;
|
|
122
|
+
export declare interface PwaShareTargetConfig {
|
|
123
|
+
enabled: boolean
|
|
124
|
+
action: string
|
|
125
|
+
method?: 'GET' | 'POST'
|
|
126
|
+
enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data'
|
|
127
|
+
params?: {
|
|
128
|
+
title?: string
|
|
129
|
+
text?: string
|
|
130
|
+
url?: string
|
|
131
|
+
}
|
|
132
|
+
acceptFiles?: Array<{
|
|
133
|
+
name: string
|
|
134
|
+
accept: string[]
|
|
135
|
+
}>
|
|
224
136
|
}
|
|
225
137
|
/**
|
|
226
138
|
* File handler configuration for handling specific file types
|
|
227
139
|
*/
|
|
228
|
-
export interface PwaFileHandlerConfig {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
accept?: Record<string, string[]>;
|
|
235
|
-
/** Launch type */
|
|
236
|
-
launchType?: 'single-client' | 'multiple-clients';
|
|
237
|
-
/** Icons for file handler */
|
|
238
|
-
icons?: Array<{
|
|
239
|
-
src: string;
|
|
240
|
-
sizes: string;
|
|
241
|
-
type: string;
|
|
242
|
-
}>;
|
|
140
|
+
export declare interface PwaFileHandlerConfig {
|
|
141
|
+
enabled: boolean
|
|
142
|
+
action?: string
|
|
143
|
+
accept?: Record<string, string[]>
|
|
144
|
+
launchType?: 'single-client' | 'multiple-clients'
|
|
145
|
+
icons?: Array<{ src: string, sizes: string, type: string }>
|
|
243
146
|
}
|
|
244
147
|
/**
|
|
245
148
|
* Protocol handler configuration
|
|
246
149
|
*/
|
|
247
|
-
export interface PwaProtocolHandlerConfig {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
/** URL to handle the protocol */
|
|
251
|
-
url: string;
|
|
150
|
+
export declare interface PwaProtocolHandlerConfig {
|
|
151
|
+
protocol: string
|
|
152
|
+
url: string
|
|
252
153
|
}
|
|
253
154
|
/**
|
|
254
155
|
* Cache storage limits configuration
|
|
255
156
|
*/
|
|
256
|
-
export interface PwaCacheStorageConfig {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
/** Maximum age of cached items in days */
|
|
262
|
-
maxAge?: number;
|
|
263
|
-
/** Purge strategy when limits exceeded */
|
|
264
|
-
purgeStrategy?: 'lru' | 'fifo' | 'lfu';
|
|
157
|
+
export declare interface PwaCacheStorageConfig {
|
|
158
|
+
maxSize?: number
|
|
159
|
+
maxEntries?: number
|
|
160
|
+
maxAge?: number
|
|
161
|
+
purgeStrategy?: 'lru' | 'fifo' | 'lfu'
|
|
265
162
|
}
|
|
266
163
|
/**
|
|
267
164
|
* Update notification configuration
|
|
268
165
|
*/
|
|
269
|
-
export interface PwaUpdateConfig {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
autoReload?: boolean;
|
|
276
|
-
/** Custom update notification message */
|
|
277
|
-
message?: string;
|
|
278
|
-
/** Selector for custom update UI element */
|
|
279
|
-
uiSelector?: string;
|
|
166
|
+
export declare interface PwaUpdateConfig {
|
|
167
|
+
enabled: boolean
|
|
168
|
+
promptUser?: boolean
|
|
169
|
+
autoReload?: boolean
|
|
170
|
+
message?: string
|
|
171
|
+
uiSelector?: string
|
|
280
172
|
}
|
|
281
173
|
/**
|
|
282
174
|
* Auto-precaching configuration
|
|
283
175
|
*/
|
|
284
|
-
export interface PwaPrecacheConfig {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
includeImages?: boolean;
|
|
295
|
-
/** Include fonts */
|
|
296
|
-
includeFonts?: boolean;
|
|
297
|
-
/** Additional glob patterns to include */
|
|
298
|
-
include?: string[];
|
|
299
|
-
/** Glob patterns to exclude */
|
|
300
|
-
exclude?: string[];
|
|
301
|
-
/** Maximum file size to precache (in KB) */
|
|
302
|
-
maxFileSizeKB?: number;
|
|
176
|
+
export declare interface PwaPrecacheConfig {
|
|
177
|
+
enabled: boolean
|
|
178
|
+
includeHtml?: boolean
|
|
179
|
+
includeJs?: boolean
|
|
180
|
+
includeCss?: boolean
|
|
181
|
+
includeImages?: boolean
|
|
182
|
+
includeFonts?: boolean
|
|
183
|
+
include?: string[]
|
|
184
|
+
exclude?: string[]
|
|
185
|
+
maxFileSizeKB?: number
|
|
303
186
|
}
|
|
304
187
|
/**
|
|
305
188
|
* Complete PWA configuration
|
|
306
189
|
*/
|
|
307
|
-
export interface PwaConfig {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
push?: PwaPushConfig;
|
|
324
|
-
/** Background sync configuration */
|
|
325
|
-
backgroundSync?: PwaBackgroundSyncConfig;
|
|
326
|
-
/** Share target configuration */
|
|
327
|
-
shareTarget?: PwaShareTargetConfig;
|
|
328
|
-
/** File handler configuration */
|
|
329
|
-
fileHandlers?: PwaFileHandlerConfig;
|
|
330
|
-
/** Protocol handlers */
|
|
331
|
-
protocolHandlers?: PwaProtocolHandlerConfig[];
|
|
332
|
-
/** Cache storage limits */
|
|
333
|
-
cacheStorage?: PwaCacheStorageConfig;
|
|
334
|
-
/** Update notification configuration */
|
|
335
|
-
updates?: PwaUpdateConfig;
|
|
336
|
-
/** Auto-precaching configuration */
|
|
337
|
-
precache?: PwaPrecacheConfig;
|
|
190
|
+
export declare interface PwaConfig {
|
|
191
|
+
enabled: boolean
|
|
192
|
+
manifest: PwaManifestConfig
|
|
193
|
+
icons?: PwaIconConfig
|
|
194
|
+
routes?: PwaRouteCache[]
|
|
195
|
+
offline?: PwaOfflineConfig
|
|
196
|
+
serviceWorker?: PwaServiceWorkerConfig
|
|
197
|
+
autoInject?: boolean
|
|
198
|
+
push?: PwaPushConfig
|
|
199
|
+
backgroundSync?: PwaBackgroundSyncConfig
|
|
200
|
+
shareTarget?: PwaShareTargetConfig
|
|
201
|
+
fileHandlers?: PwaFileHandlerConfig
|
|
202
|
+
protocolHandlers?: PwaProtocolHandlerConfig[]
|
|
203
|
+
cacheStorage?: PwaCacheStorageConfig
|
|
204
|
+
updates?: PwaUpdateConfig
|
|
205
|
+
precache?: PwaPrecacheConfig
|
|
338
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Progressive Web App (PWA) Types
|
|
209
|
+
*/
|
|
210
|
+
/**
|
|
211
|
+
* PWA caching strategy for service worker routes
|
|
212
|
+
*/
|
|
213
|
+
export type PwaCacheStrategy = 'cache-first' | 'network-first' | 'stale-while-revalidate' | 'network-only' | 'cache-only';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find identifiers a script CALLS that resolve to nothing in the browser.
|
|
3
|
+
*
|
|
4
|
+
* Restricted to names we can name a cause for — exports of `composables/` with
|
|
5
|
+
* no runtime counterpart. A broader "looks like a hook and is not in scope"
|
|
6
|
+
* heuristic would fire on legitimate local helpers and app composables, and a
|
|
7
|
+
* warning people learn to ignore is worse than no warning.
|
|
8
|
+
*
|
|
9
|
+
* @param source the script body, after imports have been transformed
|
|
10
|
+
* @param provided names already in scope (runtime globals, locals, imports)
|
|
11
|
+
*/
|
|
12
|
+
export declare function findUnresolvedIdentifiers(source: string, provided: Iterable<string>): UnresolvedIdentifier[];
|
|
13
|
+
/**
|
|
14
|
+
* Report unresolved identifiers against a file, once each.
|
|
15
|
+
*
|
|
16
|
+
* Returns the diagnostics so callers can assert on them without capturing
|
|
17
|
+
* console output.
|
|
18
|
+
*/
|
|
19
|
+
export declare function reportUnresolvedIdentifiers(source: string, provided: Iterable<string>, filePath: string): UnresolvedIdentifier[];
|
|
1
20
|
/**
|
|
2
21
|
* Diagnose an identifier a client script calls that will not exist in the browser.
|
|
3
22
|
*
|
|
@@ -25,28 +44,7 @@
|
|
|
25
44
|
* the auto-import list did (#1804).
|
|
26
45
|
*/
|
|
27
46
|
export declare const SERVER_ONLY_COMPOSABLES: readonly string[];
|
|
28
|
-
export interface UnresolvedIdentifier {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/** Human-readable explanation, including the fix. */
|
|
32
|
-
message: string;
|
|
47
|
+
export declare interface UnresolvedIdentifier {
|
|
48
|
+
name: string
|
|
49
|
+
message: string
|
|
33
50
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Find identifiers a script CALLS that resolve to nothing in the browser.
|
|
36
|
-
*
|
|
37
|
-
* Restricted to names we can name a cause for — exports of `composables/` with
|
|
38
|
-
* no runtime counterpart. A broader "looks like a hook and is not in scope"
|
|
39
|
-
* heuristic would fire on legitimate local helpers and app composables, and a
|
|
40
|
-
* warning people learn to ignore is worse than no warning.
|
|
41
|
-
*
|
|
42
|
-
* @param source the script body, after imports have been transformed
|
|
43
|
-
* @param provided names already in scope (runtime globals, locals, imports)
|
|
44
|
-
*/
|
|
45
|
-
export declare function findUnresolvedIdentifiers(source: string, provided: Iterable<string>): UnresolvedIdentifier[];
|
|
46
|
-
/**
|
|
47
|
-
* Report unresolved identifiers against a file, once each.
|
|
48
|
-
*
|
|
49
|
-
* Returns the diagnostics so callers can assert on them without capturing
|
|
50
|
-
* console output.
|
|
51
|
-
*/
|
|
52
|
-
export declare function reportUnresolvedIdentifiers(source: string, provided: Iterable<string>, filePath: string): UnresolvedIdentifier[];
|
package/dist/url-safety.d.ts
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A substituted value cannot introduce a URL scheme the page did not ask for.
|
|
3
|
-
*
|
|
4
|
-
* `{{ }}` escapes HTML, which stops a value closing its attribute or opening a
|
|
5
|
-
* tag -- and says nothing about what the attribute means. `javascript:alert(1)`
|
|
6
|
-
* contains no character escaping touches, so
|
|
7
|
-
* `<a href="{{ url }}">` with a stored URL ran script on click, from a value a
|
|
8
|
-
* person typed. The same goes for `vbscript:` (old Edge, still shipped in
|
|
9
|
-
* Windows-embedded browsers) and for `data:text/html`, which navigates to a
|
|
10
|
-
* document the attacker wrote, on the page's own origin in some browsers.
|
|
11
|
-
*
|
|
12
|
-
* What is *not* here matters as much:
|
|
13
|
-
*
|
|
14
|
-
* - **Only the scheme position.** `href="/search?q={{ term }}"` is left alone:
|
|
15
|
-
* a scheme can only be at the start of a URL, so a value substituted after
|
|
16
|
-
* anything else cannot introduce one.
|
|
17
|
-
* - **Only URL attributes.** `title="{{ text }}"` keeps every byte. A value is
|
|
18
|
-
* rewritten only where the browser would resolve it as a URL.
|
|
19
|
-
* - **`{!! !!}` is untouched**, as it is for HTML: the raw form is how a
|
|
20
|
-
* template says it vouches for the value, and a sanitizer with no way out is
|
|
21
|
-
* one people work around.
|
|
22
|
-
* - **`data:image/...` still loads**, which `<StxImage>`'s own blur placeholder
|
|
23
|
-
* needs; only the data URLs that carry a document are refused.
|
|
24
|
-
*
|
|
25
|
-
* Refused values are prefixed rather than emptied, the way Angular does it: the
|
|
26
|
-
* value stays visible in the DOM and in view-source, so the person debugging it
|
|
27
|
-
* sees what was blocked instead of an attribute that mysteriously went away,
|
|
28
|
-
* and `unsafe:javascript:alert(1)` is an unknown scheme, so a click does
|
|
29
|
-
* nothing.
|
|
30
|
-
*/
|
|
31
|
-
/** What a refused value is rewritten to, so it is inert but still readable. */
|
|
32
|
-
export declare const UNSAFE_URL_PREFIX = "unsafe:";
|
|
33
1
|
/** Which policy an attribute name gets, or null when it holds no URL. */
|
|
34
2
|
export declare function urlAttributeKind(name: string): 'navigable' | 'fetched' | null;
|
|
35
3
|
/** Whether this value would introduce a scheme the attribute must not follow. */
|
|
@@ -65,3 +33,35 @@ export declare function schemeWindow(output: string, offset: number, span?: numb
|
|
|
65
33
|
* the browser will resolve rather than what the HTML escape happened to leave.
|
|
66
34
|
*/
|
|
67
35
|
export declare function sanitizeSubstitutedUrl(before: string, raw: string, escaped?: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* A substituted value cannot introduce a URL scheme the page did not ask for.
|
|
38
|
+
*
|
|
39
|
+
* `{{ }}` escapes HTML, which stops a value closing its attribute or opening a
|
|
40
|
+
* tag -- and says nothing about what the attribute means. `javascript:alert(1)`
|
|
41
|
+
* contains no character escaping touches, so
|
|
42
|
+
* `<a href="{{ url }}">` with a stored URL ran script on click, from a value a
|
|
43
|
+
* person typed. The same goes for `vbscript:` (old Edge, still shipped in
|
|
44
|
+
* Windows-embedded browsers) and for `data:text/html`, which navigates to a
|
|
45
|
+
* document the attacker wrote, on the page's own origin in some browsers.
|
|
46
|
+
*
|
|
47
|
+
* What is *not* here matters as much:
|
|
48
|
+
*
|
|
49
|
+
* - **Only the scheme position.** `href="/search?q={{ term }}"` is left alone:
|
|
50
|
+
* a scheme can only be at the start of a URL, so a value substituted after
|
|
51
|
+
* anything else cannot introduce one.
|
|
52
|
+
* - **Only URL attributes.** `title="{{ text }}"` keeps every byte. A value is
|
|
53
|
+
* rewritten only where the browser would resolve it as a URL.
|
|
54
|
+
* - **`{!! !!}` is untouched**, as it is for HTML: the raw form is how a
|
|
55
|
+
* template says it vouches for the value, and a sanitizer with no way out is
|
|
56
|
+
* one people work around.
|
|
57
|
+
* - **`data:image/...` still loads**, which `<StxImage>`'s own blur placeholder
|
|
58
|
+
* needs; only the data URLs that carry a document are refused.
|
|
59
|
+
*
|
|
60
|
+
* Refused values are prefixed rather than emptied, the way Angular does it: the
|
|
61
|
+
* value stays visible in the DOM and in view-source, so the person debugging it
|
|
62
|
+
* sees what was blocked instead of an attribute that mysteriously went away,
|
|
63
|
+
* and `unsafe:javascript:alert(1)` is an unknown scheme, so a click does
|
|
64
|
+
* nothing.
|
|
65
|
+
*/
|
|
66
|
+
/** What a refused value is rewritten to, so it is inert but still readable. */
|
|
67
|
+
export declare const UNSAFE_URL_PREFIX: 'unsafe:';
|