@vizejs/composable 0.426.3 → 0.428.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abort-signal.d.mts +1 -1
- package/dist/active-element.d.mts +37 -0
- package/dist/active-element.mjs +56 -0
- package/dist/animate.d.mts +114 -0
- package/dist/animate.mjs +157 -0
- package/dist/battery.d.mts +61 -0
- package/dist/battery.mjs +90 -0
- package/dist/breakpoints.d.mts +82 -0
- package/dist/breakpoints.mjs +91 -0
- package/dist/catalog-BeTXFKxF.d.mts +4188 -0
- package/dist/catalog-r4Z5nptX.mjs +5144 -0
- package/dist/catalog.d.mts +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/color-mode.d.mts +131 -0
- package/dist/color-mode.mjs +133 -0
- package/dist/computed-async.d.mts +63 -0
- package/dist/computed-async.mjs +43 -0
- package/dist/computed-with-control.d.mts +44 -0
- package/dist/computed-with-control.mjs +54 -0
- package/dist/create-event-hook.d.mts +77 -0
- package/dist/create-event-hook.mjs +66 -0
- package/dist/create-global-state.d.mts +24 -0
- package/dist/create-global-state.mjs +34 -0
- package/dist/create-injection-state.d.mts +51 -0
- package/dist/create-injection-state.mjs +19 -0
- package/dist/create-shared-composable.d.mts +38 -0
- package/dist/create-shared-composable.mjs +54 -0
- package/dist/device-motion.d.mts +71 -0
- package/dist/device-motion.mjs +75 -0
- package/dist/device-orientation.d.mts +82 -0
- package/dist/device-orientation.mjs +86 -0
- package/dist/device-pixel-ratio.d.mts +45 -0
- package/dist/device-pixel-ratio.mjs +50 -0
- package/dist/document-visibility.mjs +6 -2
- package/dist/draggable.d.mts +121 -0
- package/dist/draggable.mjs +153 -0
- package/dist/element-bounding.d.mts +87 -0
- package/dist/element-bounding.mjs +95 -0
- package/dist/element-by-point.d.mts +70 -0
- package/dist/element-by-point.mjs +69 -0
- package/dist/element-hover.d.mts +42 -0
- package/dist/element-hover.mjs +70 -0
- package/dist/element-ref.d.mts +34 -0
- package/dist/element-ref.mjs +23 -0
- package/dist/element-target-Crpxl4D9.d.mts +60 -0
- package/dist/element-target.d.mts +2 -0
- package/dist/element-target.mjs +58 -0
- package/dist/event-listener.mjs +7 -3
- package/dist/focus.d.mts +69 -0
- package/dist/focus.mjs +124 -0
- package/dist/fps.d.mts +59 -0
- package/dist/fps.mjs +64 -0
- package/dist/geolocation.d.mts +98 -0
- package/dist/geolocation.mjs +86 -0
- package/dist/i18n.d.mts +237 -0
- package/dist/i18n.mjs +215 -0
- package/dist/icu-message.d.mts +235 -0
- package/dist/icu-message.mjs +343 -0
- package/dist/idle.d.mts +79 -0
- package/dist/idle.mjs +90 -0
- package/dist/index.d.mts +172 -6
- package/dist/index.mjs +173 -7
- package/dist/infinite-scroll.d.mts +56 -0
- package/dist/infinite-scroll.mjs +72 -0
- package/dist/intersection-observer.d.mts +122 -0
- package/dist/intersection-observer.mjs +117 -0
- package/dist/magic-keys.d.mts +121 -0
- package/dist/magic-keys.mjs +163 -0
- package/dist/math.d.mts +96 -0
- package/dist/math.mjs +84 -0
- package/dist/media-query.d.mts +3 -1
- package/dist/media-query.mjs +5 -3
- package/dist/mouse-in-element.d.mts +49 -0
- package/dist/mouse-in-element.mjs +66 -0
- package/dist/mouse.d.mts +77 -0
- package/dist/mouse.mjs +100 -0
- package/dist/mutation-observer.d.mts +98 -0
- package/dist/mutation-observer.mjs +69 -0
- package/dist/network.d.mts +96 -0
- package/dist/network.mjs +117 -0
- package/dist/on-click-outside.d.mts +69 -0
- package/dist/on-click-outside.mjs +115 -0
- package/dist/on-key-stroke.d.mts +71 -0
- package/dist/on-key-stroke.mjs +79 -0
- package/dist/on-long-press.d.mts +82 -0
- package/dist/on-long-press.mjs +105 -0
- package/dist/on-start-typing.d.mts +44 -0
- package/dist/on-start-typing.mjs +61 -0
- package/dist/page-leave.d.mts +26 -0
- package/dist/page-leave.mjs +40 -0
- package/dist/parent-element.d.mts +16 -0
- package/dist/parent-element.mjs +27 -0
- package/dist/pinch.d.mts +73 -0
- package/dist/pinch.mjs +138 -0
- package/dist/pointer-lock.d.mts +79 -0
- package/dist/pointer-lock.mjs +126 -0
- package/dist/pointer.d.mts +78 -0
- package/dist/pointer.mjs +95 -0
- package/dist/preferences.d.mts +55 -0
- package/dist/preferences.mjs +63 -0
- package/dist/preferred-languages.d.mts +43 -0
- package/dist/preferred-languages.mjs +44 -0
- package/dist/reactify.d.mts +28 -0
- package/dist/reactify.mjs +7 -0
- package/dist/ref-auto-reset.d.mts +47 -0
- package/dist/ref-auto-reset.mjs +70 -0
- package/dist/ref-debounced.d.mts +29 -0
- package/dist/ref-debounced.mjs +29 -0
- package/dist/ref-default.d.mts +27 -0
- package/dist/ref-default.mjs +33 -0
- package/dist/resize-observer.d.mts +96 -0
- package/dist/resize-observer.mjs +111 -0
- package/dist/resolver.d.mts +124 -0
- package/dist/resolver.mjs +138 -0
- package/dist/retry-async.d.mts +2 -2
- package/dist/retry-delay-DYsdq4SE.d.mts +73 -0
- package/dist/retry-delay.d.mts +1 -72
- package/dist/screen-orientation.d.mts +77 -0
- package/dist/screen-orientation.mjs +74 -0
- package/dist/scroll-lock.d.mts +37 -0
- package/dist/scroll-lock.mjs +50 -0
- package/dist/scroll.d.mts +158 -0
- package/dist/scroll.mjs +172 -0
- package/dist/standard-schema-DmNgFVK5.d.mts +107 -0
- package/dist/standard-schema.d.mts +2 -0
- package/dist/standard-schema.mjs +60 -0
- package/dist/swipe.d.mts +125 -0
- package/dist/swipe.mjs +225 -0
- package/dist/sync-ref.d.mts +80 -0
- package/dist/sync-ref.mjs +43 -0
- package/dist/text-selection.d.mts +46 -0
- package/dist/text-selection.mjs +62 -0
- package/dist/textarea-autosize.d.mts +58 -0
- package/dist/textarea-autosize.mjs +54 -0
- package/dist/timeout-scheduler-CI8RVLZs.d.mts +18 -0
- package/dist/timeout-scheduler.d.mts +1 -17
- package/dist/to-reactive.d.mts +26 -0
- package/dist/to-reactive.mjs +46 -0
- package/dist/transition.d.mts +125 -0
- package/dist/transition.mjs +266 -0
- package/dist/until.d.mts +177 -0
- package/dist/until.mjs +111 -0
- package/dist/use-array.d.mts +112 -0
- package/dist/use-array.mjs +90 -0
- package/dist/use-async-queue.d.mts +109 -0
- package/dist/use-async-queue.mjs +96 -0
- package/dist/use-async-state.d.mts +86 -0
- package/dist/use-async-state.mjs +41 -0
- package/dist/use-barcode-detector.d.mts +159 -0
- package/dist/use-barcode-detector.mjs +143 -0
- package/dist/use-bluetooth.d.mts +164 -0
- package/dist/use-bluetooth.mjs +183 -0
- package/dist/use-broadcast-channel.d.mts +115 -0
- package/dist/use-broadcast-channel.mjs +121 -0
- package/dist/use-builtin-ai.d.mts +342 -0
- package/dist/use-builtin-ai.mjs +261 -0
- package/dist/use-clipboard.d.mts +169 -0
- package/dist/use-clipboard.mjs +226 -0
- package/dist/use-compression-stream.d.mts +173 -0
- package/dist/use-compression-stream.mjs +166 -0
- package/dist/use-confirm-dialog.d.mts +70 -0
- package/dist/use-confirm-dialog.mjs +57 -0
- package/dist/use-contact-picker.d.mts +117 -0
- package/dist/use-contact-picker.mjs +103 -0
- package/dist/use-cookie.d.mts +196 -0
- package/dist/use-cookie.mjs +259 -0
- package/dist/use-countdown.d.mts +85 -0
- package/dist/use-countdown.mjs +74 -0
- package/dist/use-css-var.d.mts +96 -0
- package/dist/use-css-var.mjs +104 -0
- package/dist/use-cycle-list.d.mts +76 -0
- package/dist/use-cycle-list.mjs +39 -0
- package/dist/use-date-format.d.mts +103 -0
- package/dist/use-date-format.mjs +147 -0
- package/dist/use-date-time-format.d.mts +75 -0
- package/dist/use-date-time-format.mjs +53 -0
- package/dist/use-debounced.d.mts +1 -1
- package/dist/use-display-media.d.mts +62 -0
- package/dist/use-display-media.mjs +46 -0
- package/dist/use-display-names.d.mts +75 -0
- package/dist/use-display-names.mjs +52 -0
- package/dist/use-document-title.d.mts +88 -0
- package/dist/use-document-title.mjs +100 -0
- package/dist/use-drop-zone.d.mts +128 -0
- package/dist/use-drop-zone.mjs +154 -0
- package/dist/use-event-source.d.mts +184 -0
- package/dist/use-event-source.mjs +226 -0
- package/dist/use-eye-dropper.d.mts +79 -0
- package/dist/use-eye-dropper.mjs +68 -0
- package/dist/use-favicon.d.mts +78 -0
- package/dist/use-favicon.mjs +68 -0
- package/dist/use-fetch.d.mts +230 -0
- package/dist/use-fetch.mjs +263 -0
- package/dist/use-field.d.mts +107 -0
- package/dist/use-field.mjs +117 -0
- package/dist/use-file-dialog.d.mts +139 -0
- package/dist/use-file-dialog.mjs +101 -0
- package/dist/use-file-system-access.d.mts +184 -0
- package/dist/use-file-system-access.mjs +151 -0
- package/dist/use-form-field-props.d.mts +235 -0
- package/dist/use-form-field-props.mjs +164 -0
- package/dist/use-form.d.mts +324 -0
- package/dist/use-form.mjs +482 -0
- package/dist/use-fullscreen.d.mts +104 -0
- package/dist/use-fullscreen.mjs +95 -0
- package/dist/use-gamepad.d.mts +242 -0
- package/dist/use-gamepad.mjs +218 -0
- package/dist/use-hid.d.mts +160 -0
- package/dist/use-hid.mjs +156 -0
- package/dist/use-id-generator.d.mts +44 -0
- package/dist/use-id-generator.mjs +38 -0
- package/dist/use-image.d.mts +125 -0
- package/dist/use-image.mjs +109 -0
- package/dist/use-indexed-db.d.mts +207 -0
- package/dist/use-indexed-db.mjs +251 -0
- package/dist/use-interval-BA55gTHT.d.mts +140 -0
- package/dist/use-interval.d.mts +2 -0
- package/dist/use-interval.mjs +100 -0
- package/dist/use-list-format.d.mts +60 -0
- package/dist/use-list-format.mjs +40 -0
- package/dist/use-machine.d.mts +90 -0
- package/dist/use-machine.mjs +78 -0
- package/dist/use-map.d.mts +90 -0
- package/dist/use-map.mjs +70 -0
- package/dist/use-media-controls.d.mts +198 -0
- package/dist/use-media-controls.mjs +264 -0
- package/dist/use-memoize.d.mts +73 -0
- package/dist/use-memoize.mjs +28 -0
- package/dist/use-mounted.d.mts +24 -0
- package/dist/use-mounted.mjs +29 -0
- package/dist/use-navigation-api.d.mts +360 -0
- package/dist/use-navigation-api.mjs +231 -0
- package/dist/use-notification.d.mts +139 -0
- package/dist/use-notification.mjs +131 -0
- package/dist/use-now.d.mts +137 -0
- package/dist/use-now.mjs +44 -0
- package/dist/use-number-format.d.mts +73 -0
- package/dist/use-number-format.mjs +58 -0
- package/dist/use-object-url.d.mts +47 -0
- package/dist/use-object-url.mjs +54 -0
- package/dist/use-offset-pagination.d.mts +91 -0
- package/dist/use-offset-pagination.mjs +80 -0
- package/dist/use-payment-request.d.mts +239 -0
- package/dist/use-payment-request.mjs +206 -0
- package/dist/use-performance-observer.d.mts +285 -0
- package/dist/use-performance-observer.mjs +132 -0
- package/dist/use-permission.d.mts +99 -0
- package/dist/use-permission.mjs +92 -0
- package/dist/use-plural-rules.d.mts +79 -0
- package/dist/use-plural-rules.mjs +59 -0
- package/dist/use-push-subscription.d.mts +154 -0
- package/dist/use-push-subscription.mjs +146 -0
- package/dist/use-queue.d.mts +89 -0
- package/dist/use-queue.mjs +116 -0
- package/dist/use-raf-fn.d.mts +87 -0
- package/dist/use-raf-fn.mjs +99 -0
- package/dist/use-relative-time-format.d.mts +111 -0
- package/dist/use-relative-time-format.mjs +119 -0
- package/dist/use-request-idle-callback.d.mts +122 -0
- package/dist/use-request-idle-callback.mjs +147 -0
- package/dist/use-route-query.d.mts +149 -0
- package/dist/use-route-query.mjs +86 -0
- package/dist/use-scheduler-post-task.d.mts +156 -0
- package/dist/use-scheduler-post-task.mjs +182 -0
- package/dist/use-screen-details.d.mts +205 -0
- package/dist/use-screen-details.mjs +188 -0
- package/dist/use-script-tag.d.mts +162 -0
- package/dist/use-script-tag.mjs +171 -0
- package/dist/use-segmenter.d.mts +78 -0
- package/dist/use-segmenter.mjs +66 -0
- package/dist/use-selection.d.mts +125 -0
- package/dist/use-selection.mjs +77 -0
- package/dist/use-serial.d.mts +165 -0
- package/dist/use-serial.mjs +205 -0
- package/dist/use-service-worker.d.mts +177 -0
- package/dist/use-service-worker.mjs +178 -0
- package/dist/use-set.d.mts +96 -0
- package/dist/use-set.mjs +74 -0
- package/dist/use-share.d.mts +92 -0
- package/dist/use-share.mjs +99 -0
- package/dist/use-sorted-locale.d.mts +62 -0
- package/dist/use-sorted-locale.mjs +52 -0
- package/dist/use-sorted.d.mts +29 -0
- package/dist/use-sorted.mjs +14 -0
- package/dist/use-speech-recognition.d.mts +150 -0
- package/dist/use-speech-recognition.mjs +168 -0
- package/dist/use-speech-synthesis.d.mts +148 -0
- package/dist/use-speech-synthesis.mjs +152 -0
- package/dist/use-stack.d.mts +83 -0
- package/dist/use-stack.mjs +93 -0
- package/dist/use-stepper.d.mts +79 -0
- package/dist/use-stepper.mjs +52 -0
- package/dist/use-storage-estimate.d.mts +151 -0
- package/dist/use-storage-estimate.mjs +170 -0
- package/dist/use-storage.d.mts +214 -0
- package/dist/use-storage.mjs +415 -0
- package/dist/use-style-tag.d.mts +102 -0
- package/dist/use-style-tag.mjs +91 -0
- package/dist/use-supported.d.mts +23 -0
- package/dist/use-supported.mjs +26 -0
- package/dist/use-throttled.d.mts +1 -1
- package/dist/use-time-ago.d.mts +163 -0
- package/dist/use-time-ago.mjs +95 -0
- package/dist/use-timeout.d.mts +122 -0
- package/dist/use-timeout.mjs +65 -0
- package/dist/use-url-hash.d.mts +88 -0
- package/dist/use-url-hash.mjs +145 -0
- package/dist/use-url-search-params.d.mts +223 -0
- package/dist/use-url-search-params.mjs +295 -0
- package/dist/use-usb.d.mts +212 -0
- package/dist/use-usb.mjs +137 -0
- package/dist/use-user-activation.d.mts +83 -0
- package/dist/use-user-activation.mjs +113 -0
- package/dist/use-user-media.d.mts +194 -0
- package/dist/use-user-media.mjs +214 -0
- package/dist/use-v-model.d.mts +113 -0
- package/dist/use-v-model.mjs +40 -0
- package/dist/use-vibrate.d.mts +81 -0
- package/dist/use-vibrate.mjs +90 -0
- package/dist/use-view-transition.d.mts +106 -0
- package/dist/use-view-transition.mjs +101 -0
- package/dist/use-visual-viewport.d.mts +105 -0
- package/dist/use-visual-viewport.mjs +104 -0
- package/dist/use-wake-lock.d.mts +96 -0
- package/dist/use-wake-lock.mjs +106 -0
- package/dist/use-web-authn.d.mts +404 -0
- package/dist/use-web-authn.mjs +323 -0
- package/dist/use-web-locks.d.mts +180 -0
- package/dist/use-web-locks.mjs +136 -0
- package/dist/use-web-midi.d.mts +148 -0
- package/dist/use-web-midi.mjs +140 -0
- package/dist/use-web-vitals.d.mts +142 -0
- package/dist/use-web-vitals.mjs +248 -0
- package/dist/use-websocket.d.mts +218 -0
- package/dist/use-websocket.mjs +257 -0
- package/dist/use-worker-fn.d.mts +119 -0
- package/dist/use-worker-fn.mjs +162 -0
- package/dist/virtual-list.d.mts +105 -0
- package/dist/virtual-list.mjs +128 -0
- package/dist/watch-debounced.d.mts +84 -0
- package/dist/watch-debounced.mjs +84 -0
- package/dist/watch-ignorable.d.mts +47 -0
- package/dist/watch-ignorable.mjs +61 -0
- package/dist/watch-once.d.mts +29 -0
- package/dist/watch-once.mjs +10 -0
- package/dist/watch-pausable.d.mts +51 -0
- package/dist/watch-pausable.mjs +23 -0
- package/dist/watch-source.d.mts +29 -0
- package/dist/watch-source.mjs +1 -0
- package/dist/watch-throttled.d.mts +70 -0
- package/dist/watch-throttled.mjs +94 -0
- package/dist/whenever.d.mts +39 -0
- package/dist/whenever.mjs +41 -0
- package/dist/window-size.d.mts +87 -0
- package/dist/window-size.mjs +65 -0
- package/package.json +846 -5
- package/registry/files/abort-signal.ts +292 -0
- package/registry/files/active-element.ts +93 -0
- package/registry/files/animate.ts +322 -0
- package/registry/files/async-resource.ts +190 -0
- package/registry/files/battery.ts +166 -0
- package/registry/files/breakpoints.ts +166 -0
- package/registry/files/capability.ts +171 -0
- package/registry/files/color-mode.ts +274 -0
- package/registry/files/computed-async.ts +123 -0
- package/registry/files/computed-with-control.ts +80 -0
- package/registry/files/create-event-hook.ts +139 -0
- package/registry/files/create-global-state.ts +34 -0
- package/registry/files/create-injection-state.ts +75 -0
- package/registry/files/create-shared-composable.ts +74 -0
- package/registry/files/device-motion.ts +152 -0
- package/registry/files/device-orientation.ts +168 -0
- package/registry/files/device-pixel-ratio.ts +100 -0
- package/registry/files/disposal-scope.ts +201 -0
- package/registry/files/document-visibility.ts +152 -0
- package/registry/files/draggable.ts +273 -0
- package/registry/files/element-bounding.ts +175 -0
- package/registry/files/element-by-point.ts +149 -0
- package/registry/files/element-hover.ts +104 -0
- package/registry/files/element-ref.ts +58 -0
- package/registry/files/element-target.ts +99 -0
- package/registry/files/event-listener.ts +188 -0
- package/registry/files/focus.ts +181 -0
- package/registry/files/fps.ts +133 -0
- package/registry/files/geolocation.ts +214 -0
- package/registry/files/i18n.ts +524 -0
- package/registry/files/icu-message.ts +701 -0
- package/registry/files/idle.ts +176 -0
- package/registry/files/infinite-scroll.ts +135 -0
- package/registry/files/intersection-observer.ts +261 -0
- package/registry/files/locale.ts +148 -0
- package/registry/files/magic-keys.ts +298 -0
- package/registry/files/math.ts +175 -0
- package/registry/files/media-query.ts +102 -0
- package/registry/files/mouse-in-element.ts +107 -0
- package/registry/files/mouse.ts +167 -0
- package/registry/files/mutation-observer.ts +183 -0
- package/registry/files/network.ts +229 -0
- package/registry/files/on-click-outside.ts +178 -0
- package/registry/files/on-key-stroke.ts +135 -0
- package/registry/files/on-long-press.ts +188 -0
- package/registry/files/on-start-typing.ts +88 -0
- package/registry/files/page-leave.ts +57 -0
- package/registry/files/parent-element.ts +29 -0
- package/registry/files/pinch.ts +187 -0
- package/registry/files/pointer-lock.ts +232 -0
- package/registry/files/pointer.ts +153 -0
- package/registry/files/preferences.ts +98 -0
- package/registry/files/preferred-languages.ts +88 -0
- package/registry/files/reactify.ts +39 -0
- package/registry/files/ref-auto-reset.ts +102 -0
- package/registry/files/ref-debounced.ts +34 -0
- package/registry/files/ref-default.ts +35 -0
- package/registry/files/resize-observer.ts +220 -0
- package/registry/files/retry-async.ts +261 -0
- package/registry/files/retry-delay.ts +132 -0
- package/registry/files/scope.ts +21 -0
- package/registry/files/screen-orientation.ts +165 -0
- package/registry/files/scroll-lock.ts +80 -0
- package/registry/files/scroll.ts +338 -0
- package/registry/files/standard-schema.ts +163 -0
- package/registry/files/swipe.ts +321 -0
- package/registry/files/sync-ref.ts +166 -0
- package/registry/files/temporal.ts +182 -0
- package/registry/files/text-selection.ts +110 -0
- package/registry/files/textarea-autosize.ts +114 -0
- package/registry/files/timeout-scheduler.ts +16 -0
- package/registry/files/to-reactive.ts +44 -0
- package/registry/files/transition.ts +271 -0
- package/registry/files/until.ts +352 -0
- package/registry/files/use-array.ts +201 -0
- package/registry/files/use-async-queue.ts +278 -0
- package/registry/files/use-async-state.ts +139 -0
- package/registry/files/use-barcode-detector.ts +321 -0
- package/registry/files/use-bluetooth.ts +409 -0
- package/registry/files/use-broadcast-channel.ts +250 -0
- package/registry/files/use-builtin-ai.ts +674 -0
- package/registry/files/use-clipboard.ts +425 -0
- package/registry/files/use-compression-stream.ts +364 -0
- package/registry/files/use-confirm-dialog.ts +137 -0
- package/registry/files/use-contact-picker.ts +246 -0
- package/registry/files/use-cookie.ts +500 -0
- package/registry/files/use-countdown.ts +161 -0
- package/registry/files/use-counter.ts +147 -0
- package/registry/files/use-css-var.ts +191 -0
- package/registry/files/use-cycle-list.ts +136 -0
- package/registry/files/use-date-format.ts +281 -0
- package/registry/files/use-date-time-format.ts +113 -0
- package/registry/files/use-debounced.ts +163 -0
- package/registry/files/use-display-media.ts +89 -0
- package/registry/files/use-display-names.ts +122 -0
- package/registry/files/use-document-title.ts +196 -0
- package/registry/files/use-drop-zone.ts +287 -0
- package/registry/files/use-event-source.ts +470 -0
- package/registry/files/use-eye-dropper.ts +134 -0
- package/registry/files/use-favicon.ts +140 -0
- package/registry/files/use-fetch.ts +578 -0
- package/registry/files/use-field.ts +247 -0
- package/registry/files/use-file-dialog.ts +257 -0
- package/registry/files/use-file-system-access.ts +383 -0
- package/registry/files/use-form-field-props.ts +381 -0
- package/registry/files/use-form.ts +980 -0
- package/registry/files/use-fullscreen.ts +214 -0
- package/registry/files/use-gamepad.ts +463 -0
- package/registry/files/use-hid.ts +359 -0
- package/registry/files/use-history.ts +231 -0
- package/registry/files/use-id-generator.ts +61 -0
- package/registry/files/use-image.ts +253 -0
- package/registry/files/use-indexed-db.ts +508 -0
- package/registry/files/use-interval.ts +253 -0
- package/registry/files/use-list-format.ts +85 -0
- package/registry/files/use-machine.ts +171 -0
- package/registry/files/use-map.ts +145 -0
- package/registry/files/use-media-controls.ts +545 -0
- package/registry/files/use-memoize.ts +118 -0
- package/registry/files/use-mounted.ts +30 -0
- package/registry/files/use-navigation-api.ts +641 -0
- package/registry/files/use-notification.ts +285 -0
- package/registry/files/use-now.ts +194 -0
- package/registry/files/use-number-format.ts +120 -0
- package/registry/files/use-object-url.ts +87 -0
- package/registry/files/use-offset-pagination.ts +168 -0
- package/registry/files/use-payment-request.ts +465 -0
- package/registry/files/use-performance-observer.ts +469 -0
- package/registry/files/use-permission.ts +220 -0
- package/registry/files/use-plural-rules.ts +134 -0
- package/registry/files/use-previous.ts +62 -0
- package/registry/files/use-push-subscription.ts +352 -0
- package/registry/files/use-queue.ts +197 -0
- package/registry/files/use-raf-fn.ts +176 -0
- package/registry/files/use-relative-time-format.ts +201 -0
- package/registry/files/use-request-idle-callback.ts +278 -0
- package/registry/files/use-route-query.ts +300 -0
- package/registry/files/use-scheduler-post-task.ts +397 -0
- package/registry/files/use-screen-details.ts +393 -0
- package/registry/files/use-script-tag.ts +341 -0
- package/registry/files/use-segmenter.ts +147 -0
- package/registry/files/use-selection.ts +233 -0
- package/registry/files/use-serial.ts +404 -0
- package/registry/files/use-service-worker.ts +413 -0
- package/registry/files/use-set.ts +154 -0
- package/registry/files/use-share.ts +168 -0
- package/registry/files/use-sorted-locale.ts +130 -0
- package/registry/files/use-sorted.ts +49 -0
- package/registry/files/use-speech-recognition.ts +357 -0
- package/registry/files/use-speech-synthesis.ts +333 -0
- package/registry/files/use-stack.ts +164 -0
- package/registry/files/use-stepper.ts +166 -0
- package/registry/files/use-storage-estimate.ts +352 -0
- package/registry/files/use-storage.ts +635 -0
- package/registry/files/use-style-tag.ts +200 -0
- package/registry/files/use-supported.ts +26 -0
- package/registry/files/use-throttled.ts +215 -0
- package/registry/files/use-time-ago.ts +276 -0
- package/registry/files/use-timeout.ts +218 -0
- package/registry/files/use-toggle.ts +54 -0
- package/registry/files/use-url-hash.ts +280 -0
- package/registry/files/use-url-search-params.ts +497 -0
- package/registry/files/use-usb.ts +395 -0
- package/registry/files/use-user-activation.ts +215 -0
- package/registry/files/use-user-media.ts +422 -0
- package/registry/files/use-v-model.ts +210 -0
- package/registry/files/use-vibrate.ts +174 -0
- package/registry/files/use-view-transition.ts +229 -0
- package/registry/files/use-visual-viewport.ts +228 -0
- package/registry/files/use-wake-lock.ts +206 -0
- package/registry/files/use-web-authn.ts +793 -0
- package/registry/files/use-web-locks.ts +363 -0
- package/registry/files/use-web-midi.ts +306 -0
- package/registry/files/use-web-vitals.ts +409 -0
- package/registry/files/use-websocket.ts +553 -0
- package/registry/files/use-worker-fn.ts +306 -0
- package/registry/files/virtual-list.ts +230 -0
- package/registry/files/watch-debounced.ts +206 -0
- package/registry/files/watch-ignorable.ts +128 -0
- package/registry/files/watch-once.ts +46 -0
- package/registry/files/watch-pausable.ts +93 -0
- package/registry/files/watch-source.ts +51 -0
- package/registry/files/watch-throttled.ts +201 -0
- package/registry/files/whenever.ts +70 -0
- package/registry/files/window-size.ts +151 -0
- package/registry/registry.json +5792 -0
- package/dist/catalog-D2AL3xYl.d.mts +0 -523
- package/dist/catalog-D5SYCsgW.mjs +0 -549
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
hasInjectionContext,
|
|
4
|
+
readonly,
|
|
5
|
+
ref,
|
|
6
|
+
shallowRef,
|
|
7
|
+
toValue,
|
|
8
|
+
unref,
|
|
9
|
+
watchPostEffect,
|
|
10
|
+
} from "vue";
|
|
11
|
+
import type { ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
|
|
12
|
+
|
|
13
|
+
import { tryOnScopeDispose } from "./scope.ts";
|
|
14
|
+
|
|
15
|
+
/** User verification requirement of a WebAuthn ceremony. */
|
|
16
|
+
export type WebAuthnUserVerification = "required" | "preferred" | "discouraged";
|
|
17
|
+
|
|
18
|
+
/** Attestation conveyance preference of a registration ceremony. */
|
|
19
|
+
export type WebAuthnAttestation = "none" | "indirect" | "direct" | "enterprise";
|
|
20
|
+
|
|
21
|
+
/** Discoverable-credential (resident key) requirement. */
|
|
22
|
+
export type WebAuthnResidentKey = "discouraged" | "preferred" | "required";
|
|
23
|
+
|
|
24
|
+
/** Authenticator attachment modality. */
|
|
25
|
+
export type WebAuthnAuthenticatorAttachment = "platform" | "cross-platform";
|
|
26
|
+
|
|
27
|
+
/** Authenticator transport hint. */
|
|
28
|
+
export type WebAuthnTransport = "usb" | "nfc" | "ble" | "hybrid" | "internal";
|
|
29
|
+
|
|
30
|
+
/** Client hint about the authenticator the relying party expects. */
|
|
31
|
+
export type WebAuthnHint = "security-key" | "client-device" | "hybrid";
|
|
32
|
+
|
|
33
|
+
/** Credential mediation requirement; `"conditional"` powers passkey autofill. */
|
|
34
|
+
export type WebAuthnMediation = "silent" | "optional" | "conditional" | "required";
|
|
35
|
+
|
|
36
|
+
/** Credential descriptor in server JSON form. */
|
|
37
|
+
export interface PublicKeyCredentialDescriptorJSON {
|
|
38
|
+
/** Credential type. */
|
|
39
|
+
readonly type: "public-key";
|
|
40
|
+
/** Base64url-encoded credential id. */
|
|
41
|
+
readonly id: string;
|
|
42
|
+
/** Transports the credential is reachable through. */
|
|
43
|
+
readonly transports?: readonly WebAuthnTransport[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Credential descriptor in binary form. */
|
|
47
|
+
export interface WebAuthnCredentialDescriptor {
|
|
48
|
+
/** Credential type. */
|
|
49
|
+
type: "public-key";
|
|
50
|
+
/** Raw credential id. */
|
|
51
|
+
id: Uint8Array<ArrayBuffer>;
|
|
52
|
+
/** Transports the credential is reachable through. */
|
|
53
|
+
transports?: WebAuthnTransport[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Authenticator selection criteria of a registration ceremony. */
|
|
57
|
+
export interface WebAuthnAuthenticatorSelection {
|
|
58
|
+
/** Required attachment modality. */
|
|
59
|
+
authenticatorAttachment?: WebAuthnAuthenticatorAttachment;
|
|
60
|
+
/** Discoverable-credential requirement. */
|
|
61
|
+
residentKey?: WebAuthnResidentKey;
|
|
62
|
+
/** Legacy discoverable-credential flag. */
|
|
63
|
+
requireResidentKey?: boolean;
|
|
64
|
+
/** User verification requirement. */
|
|
65
|
+
userVerification?: WebAuthnUserVerification;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Relying party entity. */
|
|
69
|
+
export interface WebAuthnRelyingParty {
|
|
70
|
+
/** Relying party id (a registrable domain). */
|
|
71
|
+
id?: string;
|
|
72
|
+
/** Human-readable name. */
|
|
73
|
+
name: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Public-key algorithm parameter. */
|
|
77
|
+
export interface WebAuthnCredentialParameter {
|
|
78
|
+
/** Credential type. */
|
|
79
|
+
type: "public-key";
|
|
80
|
+
/** COSE algorithm identifier (for example -7 for ES256). */
|
|
81
|
+
alg: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** `PublicKeyCredentialCreationOptions` as serialized by a server (binary fields base64url). */
|
|
85
|
+
export interface PublicKeyCredentialCreationOptionsJSON {
|
|
86
|
+
/** Relying party. */
|
|
87
|
+
readonly rp: Readonly<WebAuthnRelyingParty>;
|
|
88
|
+
/** User account with a base64url-encoded `id`. */
|
|
89
|
+
readonly user: { readonly id: string; readonly name: string; readonly displayName: string };
|
|
90
|
+
/** Base64url-encoded challenge. */
|
|
91
|
+
readonly challenge: string;
|
|
92
|
+
/** Acceptable algorithms in preference order. */
|
|
93
|
+
readonly pubKeyCredParams: readonly Readonly<WebAuthnCredentialParameter>[];
|
|
94
|
+
/** Ceremony timeout in milliseconds. */
|
|
95
|
+
readonly timeout?: number;
|
|
96
|
+
/** Credentials that must not be re-registered. */
|
|
97
|
+
readonly excludeCredentials?: readonly PublicKeyCredentialDescriptorJSON[];
|
|
98
|
+
/** Authenticator selection criteria. */
|
|
99
|
+
readonly authenticatorSelection?: Readonly<WebAuthnAuthenticatorSelection>;
|
|
100
|
+
/** Attestation preference. */
|
|
101
|
+
readonly attestation?: WebAuthnAttestation;
|
|
102
|
+
/** Authenticator hints. */
|
|
103
|
+
readonly hints?: readonly WebAuthnHint[];
|
|
104
|
+
/** Client extension inputs; PRF values are decoded from base64url. */
|
|
105
|
+
readonly extensions?: Readonly<Record<string, unknown>>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** `PublicKeyCredentialRequestOptions` as serialized by a server (binary fields base64url). */
|
|
109
|
+
export interface PublicKeyCredentialRequestOptionsJSON {
|
|
110
|
+
/** Base64url-encoded challenge. */
|
|
111
|
+
readonly challenge: string;
|
|
112
|
+
/** Ceremony timeout in milliseconds. */
|
|
113
|
+
readonly timeout?: number;
|
|
114
|
+
/** Relying party id. */
|
|
115
|
+
readonly rpId?: string;
|
|
116
|
+
/** Allowed credentials; empty or omitted for discoverable credentials. */
|
|
117
|
+
readonly allowCredentials?: readonly PublicKeyCredentialDescriptorJSON[];
|
|
118
|
+
/** User verification requirement. */
|
|
119
|
+
readonly userVerification?: WebAuthnUserVerification;
|
|
120
|
+
/** Authenticator hints. */
|
|
121
|
+
readonly hints?: readonly WebAuthnHint[];
|
|
122
|
+
/** Client extension inputs; PRF values are decoded from base64url. */
|
|
123
|
+
readonly extensions?: Readonly<Record<string, unknown>>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Binary creation options passed to `navigator.credentials.create`. */
|
|
127
|
+
export interface WebAuthnCreationInit {
|
|
128
|
+
/** Relying party. */
|
|
129
|
+
rp: WebAuthnRelyingParty;
|
|
130
|
+
/** User account. */
|
|
131
|
+
user: { id: Uint8Array<ArrayBuffer>; name: string; displayName: string };
|
|
132
|
+
/** Challenge bytes. */
|
|
133
|
+
challenge: Uint8Array<ArrayBuffer>;
|
|
134
|
+
/** Acceptable algorithms in preference order. */
|
|
135
|
+
pubKeyCredParams: WebAuthnCredentialParameter[];
|
|
136
|
+
/** Ceremony timeout in milliseconds. */
|
|
137
|
+
timeout?: number;
|
|
138
|
+
/** Credentials that must not be re-registered. */
|
|
139
|
+
excludeCredentials?: WebAuthnCredentialDescriptor[];
|
|
140
|
+
/** Authenticator selection criteria. */
|
|
141
|
+
authenticatorSelection?: WebAuthnAuthenticatorSelection;
|
|
142
|
+
/** Attestation preference. */
|
|
143
|
+
attestation?: WebAuthnAttestation;
|
|
144
|
+
/** Authenticator hints. */
|
|
145
|
+
hints?: WebAuthnHint[];
|
|
146
|
+
/** Client extension inputs. */
|
|
147
|
+
extensions?: Record<string, unknown>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Binary request options passed to `navigator.credentials.get`. */
|
|
151
|
+
export interface WebAuthnRequestInit {
|
|
152
|
+
/** Challenge bytes. */
|
|
153
|
+
challenge: Uint8Array<ArrayBuffer>;
|
|
154
|
+
/** Ceremony timeout in milliseconds. */
|
|
155
|
+
timeout?: number;
|
|
156
|
+
/** Relying party id. */
|
|
157
|
+
rpId?: string;
|
|
158
|
+
/** Allowed credentials. */
|
|
159
|
+
allowCredentials?: WebAuthnCredentialDescriptor[];
|
|
160
|
+
/** User verification requirement. */
|
|
161
|
+
userVerification?: WebAuthnUserVerification;
|
|
162
|
+
/** Authenticator hints. */
|
|
163
|
+
hints?: WebAuthnHint[];
|
|
164
|
+
/** Client extension inputs. */
|
|
165
|
+
extensions?: Record<string, unknown>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Fields shared by every returned `PublicKeyCredential`. */
|
|
169
|
+
export interface PublicKeyCredentialLike {
|
|
170
|
+
/** Base64url credential id. */
|
|
171
|
+
readonly id: string;
|
|
172
|
+
/** Raw credential id. */
|
|
173
|
+
readonly rawId: ArrayBuffer;
|
|
174
|
+
/** Credential type (`"public-key"`). */
|
|
175
|
+
readonly type: string;
|
|
176
|
+
/** Attachment of the authenticator that produced the credential. */
|
|
177
|
+
readonly authenticatorAttachment?: string | null;
|
|
178
|
+
/** Client extension outputs. */
|
|
179
|
+
getClientExtensionResults(): object;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Credential returned by a registration ceremony. */
|
|
183
|
+
export interface RegistrationCredentialLike extends PublicKeyCredentialLike {
|
|
184
|
+
/** Attestation response. */
|
|
185
|
+
readonly response: {
|
|
186
|
+
/** Client data. */
|
|
187
|
+
readonly clientDataJSON: ArrayBuffer;
|
|
188
|
+
/** CBOR attestation object. */
|
|
189
|
+
readonly attestationObject: ArrayBuffer;
|
|
190
|
+
/** Transports reported by the authenticator. */
|
|
191
|
+
getTransports?(): readonly string[];
|
|
192
|
+
/** DER SubjectPublicKeyInfo of the new credential. */
|
|
193
|
+
getPublicKey?(): ArrayBuffer | null;
|
|
194
|
+
/** COSE algorithm of the new credential. */
|
|
195
|
+
getPublicKeyAlgorithm?(): number;
|
|
196
|
+
/** Authenticator data. */
|
|
197
|
+
getAuthenticatorData?(): ArrayBuffer;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Credential returned by an authentication ceremony. */
|
|
202
|
+
export interface AuthenticationCredentialLike extends PublicKeyCredentialLike {
|
|
203
|
+
/** Assertion response. */
|
|
204
|
+
readonly response: {
|
|
205
|
+
/** Client data. */
|
|
206
|
+
readonly clientDataJSON: ArrayBuffer;
|
|
207
|
+
/** Authenticator data. */
|
|
208
|
+
readonly authenticatorData: ArrayBuffer;
|
|
209
|
+
/** Assertion signature. */
|
|
210
|
+
readonly signature: ArrayBuffer;
|
|
211
|
+
/** User handle of a discoverable credential. */
|
|
212
|
+
readonly userHandle: ArrayBuffer | null;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** JSON-safe registration result, ready to POST to a server. */
|
|
217
|
+
export interface RegistrationResponseJSON {
|
|
218
|
+
/** Base64url credential id. */
|
|
219
|
+
readonly id: string;
|
|
220
|
+
/** Base64url raw credential id. */
|
|
221
|
+
readonly rawId: string;
|
|
222
|
+
/** Credential type. */
|
|
223
|
+
readonly type: "public-key";
|
|
224
|
+
/** Authenticator attachment, when known. */
|
|
225
|
+
readonly authenticatorAttachment?: WebAuthnAuthenticatorAttachment;
|
|
226
|
+
/** Client extension outputs. */
|
|
227
|
+
readonly clientExtensionResults: object;
|
|
228
|
+
/** Attestation response with base64url fields. */
|
|
229
|
+
readonly response: {
|
|
230
|
+
/** Base64url client data. */
|
|
231
|
+
readonly clientDataJSON: string;
|
|
232
|
+
/** Base64url attestation object. */
|
|
233
|
+
readonly attestationObject: string;
|
|
234
|
+
/** Known transports. */
|
|
235
|
+
readonly transports?: readonly WebAuthnTransport[];
|
|
236
|
+
/** Base64url public key, when exposed. */
|
|
237
|
+
readonly publicKey?: string;
|
|
238
|
+
/** COSE algorithm, when exposed. */
|
|
239
|
+
readonly publicKeyAlgorithm?: number;
|
|
240
|
+
/** Base64url authenticator data, when exposed. */
|
|
241
|
+
readonly authenticatorData?: string;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** JSON-safe authentication result, ready to POST to a server. */
|
|
246
|
+
export interface AuthenticationResponseJSON {
|
|
247
|
+
/** Base64url credential id. */
|
|
248
|
+
readonly id: string;
|
|
249
|
+
/** Base64url raw credential id. */
|
|
250
|
+
readonly rawId: string;
|
|
251
|
+
/** Credential type. */
|
|
252
|
+
readonly type: "public-key";
|
|
253
|
+
/** Authenticator attachment, when known. */
|
|
254
|
+
readonly authenticatorAttachment?: WebAuthnAuthenticatorAttachment;
|
|
255
|
+
/** Client extension outputs. */
|
|
256
|
+
readonly clientExtensionResults: object;
|
|
257
|
+
/** Assertion response with base64url fields. */
|
|
258
|
+
readonly response: {
|
|
259
|
+
/** Base64url client data. */
|
|
260
|
+
readonly clientDataJSON: string;
|
|
261
|
+
/** Base64url authenticator data. */
|
|
262
|
+
readonly authenticatorData: string;
|
|
263
|
+
/** Base64url signature. */
|
|
264
|
+
readonly signature: string;
|
|
265
|
+
/** Base64url user handle, when present. */
|
|
266
|
+
readonly userHandle?: string;
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** Minimal `navigator.credentials` consumed by {@link useWebAuthn}. */
|
|
271
|
+
export interface WebAuthnCredentialsHost {
|
|
272
|
+
/** Run a registration ceremony. */
|
|
273
|
+
create(options: {
|
|
274
|
+
publicKey: WebAuthnCreationInit;
|
|
275
|
+
signal?: AbortSignal;
|
|
276
|
+
mediation?: WebAuthnMediation;
|
|
277
|
+
}): Promise<unknown>;
|
|
278
|
+
/** Run an authentication ceremony. */
|
|
279
|
+
get(options: {
|
|
280
|
+
publicKey: WebAuthnRequestInit;
|
|
281
|
+
signal?: AbortSignal;
|
|
282
|
+
mediation?: WebAuthnMediation;
|
|
283
|
+
}): Promise<unknown>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Static capability checks of `PublicKeyCredential`. */
|
|
287
|
+
export interface PublicKeyCredentialStatics {
|
|
288
|
+
/** Whether a user-verifying platform authenticator (Touch ID, Windows Hello) exists. */
|
|
289
|
+
isUserVerifyingPlatformAuthenticatorAvailable?(): Promise<boolean>;
|
|
290
|
+
/** Whether conditional mediation (passkey autofill) is available. */
|
|
291
|
+
isConditionalMediationAvailable?(): Promise<boolean>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Options for {@link useWebAuthn}. */
|
|
295
|
+
export interface UseWebAuthnOptions {
|
|
296
|
+
/**
|
|
297
|
+
* Credentials container for alternate runtimes and tests.
|
|
298
|
+
*
|
|
299
|
+
* @default window.navigator.credentials when `window.PublicKeyCredential` exists
|
|
300
|
+
*/
|
|
301
|
+
readonly credentials?: MaybeRefOrGetter<WebAuthnCredentialsHost | null | undefined>;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* `PublicKeyCredential` interface used for capability checks. A ref (not a
|
|
305
|
+
* getter) because the browser value is a constructor function.
|
|
306
|
+
*
|
|
307
|
+
* @default window.PublicKeyCredential
|
|
308
|
+
*/
|
|
309
|
+
readonly publicKeyCredential?: MaybeRef<PublicKeyCredentialStatics | null | undefined>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/** Per-ceremony options of {@link WebAuthnControls.create} and {@link WebAuthnControls.get}. */
|
|
313
|
+
export interface WebAuthnCeremonyOptions {
|
|
314
|
+
/**
|
|
315
|
+
* Mediation requirement; `"conditional"` for passkey autofill.
|
|
316
|
+
*
|
|
317
|
+
* @default undefined
|
|
318
|
+
*/
|
|
319
|
+
readonly mediation?: WebAuthnMediation;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Additional signal aborting the ceremony.
|
|
323
|
+
*
|
|
324
|
+
* @default undefined
|
|
325
|
+
*/
|
|
326
|
+
readonly signal?: AbortSignal;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** Discriminated outcome of a WebAuthn ceremony. */
|
|
330
|
+
export type WebAuthnResult<Credential> =
|
|
331
|
+
| {
|
|
332
|
+
/** The ceremony produced a credential. */
|
|
333
|
+
readonly status: "success";
|
|
334
|
+
/** Returned credential. */
|
|
335
|
+
readonly credential: Credential;
|
|
336
|
+
}
|
|
337
|
+
| {
|
|
338
|
+
/**
|
|
339
|
+
* `aborted`: aborted by `abort()`, a newer ceremony, or `signal`;
|
|
340
|
+
* `not-allowed`: the user cancelled or the ceremony timed out;
|
|
341
|
+
* `unsupported`: WebAuthn is unavailable; `failed`: anything else.
|
|
342
|
+
*/
|
|
343
|
+
readonly status: "aborted" | "not-allowed" | "unsupported" | "failed";
|
|
344
|
+
/** Error thrown by the host, when one was thrown. */
|
|
345
|
+
readonly error: unknown;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
/** Reactive state and actions returned by {@link useWebAuthn}. */
|
|
349
|
+
export interface WebAuthnControls {
|
|
350
|
+
/** Whether WebAuthn is available. */
|
|
351
|
+
readonly supported: ComputedRef<boolean>;
|
|
352
|
+
/** Whether a ceremony is in progress. */
|
|
353
|
+
readonly pending: Readonly<Ref<boolean>>;
|
|
354
|
+
/** Most recent ceremony failure (not aborts), cleared when a ceremony starts. */
|
|
355
|
+
readonly error: Readonly<ShallowRef<unknown>>;
|
|
356
|
+
/**
|
|
357
|
+
* Register a credential. Aborts any pending ceremony first.
|
|
358
|
+
*
|
|
359
|
+
* @param options Binary options or server JSON (parsed automatically).
|
|
360
|
+
* @param ceremony Mediation and extra abort signal.
|
|
361
|
+
* @returns The discriminated outcome; never rejects.
|
|
362
|
+
*/
|
|
363
|
+
readonly create: (
|
|
364
|
+
options: WebAuthnCreationInit | PublicKeyCredentialCreationOptionsJSON,
|
|
365
|
+
ceremony?: WebAuthnCeremonyOptions,
|
|
366
|
+
) => Promise<WebAuthnResult<RegistrationCredentialLike>>;
|
|
367
|
+
/**
|
|
368
|
+
* Authenticate with a credential. Aborts any pending ceremony first.
|
|
369
|
+
*
|
|
370
|
+
* @param options Binary options or server JSON (parsed automatically).
|
|
371
|
+
* @param ceremony Mediation (for example `"conditional"`) and extra abort signal.
|
|
372
|
+
* @returns The discriminated outcome; never rejects.
|
|
373
|
+
*/
|
|
374
|
+
readonly get: (
|
|
375
|
+
options: WebAuthnRequestInit | PublicKeyCredentialRequestOptionsJSON,
|
|
376
|
+
ceremony?: WebAuthnCeremonyOptions,
|
|
377
|
+
) => Promise<WebAuthnResult<AuthenticationCredentialLike>>;
|
|
378
|
+
/**
|
|
379
|
+
* Abort the pending ceremony, if any.
|
|
380
|
+
*
|
|
381
|
+
* @param reason Abort reason.
|
|
382
|
+
*/
|
|
383
|
+
readonly abort: (reason?: unknown) => void;
|
|
384
|
+
/**
|
|
385
|
+
* Whether a user-verifying platform authenticator exists.
|
|
386
|
+
*
|
|
387
|
+
* @returns `false` when unsupported or the check fails.
|
|
388
|
+
*/
|
|
389
|
+
readonly isUserVerifyingPlatformAuthenticatorAvailable: () => Promise<boolean>;
|
|
390
|
+
/**
|
|
391
|
+
* Whether conditional mediation (passkey autofill) is available.
|
|
392
|
+
*
|
|
393
|
+
* @returns `false` when unsupported or the check fails.
|
|
394
|
+
*/
|
|
395
|
+
readonly isConditionalMediationAvailable: () => Promise<boolean>;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const transports: readonly string[] = ["usb", "nfc", "ble", "hybrid", "internal"];
|
|
399
|
+
|
|
400
|
+
function isTransport(value: string): value is WebAuthnTransport {
|
|
401
|
+
return transports.includes(value);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function isAttachment(value: unknown): value is WebAuthnAuthenticatorAttachment {
|
|
405
|
+
return value === "platform" || value === "cross-platform";
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Encode bytes as unpadded base64url.
|
|
410
|
+
*
|
|
411
|
+
* @param bytes Buffer or view to encode.
|
|
412
|
+
* @returns Base64url text without `=` padding.
|
|
413
|
+
*/
|
|
414
|
+
export function encodeBase64Url(bytes: ArrayBuffer | ArrayBufferView): string {
|
|
415
|
+
const view =
|
|
416
|
+
bytes instanceof ArrayBuffer
|
|
417
|
+
? new Uint8Array(bytes)
|
|
418
|
+
: new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
419
|
+
let binary = "";
|
|
420
|
+
for (const byte of view) binary += String.fromCharCode(byte);
|
|
421
|
+
return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Decode base64url (padded or unpadded) into bytes.
|
|
426
|
+
*
|
|
427
|
+
* @param text Base64url text.
|
|
428
|
+
* @throws `TypeError` tagged `VIZE_COMPOSE_WEBAUTHN_INVALID_BASE64URL` for malformed input.
|
|
429
|
+
* @returns Decoded bytes.
|
|
430
|
+
*/
|
|
431
|
+
export function decodeBase64Url(text: string): Uint8Array<ArrayBuffer> {
|
|
432
|
+
const body = text.replace(/=+$/u, "");
|
|
433
|
+
if (!/^[\w-]*$/u.test(body) || body.length % 4 === 1) {
|
|
434
|
+
throw new TypeError(`[VIZE_COMPOSE_WEBAUTHN_INVALID_BASE64URL] invalid base64url input`);
|
|
435
|
+
}
|
|
436
|
+
const binary = atob(body.replaceAll("-", "+").replaceAll("_", "/"));
|
|
437
|
+
const bytes = new Uint8Array(binary.length);
|
|
438
|
+
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
439
|
+
return bytes;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function parseDescriptors(
|
|
443
|
+
list: readonly PublicKeyCredentialDescriptorJSON[],
|
|
444
|
+
): WebAuthnCredentialDescriptor[] {
|
|
445
|
+
return list.map((descriptor) => ({
|
|
446
|
+
type: descriptor.type,
|
|
447
|
+
id: decodeBase64Url(descriptor.id),
|
|
448
|
+
...(descriptor.transports ? { transports: [...descriptor.transports] } : {}),
|
|
449
|
+
}));
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
453
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function parsePrfValues(value: unknown): unknown {
|
|
457
|
+
if (!isRecord(value)) return value;
|
|
458
|
+
return {
|
|
459
|
+
...value,
|
|
460
|
+
...(typeof value.first === "string" ? { first: decodeBase64Url(value.first) } : {}),
|
|
461
|
+
...(typeof value.second === "string" ? { second: decodeBase64Url(value.second) } : {}),
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function parseExtensions(extensions: Readonly<Record<string, unknown>>): Record<string, unknown> {
|
|
466
|
+
const prf = extensions.prf;
|
|
467
|
+
if (!isRecord(prf)) return { ...extensions };
|
|
468
|
+
const byCredential = prf.evalByCredential;
|
|
469
|
+
return {
|
|
470
|
+
...extensions,
|
|
471
|
+
prf: {
|
|
472
|
+
...prf,
|
|
473
|
+
...(prf.eval === undefined ? {} : { eval: parsePrfValues(prf.eval) }),
|
|
474
|
+
...(isRecord(byCredential)
|
|
475
|
+
? {
|
|
476
|
+
evalByCredential: Object.fromEntries(
|
|
477
|
+
Object.entries(byCredential).map(([id, values]) => [id, parsePrfValues(values)]),
|
|
478
|
+
),
|
|
479
|
+
}
|
|
480
|
+
: {}),
|
|
481
|
+
},
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
function serializeExtensionValue(value: unknown): unknown {
|
|
486
|
+
if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) return encodeBase64Url(value);
|
|
487
|
+
if (Array.isArray(value)) return value.map(serializeExtensionValue);
|
|
488
|
+
if (isRecord(value)) {
|
|
489
|
+
return Object.fromEntries(
|
|
490
|
+
Object.entries(value).map(([key, entry]) => [key, serializeExtensionValue(entry)]),
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
return value;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function serializeExtensions(results: object): object {
|
|
497
|
+
return serializeExtensionValue(results) as object;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Convert server creation-options JSON into binary options for `create`.
|
|
502
|
+
*
|
|
503
|
+
* @param json Options with base64url `challenge`, `user.id`, and credential ids.
|
|
504
|
+
* @throws `TypeError` tagged `VIZE_COMPOSE_WEBAUTHN_INVALID_BASE64URL` for malformed fields.
|
|
505
|
+
* @returns Binary creation options.
|
|
506
|
+
*/
|
|
507
|
+
export function parseCreationOptionsFromJSON(
|
|
508
|
+
json: PublicKeyCredentialCreationOptionsJSON,
|
|
509
|
+
): WebAuthnCreationInit {
|
|
510
|
+
const { excludeCredentials, authenticatorSelection, hints, extensions, ...rest } = json;
|
|
511
|
+
return {
|
|
512
|
+
...rest,
|
|
513
|
+
rp: { ...json.rp },
|
|
514
|
+
user: { ...json.user, id: decodeBase64Url(json.user.id) },
|
|
515
|
+
challenge: decodeBase64Url(json.challenge),
|
|
516
|
+
pubKeyCredParams: json.pubKeyCredParams.map((parameter) => ({ ...parameter })),
|
|
517
|
+
...(excludeCredentials ? { excludeCredentials: parseDescriptors(excludeCredentials) } : {}),
|
|
518
|
+
...(authenticatorSelection ? { authenticatorSelection: { ...authenticatorSelection } } : {}),
|
|
519
|
+
...(hints ? { hints: [...hints] } : {}),
|
|
520
|
+
...(extensions ? { extensions: parseExtensions(extensions) } : {}),
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Convert server request-options JSON into binary options for `get`.
|
|
526
|
+
*
|
|
527
|
+
* @param json Options with base64url `challenge` and credential ids.
|
|
528
|
+
* @throws `TypeError` tagged `VIZE_COMPOSE_WEBAUTHN_INVALID_BASE64URL` for malformed fields.
|
|
529
|
+
* @returns Binary request options.
|
|
530
|
+
*/
|
|
531
|
+
export function parseRequestOptionsFromJSON(
|
|
532
|
+
json: PublicKeyCredentialRequestOptionsJSON,
|
|
533
|
+
): WebAuthnRequestInit {
|
|
534
|
+
const { allowCredentials, hints, extensions, ...rest } = json;
|
|
535
|
+
return {
|
|
536
|
+
...rest,
|
|
537
|
+
challenge: decodeBase64Url(json.challenge),
|
|
538
|
+
...(allowCredentials ? { allowCredentials: parseDescriptors(allowCredentials) } : {}),
|
|
539
|
+
...(hints ? { hints: [...hints] } : {}),
|
|
540
|
+
...(extensions ? { extensions: parseExtensions(extensions) } : {}),
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Serialize a registration credential into JSON-safe base64url fields.
|
|
546
|
+
*
|
|
547
|
+
* @param credential Credential resolved by `create`.
|
|
548
|
+
* @returns Server-ready registration response.
|
|
549
|
+
*/
|
|
550
|
+
export function serializeRegistrationCredential(
|
|
551
|
+
credential: RegistrationCredentialLike,
|
|
552
|
+
): RegistrationResponseJSON {
|
|
553
|
+
const { response } = credential;
|
|
554
|
+
const publicKey = response.getPublicKey?.() ?? null;
|
|
555
|
+
const authenticatorData = response.getAuthenticatorData?.();
|
|
556
|
+
const algorithm = response.getPublicKeyAlgorithm?.();
|
|
557
|
+
const known = response.getTransports?.().filter(isTransport);
|
|
558
|
+
return {
|
|
559
|
+
id: credential.id,
|
|
560
|
+
rawId: encodeBase64Url(credential.rawId),
|
|
561
|
+
type: "public-key",
|
|
562
|
+
...(isAttachment(credential.authenticatorAttachment)
|
|
563
|
+
? { authenticatorAttachment: credential.authenticatorAttachment }
|
|
564
|
+
: {}),
|
|
565
|
+
clientExtensionResults: serializeExtensions(credential.getClientExtensionResults()),
|
|
566
|
+
response: {
|
|
567
|
+
clientDataJSON: encodeBase64Url(response.clientDataJSON),
|
|
568
|
+
attestationObject: encodeBase64Url(response.attestationObject),
|
|
569
|
+
...(known ? { transports: known } : {}),
|
|
570
|
+
...(publicKey ? { publicKey: encodeBase64Url(publicKey) } : {}),
|
|
571
|
+
...(algorithm === undefined ? {} : { publicKeyAlgorithm: algorithm }),
|
|
572
|
+
...(authenticatorData ? { authenticatorData: encodeBase64Url(authenticatorData) } : {}),
|
|
573
|
+
},
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Serialize an authentication credential into JSON-safe base64url fields.
|
|
579
|
+
*
|
|
580
|
+
* @param credential Credential resolved by `get`.
|
|
581
|
+
* @returns Server-ready authentication response.
|
|
582
|
+
*/
|
|
583
|
+
export function serializeAuthenticationCredential(
|
|
584
|
+
credential: AuthenticationCredentialLike,
|
|
585
|
+
): AuthenticationResponseJSON {
|
|
586
|
+
const { response } = credential;
|
|
587
|
+
return {
|
|
588
|
+
id: credential.id,
|
|
589
|
+
rawId: encodeBase64Url(credential.rawId),
|
|
590
|
+
type: "public-key",
|
|
591
|
+
...(isAttachment(credential.authenticatorAttachment)
|
|
592
|
+
? { authenticatorAttachment: credential.authenticatorAttachment }
|
|
593
|
+
: {}),
|
|
594
|
+
clientExtensionResults: serializeExtensions(credential.getClientExtensionResults()),
|
|
595
|
+
response: {
|
|
596
|
+
clientDataJSON: encodeBase64Url(response.clientDataJSON),
|
|
597
|
+
authenticatorData: encodeBase64Url(response.authenticatorData),
|
|
598
|
+
signature: encodeBase64Url(response.signature),
|
|
599
|
+
...(response.userHandle ? { userHandle: encodeBase64Url(response.userHandle) } : {}),
|
|
600
|
+
},
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function hasResponseField(value: unknown, field: string): boolean {
|
|
605
|
+
if (typeof value !== "object" || value === null || !("response" in value)) return false;
|
|
606
|
+
const { response } = value;
|
|
607
|
+
return typeof response === "object" && response !== null && field in response;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function isRegistrationCredential(value: unknown): value is RegistrationCredentialLike {
|
|
611
|
+
return hasResponseField(value, "attestationObject");
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
function isAuthenticationCredential(value: unknown): value is AuthenticationCredentialLike {
|
|
615
|
+
return hasResponseField(value, "signature");
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
function isStatics(candidate: unknown): candidate is PublicKeyCredentialStatics {
|
|
619
|
+
return typeof candidate === "function";
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
function browserStatics(): PublicKeyCredentialStatics | undefined {
|
|
623
|
+
if (typeof window === "undefined") return undefined;
|
|
624
|
+
const candidate: unknown = Reflect.get(window, "PublicKeyCredential");
|
|
625
|
+
return isStatics(candidate) ? candidate : undefined;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
function browserCredentials(): WebAuthnCredentialsHost | undefined {
|
|
629
|
+
if (browserStatics() === undefined) return undefined;
|
|
630
|
+
const container = window.navigator.credentials;
|
|
631
|
+
if (!container) return undefined;
|
|
632
|
+
return {
|
|
633
|
+
create: (options) => container.create(options),
|
|
634
|
+
get: (options) => container.get(options),
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function isJSONOptions<Json extends { readonly challenge: string }>(
|
|
639
|
+
input: Json | { readonly challenge: Uint8Array },
|
|
640
|
+
): input is Json {
|
|
641
|
+
return typeof input.challenge === "string";
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
function errorName(error: unknown): unknown {
|
|
645
|
+
return typeof error === "object" && error !== null && "name" in error ? error.name : undefined;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Register and authenticate passkeys with the Web Authentication API.
|
|
650
|
+
*
|
|
651
|
+
* `create` and `get` accept binary options or server JSON, run one ceremony
|
|
652
|
+
* at a time (starting one aborts the previous), and resolve to a
|
|
653
|
+
* discriminated {@link WebAuthnResult}. Use the exported pure helpers to
|
|
654
|
+
* serialize results for the server. A pending ceremony is aborted when the
|
|
655
|
+
* owning reactive scope stops; outside a scope call `abort()`.
|
|
656
|
+
*
|
|
657
|
+
* Server rendering: nothing is requested, `supported` and `pending` are false.
|
|
658
|
+
*
|
|
659
|
+
* @example
|
|
660
|
+
* ```ts
|
|
661
|
+
* const webAuthn = useWebAuthn();
|
|
662
|
+
* const result = await webAuthn.get(await fetchJSON("/login/options"));
|
|
663
|
+
* if (result.status === "success") await post(serializeAuthenticationCredential(result.credential));
|
|
664
|
+
* ```
|
|
665
|
+
*
|
|
666
|
+
* @param options Capability hosts.
|
|
667
|
+
* @default options {}
|
|
668
|
+
* @returns Ceremony state and actions.
|
|
669
|
+
*/
|
|
670
|
+
export function useWebAuthn(options: UseWebAuthnOptions = {}): WebAuthnControls {
|
|
671
|
+
const pending = ref(false);
|
|
672
|
+
const error = shallowRef<unknown>(undefined);
|
|
673
|
+
let controller: AbortController | undefined;
|
|
674
|
+
|
|
675
|
+
// Inside a component the host resolves only after mount (a post-flush
|
|
676
|
+
// job), so a hydrating client first renders the same unsupported state as
|
|
677
|
+
// the server. Outside components it resolves immediately.
|
|
678
|
+
const hydrated = shallowRef(!hasInjectionContext());
|
|
679
|
+
if (!hydrated.value) {
|
|
680
|
+
watchPostEffect(() => {
|
|
681
|
+
hydrated.value = true;
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
const resolveCredentials = (): WebAuthnCredentialsHost | undefined =>
|
|
685
|
+
!hydrated.value
|
|
686
|
+
? undefined
|
|
687
|
+
: options.credentials === undefined
|
|
688
|
+
? browserCredentials()
|
|
689
|
+
: (toValue(options.credentials) ?? undefined);
|
|
690
|
+
const resolveStatics = (): PublicKeyCredentialStatics | undefined =>
|
|
691
|
+
!hydrated.value
|
|
692
|
+
? undefined
|
|
693
|
+
: options.publicKeyCredential === undefined
|
|
694
|
+
? browserStatics()
|
|
695
|
+
: (unref(options.publicKeyCredential) ?? undefined);
|
|
696
|
+
|
|
697
|
+
const abort = (reason?: unknown): void => {
|
|
698
|
+
const current = controller;
|
|
699
|
+
controller = undefined;
|
|
700
|
+
pending.value = false;
|
|
701
|
+
current?.abort(reason);
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
const run = async <Credential>(
|
|
705
|
+
ceremony: WebAuthnCeremonyOptions,
|
|
706
|
+
invoke: (
|
|
707
|
+
host: WebAuthnCredentialsHost,
|
|
708
|
+
request: { signal: AbortSignal; mediation?: WebAuthnMediation },
|
|
709
|
+
) => Promise<unknown>,
|
|
710
|
+
guard: (value: unknown) => value is Credential,
|
|
711
|
+
): Promise<WebAuthnResult<Credential>> => {
|
|
712
|
+
const host = resolveCredentials();
|
|
713
|
+
if (!host) return { status: "unsupported", error: undefined };
|
|
714
|
+
abort();
|
|
715
|
+
const own = new AbortController();
|
|
716
|
+
controller = own;
|
|
717
|
+
const external = ceremony.signal;
|
|
718
|
+
const forward = (): void => own.abort(external?.reason);
|
|
719
|
+
if (external?.aborted) forward();
|
|
720
|
+
else external?.addEventListener("abort", forward, { once: true });
|
|
721
|
+
pending.value = true;
|
|
722
|
+
error.value = undefined;
|
|
723
|
+
try {
|
|
724
|
+
const value = await invoke(host, {
|
|
725
|
+
signal: own.signal,
|
|
726
|
+
...(ceremony.mediation ? { mediation: ceremony.mediation } : {}),
|
|
727
|
+
});
|
|
728
|
+
if (own.signal.aborted) return { status: "aborted", error: own.signal.reason };
|
|
729
|
+
if (!guard(value)) throw new TypeError("[VIZE_COMPOSE_WEBAUTHN_NO_CREDENTIAL] no credential");
|
|
730
|
+
return { status: "success", credential: value };
|
|
731
|
+
} catch (cause) {
|
|
732
|
+
if (own.signal.aborted || errorName(cause) === "AbortError") {
|
|
733
|
+
return { status: "aborted", error: cause };
|
|
734
|
+
}
|
|
735
|
+
error.value = cause;
|
|
736
|
+
return {
|
|
737
|
+
status: errorName(cause) === "NotAllowedError" ? "not-allowed" : "failed",
|
|
738
|
+
error: cause,
|
|
739
|
+
};
|
|
740
|
+
} finally {
|
|
741
|
+
external?.removeEventListener("abort", forward);
|
|
742
|
+
if (controller === own) {
|
|
743
|
+
controller = undefined;
|
|
744
|
+
pending.value = false;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
const create: WebAuthnControls["create"] = (input, ceremony = {}) =>
|
|
750
|
+
run(
|
|
751
|
+
ceremony,
|
|
752
|
+
(host, request) =>
|
|
753
|
+
host.create({
|
|
754
|
+
...request,
|
|
755
|
+
publicKey: isJSONOptions(input) ? parseCreationOptionsFromJSON(input) : input,
|
|
756
|
+
}),
|
|
757
|
+
isRegistrationCredential,
|
|
758
|
+
);
|
|
759
|
+
|
|
760
|
+
const get: WebAuthnControls["get"] = (input, ceremony = {}) =>
|
|
761
|
+
run(
|
|
762
|
+
ceremony,
|
|
763
|
+
(host, request) =>
|
|
764
|
+
host.get({
|
|
765
|
+
...request,
|
|
766
|
+
publicKey: isJSONOptions(input) ? parseRequestOptionsFromJSON(input) : input,
|
|
767
|
+
}),
|
|
768
|
+
isAuthenticationCredential,
|
|
769
|
+
);
|
|
770
|
+
|
|
771
|
+
const check = async (key: keyof PublicKeyCredentialStatics): Promise<boolean> => {
|
|
772
|
+
const statics = resolveStatics();
|
|
773
|
+
try {
|
|
774
|
+
return (await statics?.[key]?.call(statics)) === true;
|
|
775
|
+
} catch {
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
tryOnScopeDispose(() => abort());
|
|
781
|
+
|
|
782
|
+
return {
|
|
783
|
+
supported: computed(() => resolveCredentials() !== undefined),
|
|
784
|
+
pending: readonly(pending),
|
|
785
|
+
error: readonly(error),
|
|
786
|
+
create,
|
|
787
|
+
get,
|
|
788
|
+
abort,
|
|
789
|
+
isUserVerifyingPlatformAuthenticatorAvailable: () =>
|
|
790
|
+
check("isUserVerifyingPlatformAuthenticatorAvailable"),
|
|
791
|
+
isConditionalMediationAvailable: () => check("isConditionalMediationAvailable"),
|
|
792
|
+
};
|
|
793
|
+
}
|