@signality/core 0.0.1-alpha.2 → 0.0.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -47
- package/browser/battery/index.d.ts +27 -2
- package/browser/bluetooth/index.d.ts +40 -13
- package/browser/breakpoints/index.d.ts +22 -9
- package/browser/broadcast-channel/index.d.ts +1 -1
- package/browser/browser-language/index.d.ts +1 -1
- package/browser/clipboard/index.d.ts +22 -6
- package/browser/device-posture/index.d.ts +23 -2
- package/browser/display-media/index.d.ts +34 -22
- package/browser/eye-dropper/index.d.ts +22 -6
- package/browser/favicon/index.d.ts +29 -2
- package/browser/file-dialog/index.d.ts +97 -0
- package/browser/fps/index.d.ts +1 -1
- package/browser/fullscreen/index.d.ts +78 -0
- package/browser/gamepad/index.d.ts +39 -9
- package/browser/geolocation/index.d.ts +44 -13
- package/browser/index.d.ts +8 -2
- package/browser/input-modality/index.d.ts +1 -1
- package/browser/listener/index.d.ts +1 -1
- package/browser/media-query/index.d.ts +1 -1
- package/browser/network/index.d.ts +37 -9
- package/browser/online/index.d.ts +1 -1
- package/browser/page-visibility/index.d.ts +1 -1
- package/browser/permission-state/index.d.ts +23 -0
- package/browser/picture-in-picture/index.d.ts +24 -6
- package/browser/screen-orientation/index.d.ts +1 -1
- package/browser/speech-recognition/index.d.ts +51 -13
- package/browser/speech-synthesis/index.d.ts +82 -42
- package/browser/storage/index.d.ts +1 -1
- package/browser/text-direction/index.d.ts +2 -5
- package/{elements → browser}/text-selection/index.d.ts +1 -1
- package/browser/vibration/index.d.ts +38 -9
- package/browser/web-notification/index.d.ts +35 -9
- package/browser/web-share/index.d.ts +19 -5
- package/browser/web-worker/index.d.ts +35 -11
- package/browser/window-focus/index.d.ts +27 -0
- package/{elements → browser}/window-size/index.d.ts +6 -7
- package/elements/active-element/index.d.ts +1 -1
- package/elements/dropzone/index.d.ts +60 -10
- package/elements/element-focus/index.d.ts +1 -1
- package/elements/element-focus-within/index.d.ts +1 -1
- package/elements/element-hover/index.d.ts +1 -1
- package/elements/element-size/index.d.ts +8 -5
- package/elements/element-visibility/index.d.ts +25 -7
- package/elements/index.d.ts +0 -2
- package/elements/mouse-position/index.d.ts +27 -7
- package/elements/on-click-outside/index.d.ts +1 -1
- package/elements/on-disconnect/index.d.ts +1 -1
- package/elements/on-long-press/index.d.ts +1 -1
- package/elements/pointer-swipe/index.d.ts +1 -1
- package/elements/scroll-position/index.d.ts +2 -2
- package/elements/swipe/index.d.ts +1 -1
- package/fesm2022/signality-core-browser-battery.mjs +1 -1
- package/fesm2022/signality-core-browser-battery.mjs.map +1 -1
- package/fesm2022/signality-core-browser-bluetooth.mjs +28 -27
- package/fesm2022/signality-core-browser-bluetooth.mjs.map +1 -1
- package/fesm2022/signality-core-browser-breakpoints.mjs +19 -10
- package/fesm2022/signality-core-browser-breakpoints.mjs.map +1 -1
- package/fesm2022/signality-core-browser-broadcast-channel.mjs +1 -1
- package/fesm2022/signality-core-browser-broadcast-channel.mjs.map +1 -1
- package/fesm2022/signality-core-browser-browser-language.mjs +1 -1
- package/fesm2022/signality-core-browser-browser-language.mjs.map +1 -1
- package/fesm2022/signality-core-browser-clipboard.mjs +1 -1
- package/fesm2022/signality-core-browser-clipboard.mjs.map +1 -1
- package/fesm2022/signality-core-browser-device-posture.mjs +13 -0
- package/fesm2022/signality-core-browser-device-posture.mjs.map +1 -1
- package/fesm2022/signality-core-browser-display-media.mjs +4 -17
- package/fesm2022/signality-core-browser-display-media.mjs.map +1 -1
- package/fesm2022/signality-core-browser-eye-dropper.mjs +1 -1
- package/fesm2022/signality-core-browser-eye-dropper.mjs.map +1 -1
- package/fesm2022/signality-core-browser-favicon.mjs +2 -2
- package/fesm2022/signality-core-browser-favicon.mjs.map +1 -1
- package/fesm2022/signality-core-browser-file-dialog.mjs +109 -0
- package/fesm2022/signality-core-browser-file-dialog.mjs.map +1 -0
- package/fesm2022/signality-core-browser-fps.mjs +1 -1
- package/fesm2022/signality-core-browser-fps.mjs.map +1 -1
- package/fesm2022/signality-core-browser-fullscreen.mjs +113 -0
- package/fesm2022/signality-core-browser-fullscreen.mjs.map +1 -0
- package/fesm2022/signality-core-browser-gamepad.mjs +14 -4
- package/fesm2022/signality-core-browser-gamepad.mjs.map +1 -1
- package/fesm2022/signality-core-browser-geolocation.mjs +8 -19
- package/fesm2022/signality-core-browser-geolocation.mjs.map +1 -1
- package/fesm2022/signality-core-browser-input-modality.mjs +1 -1
- package/fesm2022/signality-core-browser-input-modality.mjs.map +1 -1
- package/fesm2022/signality-core-browser-listener.mjs +18 -6
- package/fesm2022/signality-core-browser-listener.mjs.map +1 -1
- package/fesm2022/signality-core-browser-media-query.mjs +1 -1
- package/fesm2022/signality-core-browser-media-query.mjs.map +1 -1
- package/fesm2022/signality-core-browser-network.mjs +2 -2
- package/fesm2022/signality-core-browser-network.mjs.map +1 -1
- package/fesm2022/signality-core-browser-online.mjs +1 -1
- package/fesm2022/signality-core-browser-online.mjs.map +1 -1
- package/fesm2022/signality-core-browser-page-visibility.mjs +1 -1
- package/fesm2022/signality-core-browser-page-visibility.mjs.map +1 -1
- package/fesm2022/signality-core-browser-permission-state.mjs +57 -0
- package/fesm2022/signality-core-browser-permission-state.mjs.map +1 -0
- package/fesm2022/signality-core-browser-picture-in-picture.mjs +30 -13
- package/fesm2022/signality-core-browser-picture-in-picture.mjs.map +1 -1
- package/fesm2022/signality-core-browser-screen-orientation.mjs +1 -1
- package/fesm2022/signality-core-browser-screen-orientation.mjs.map +1 -1
- package/fesm2022/signality-core-browser-speech-recognition.mjs +6 -18
- package/fesm2022/signality-core-browser-speech-recognition.mjs.map +1 -1
- package/fesm2022/signality-core-browser-speech-synthesis.mjs +14 -16
- package/fesm2022/signality-core-browser-speech-synthesis.mjs.map +1 -1
- package/fesm2022/signality-core-browser-storage.mjs +1 -1
- package/fesm2022/signality-core-browser-storage.mjs.map +1 -1
- package/fesm2022/signality-core-browser-text-direction.mjs +1 -4
- package/fesm2022/signality-core-browser-text-direction.mjs.map +1 -1
- package/fesm2022/{signality-core-elements-text-selection.mjs → signality-core-browser-text-selection.mjs} +2 -2
- package/fesm2022/signality-core-browser-text-selection.mjs.map +1 -0
- package/fesm2022/signality-core-browser-vibration.mjs +14 -5
- package/fesm2022/signality-core-browser-vibration.mjs.map +1 -1
- package/fesm2022/signality-core-browser-web-notification.mjs +5 -7
- package/fesm2022/signality-core-browser-web-notification.mjs.map +1 -1
- package/fesm2022/signality-core-browser-web-share.mjs +3 -5
- package/fesm2022/signality-core-browser-web-share.mjs.map +1 -1
- package/fesm2022/signality-core-browser-web-worker.mjs +6 -3
- package/fesm2022/signality-core-browser-web-worker.mjs.map +1 -1
- package/fesm2022/signality-core-browser-window-focus.mjs +48 -0
- package/fesm2022/signality-core-browser-window-focus.mjs.map +1 -0
- package/fesm2022/{signality-core-elements-window-size.mjs → signality-core-browser-window-size.mjs} +4 -24
- package/fesm2022/signality-core-browser-window-size.mjs.map +1 -0
- package/fesm2022/signality-core-browser.mjs +8 -2
- package/fesm2022/signality-core-browser.mjs.map +1 -1
- package/fesm2022/signality-core-elements-active-element.mjs +1 -1
- package/fesm2022/signality-core-elements-active-element.mjs.map +1 -1
- package/fesm2022/signality-core-elements-dropzone.mjs +28 -29
- package/fesm2022/signality-core-elements-dropzone.mjs.map +1 -1
- package/fesm2022/signality-core-elements-element-focus-within.mjs +1 -1
- package/fesm2022/signality-core-elements-element-focus-within.mjs.map +1 -1
- package/fesm2022/signality-core-elements-element-focus.mjs +1 -1
- package/fesm2022/signality-core-elements-element-focus.mjs.map +1 -1
- package/fesm2022/signality-core-elements-element-hover.mjs +1 -1
- package/fesm2022/signality-core-elements-element-hover.mjs.map +1 -1
- package/fesm2022/signality-core-elements-element-size.mjs +19 -24
- package/fesm2022/signality-core-elements-element-size.mjs.map +1 -1
- package/fesm2022/signality-core-elements-element-visibility.mjs +2 -2
- package/fesm2022/signality-core-elements-element-visibility.mjs.map +1 -1
- package/fesm2022/signality-core-elements-mouse-position.mjs +3 -3
- package/fesm2022/signality-core-elements-mouse-position.mjs.map +1 -1
- package/fesm2022/signality-core-elements-on-click-outside.mjs +1 -1
- package/fesm2022/signality-core-elements-on-click-outside.mjs.map +1 -1
- package/fesm2022/signality-core-elements-on-disconnect.mjs +1 -1
- package/fesm2022/signality-core-elements-on-disconnect.mjs.map +1 -1
- package/fesm2022/signality-core-elements-on-long-press.mjs +1 -1
- package/fesm2022/signality-core-elements-on-long-press.mjs.map +1 -1
- package/fesm2022/signality-core-elements-pointer-swipe.mjs +1 -1
- package/fesm2022/signality-core-elements-pointer-swipe.mjs.map +1 -1
- package/fesm2022/signality-core-elements-scroll-position.mjs +2 -2
- package/fesm2022/signality-core-elements-scroll-position.mjs.map +1 -1
- package/fesm2022/signality-core-elements-swipe.mjs +1 -1
- package/fesm2022/signality-core-elements-swipe.mjs.map +1 -1
- package/fesm2022/signality-core-elements.mjs +0 -2
- package/fesm2022/signality-core-elements.mjs.map +1 -1
- package/fesm2022/signality-core-internal.mjs +54 -7
- package/fesm2022/signality-core-internal.mjs.map +1 -1
- package/fesm2022/signality-core-observers-intersection-observer.mjs +3 -2
- package/fesm2022/signality-core-observers-intersection-observer.mjs.map +1 -1
- package/fesm2022/signality-core-observers-mutation-observer.mjs +3 -2
- package/fesm2022/signality-core-observers-mutation-observer.mjs.map +1 -1
- package/fesm2022/signality-core-observers-resize-observer.mjs +3 -2
- package/fesm2022/signality-core-observers-resize-observer.mjs.map +1 -1
- package/fesm2022/signality-core-observers.mjs +0 -1
- package/fesm2022/signality-core-observers.mjs.map +1 -1
- package/fesm2022/signality-core-reactivity-debounced.mjs.map +1 -1
- package/fesm2022/signality-core-reactivity-throttled.mjs.map +1 -1
- package/fesm2022/signality-core-reactivity-watcher.mjs.map +1 -1
- package/fesm2022/signality-core-router-fragment.mjs +1 -1
- package/fesm2022/signality-core-router-fragment.mjs.map +1 -1
- package/fesm2022/signality-core-router-params.mjs +1 -1
- package/fesm2022/signality-core-router-params.mjs.map +1 -1
- package/fesm2022/signality-core-router-query-params.mjs.map +1 -1
- package/fesm2022/signality-core-router-route-data.mjs +1 -1
- package/fesm2022/signality-core-router-route-data.mjs.map +1 -1
- package/fesm2022/signality-core-router-router-listener.mjs.map +1 -1
- package/fesm2022/signality-core-router-title.mjs +1 -1
- package/fesm2022/signality-core-router-title.mjs.map +1 -1
- package/fesm2022/signality-core-router-url.mjs +1 -1
- package/fesm2022/signality-core-router-url.mjs.map +1 -1
- package/fesm2022/signality-core-scheduling-debounce-callback.mjs +1 -1
- package/fesm2022/signality-core-scheduling-debounce-callback.mjs.map +1 -1
- package/fesm2022/signality-core-scheduling-interval.mjs +29 -72
- package/fesm2022/signality-core-scheduling-interval.mjs.map +1 -1
- package/internal/utils/assert.d.ts +2 -0
- package/internal/utils/dom/index.d.ts +1 -0
- package/internal/utils/dom/is-element.d.ts +1 -1
- package/internal/utils/dom/is-event-target.d.ts +1 -0
- package/internal/utils/files/index.d.ts +1 -0
- package/internal/utils/files/is-accepted-file.d.ts +11 -0
- package/internal/utils/index.d.ts +3 -0
- package/internal/utils/to-element.d.ts +1 -1
- package/internal/utils/unref-element.d.ts +2 -0
- package/observers/index.d.ts +0 -1
- package/observers/intersection-observer/index.d.ts +22 -1
- package/observers/mutation-observer/index.d.ts +43 -1
- package/observers/resize-observer/index.d.ts +13 -1
- package/package.json +30 -26
- package/reactivity/debounced/index.d.ts +2 -2
- package/reactivity/throttled/index.d.ts +2 -2
- package/reactivity/watcher/index.d.ts +2 -2
- package/router/fragment/index.d.ts +1 -1
- package/router/params/index.d.ts +1 -1
- package/router/query-params/index.d.ts +5 -3
- package/router/route-data/index.d.ts +1 -1
- package/router/router-listener/index.d.ts +1 -1
- package/router/title/index.d.ts +1 -1
- package/router/url/index.d.ts +1 -1
- package/scheduling/debounce-callback/index.d.ts +1 -1
- package/scheduling/interval/index.d.ts +19 -27
- package/browser/pointer-lock-element/index.d.ts +0 -22
- package/browser/wake-lock/index.d.ts +0 -37
- package/fesm2022/signality-core-browser-pointer-lock-element.mjs +0 -43
- package/fesm2022/signality-core-browser-pointer-lock-element.mjs.map +0 -1
- package/fesm2022/signality-core-browser-wake-lock.mjs +0 -149
- package/fesm2022/signality-core-browser-wake-lock.mjs.map +0 -1
- package/fesm2022/signality-core-elements-text-selection.mjs.map +0 -1
- package/fesm2022/signality-core-elements-window-size.mjs.map +0 -1
- package/fesm2022/signality-core-observers-performance-observer.mjs +0 -84
- package/fesm2022/signality-core-observers-performance-observer.mjs.map +0 -1
- package/observers/performance-observer/index.d.ts +0 -58
|
@@ -1,49 +1,93 @@
|
|
|
1
1
|
import { type Signal } from '@angular/core';
|
|
2
|
-
import type { WithInjector } from '@signality/core/types';
|
|
3
|
-
export interface SpeechSynthesisSpeakOptions {
|
|
4
|
-
/** Text to speak */
|
|
5
|
-
readonly text: string;
|
|
6
|
-
/** Language code (e.g., 'en-US') */
|
|
7
|
-
readonly lang?: string;
|
|
8
|
-
/** Speech rate (0.1 to 10) */
|
|
9
|
-
readonly rate?: number;
|
|
10
|
-
/** Speech pitch (0 to 2) */
|
|
11
|
-
readonly pitch?: number;
|
|
12
|
-
/** Speech volume (0 to 1) */
|
|
13
|
-
readonly volume?: number;
|
|
14
|
-
/** Voice to use */
|
|
15
|
-
readonly voice?: SpeechSynthesisVoice;
|
|
16
|
-
}
|
|
2
|
+
import type { MaybeSignal, WithInjector } from '@signality/core/types';
|
|
17
3
|
export interface SpeechSynthesisOptions extends WithInjector {
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
/**
|
|
5
|
+
* BCP 47 language tag (e.g. `'en-US'`). Supports reactive values.
|
|
6
|
+
*
|
|
7
|
+
* @see [SpeechSynthesisUtterance: lang on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/lang)
|
|
8
|
+
*/
|
|
9
|
+
readonly lang?: MaybeSignal<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Speech rate from `0.1` to `10`. Supports reactive values.
|
|
12
|
+
*
|
|
13
|
+
* @default 1
|
|
14
|
+
* @see [SpeechSynthesisUtterance: rate on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/rate)
|
|
15
|
+
*/
|
|
16
|
+
readonly rate?: MaybeSignal<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Speech pitch from `0` to `2`. Supports reactive values.
|
|
19
|
+
*
|
|
20
|
+
* @default 1
|
|
21
|
+
* @see [SpeechSynthesisUtterance: pitch on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/pitch)
|
|
22
|
+
*/
|
|
23
|
+
readonly pitch?: MaybeSignal<number>;
|
|
24
|
+
/**
|
|
25
|
+
* Speech volume from `0` to `1`. Supports reactive values.
|
|
26
|
+
*
|
|
27
|
+
* @default 1
|
|
28
|
+
* @see [SpeechSynthesisUtterance: volume on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/volume)
|
|
29
|
+
*/
|
|
30
|
+
readonly volume?: MaybeSignal<number>;
|
|
31
|
+
/**
|
|
32
|
+
* Voice to use for synthesis. Supports reactive values.
|
|
33
|
+
*
|
|
34
|
+
* @see [SpeechSynthesisUtterance: voice on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/voice)
|
|
35
|
+
*/
|
|
36
|
+
readonly voice?: MaybeSignal<SpeechSynthesisVoice>;
|
|
28
37
|
}
|
|
29
38
|
export interface SpeechSynthesisRef {
|
|
30
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Whether the Speech Synthesis API is supported in the current browser.
|
|
41
|
+
*
|
|
42
|
+
* @see [SpeechSynthesis browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis#browser_compatibility)
|
|
43
|
+
*/
|
|
31
44
|
readonly isSupported: Signal<boolean>;
|
|
32
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Whether speech is currently being synthesized.
|
|
47
|
+
*
|
|
48
|
+
* @see [SpeechSynthesis: speaking on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/speaking)
|
|
49
|
+
*/
|
|
33
50
|
readonly isSpeaking: Signal<boolean>;
|
|
34
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Whether speech synthesis is currently paused.
|
|
53
|
+
*
|
|
54
|
+
* @see [SpeechSynthesis: paused on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/paused)
|
|
55
|
+
*/
|
|
35
56
|
readonly isPaused: Signal<boolean>;
|
|
36
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* List of available synthesis voices for the current device and browser.
|
|
59
|
+
*
|
|
60
|
+
* @see [SpeechSynthesis: getVoices() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/getVoices)
|
|
61
|
+
*/
|
|
37
62
|
readonly voices: Signal<SpeechSynthesisVoice[]>;
|
|
38
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* The text currently being spoken, or `''` if idle.
|
|
65
|
+
*/
|
|
39
66
|
readonly currentText: Signal<string>;
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Speak the given text, cancelling any ongoing utterance.
|
|
69
|
+
* Reads current reactive option values (`lang`, `rate`, `pitch`, `volume`, `voice`) at call time.
|
|
70
|
+
*
|
|
71
|
+
* @see [SpeechSynthesis: speak() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/speak)
|
|
72
|
+
*/
|
|
73
|
+
readonly speak: (text: string) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Cancel and stop the current utterance.
|
|
76
|
+
*
|
|
77
|
+
* @see [SpeechSynthesis: cancel() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/cancel)
|
|
78
|
+
*/
|
|
43
79
|
readonly stop: () => void;
|
|
44
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Pause the current utterance.
|
|
82
|
+
*
|
|
83
|
+
* @see [SpeechSynthesis: pause() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/pause)
|
|
84
|
+
*/
|
|
45
85
|
readonly pause: () => void;
|
|
46
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Resume a paused utterance.
|
|
88
|
+
*
|
|
89
|
+
* @see [SpeechSynthesis: resume() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/resume)
|
|
90
|
+
*/
|
|
47
91
|
readonly resume: () => void;
|
|
48
92
|
}
|
|
49
93
|
/**
|
|
@@ -57,19 +101,15 @@ export interface SpeechSynthesisRef {
|
|
|
57
101
|
* @Component({
|
|
58
102
|
* template: `
|
|
59
103
|
* @if (synthesis.isSupported()) {
|
|
60
|
-
* <button (click)="
|
|
104
|
+
* <button (click)="synthesis.speak('Hello, world!')" [disabled]="synthesis.isSpeaking()">
|
|
61
105
|
* {{ synthesis.isSpeaking() ? 'Speaking...' : 'Speak' }}
|
|
62
106
|
* </button>
|
|
63
107
|
* <button (click)="synthesis.stop()">Stop</button>
|
|
64
108
|
* }
|
|
65
109
|
* `
|
|
66
110
|
* })
|
|
67
|
-
* class
|
|
68
|
-
* readonly synthesis = speechSynthesis();
|
|
69
|
-
*
|
|
70
|
-
* speakText() {
|
|
71
|
-
* this.synthesis.speak('Hello, world!');
|
|
72
|
-
* }
|
|
111
|
+
* export class TextToSpeechDemo {
|
|
112
|
+
* readonly synthesis = speechSynthesis({ rate: 1.5 });
|
|
73
113
|
* }
|
|
74
114
|
* ```
|
|
75
115
|
*/
|
|
@@ -85,7 +85,7 @@ export interface Serializer<T> {
|
|
|
85
85
|
* <button (click)="count.set(count() + 1)">Increment</button>
|
|
86
86
|
* '
|
|
87
87
|
* })
|
|
88
|
-
* class
|
|
88
|
+
* export class UserPreview {
|
|
89
89
|
* readonly username = storage('username', '');
|
|
90
90
|
* readonly count = storage('counter', 0); // number serialization inferred
|
|
91
91
|
* readonly lastVisit = storage('lastVisit', new Date()); // Date serialization inferred
|
|
@@ -10,7 +10,7 @@ export interface TextDirectionOptions extends CreateSignalOptions<TextDirection>
|
|
|
10
10
|
*/
|
|
11
11
|
readonly target?: MaybeElementSignal<HTMLElement>;
|
|
12
12
|
/**
|
|
13
|
-
* Initial
|
|
13
|
+
* Initial value for SSR.
|
|
14
14
|
* @default 'ltr'
|
|
15
15
|
*/
|
|
16
16
|
readonly initialValue?: TextDirection;
|
|
@@ -19,9 +19,6 @@ export interface TextDirectionOptions extends CreateSignalOptions<TextDirection>
|
|
|
19
19
|
* Reactive read/write wrapper around an element's `dir` attribute for detecting and controlling
|
|
20
20
|
* [text directionality](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir).
|
|
21
21
|
*
|
|
22
|
-
* Returns a `WritableSignal` that reflects the current `dir` attribute value and updates the DOM
|
|
23
|
-
* when written to. Changes made to the attribute externally are picked up via `MutationObserver`.
|
|
24
|
-
*
|
|
25
22
|
* @param options - Optional configuration including target element, initial value and injector
|
|
26
23
|
* @returns A writable signal of the current text direction
|
|
27
24
|
*
|
|
@@ -34,7 +31,7 @@ export interface TextDirectionOptions extends CreateSignalOptions<TextDirection>
|
|
|
34
31
|
* <button (click)="dir.set('ltr')">Set LTR</button>
|
|
35
32
|
* `
|
|
36
33
|
* })
|
|
37
|
-
* class
|
|
34
|
+
* export class TextDirectionDemo {
|
|
38
35
|
* readonly dir = textDirection();
|
|
39
36
|
* }
|
|
40
37
|
* ```
|
|
@@ -1,34 +1,63 @@
|
|
|
1
1
|
import { type Signal } from '@angular/core';
|
|
2
2
|
import type { MaybeSignal, WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface VibrationOptions extends WithInjector {
|
|
4
|
+
/**
|
|
5
|
+
* Default vibration pattern in milliseconds. A single number vibrates for that duration;
|
|
6
|
+
* an array alternates between vibration and pause durations.
|
|
7
|
+
*
|
|
8
|
+
* @see [Navigator: vibrate() pattern on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate#pattern)
|
|
9
|
+
*/
|
|
4
10
|
readonly pattern?: MaybeSignal<number | number[]>;
|
|
5
11
|
}
|
|
6
12
|
export interface VibrationRef {
|
|
7
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Whether the Vibration API is supported in the current browser.
|
|
15
|
+
*
|
|
16
|
+
* @see [Vibration API browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API#browser_compatibility)
|
|
17
|
+
*/
|
|
8
18
|
readonly isSupported: Signal<boolean>;
|
|
9
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Whether the device is currently vibrating.
|
|
21
|
+
*/
|
|
10
22
|
readonly isVibrating: Signal<boolean>;
|
|
11
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Trigger vibration with an optional pattern. Falls back to the default pattern from options, then `200ms`.
|
|
25
|
+
*
|
|
26
|
+
* @see [Navigator: vibrate() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate)
|
|
27
|
+
*/
|
|
12
28
|
readonly vibrate: (pattern?: number | number[]) => void;
|
|
13
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Stop any active vibration by calling `navigator.vibrate(0)`.
|
|
31
|
+
*
|
|
32
|
+
* @see [Navigator: vibrate() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate)
|
|
33
|
+
*/
|
|
14
34
|
readonly stop: () => void;
|
|
15
35
|
}
|
|
16
36
|
/**
|
|
17
|
-
* Signal-based wrapper around the Vibration API.
|
|
37
|
+
* Signal-based wrapper around the [Vibration API](https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API).
|
|
18
38
|
*
|
|
19
39
|
* @param options - Optional configuration including default pattern and injector
|
|
20
40
|
* @returns A VibrationRef with vibration control methods
|
|
21
41
|
*
|
|
22
42
|
* @example
|
|
23
43
|
* ```typescript
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* vib.
|
|
27
|
-
* vib.vibrate(
|
|
44
|
+
* @Component({
|
|
45
|
+
* template: `
|
|
46
|
+
* @if (vib.isSupported()) {
|
|
47
|
+
* <button (click)="vib.vibrate(100)">Vibrate 100ms</button>
|
|
48
|
+
* <button (click)="vib.vibrate([100, 50, 100])">Pattern</button>
|
|
49
|
+
* <button (click)="vib.stop()">Stop</button>
|
|
50
|
+
* }
|
|
51
|
+
* `
|
|
52
|
+
* })
|
|
53
|
+
* export class VibrationDemo {
|
|
54
|
+
* readonly vib = vibration();
|
|
55
|
+
* }
|
|
28
56
|
* ```
|
|
29
57
|
*
|
|
30
58
|
* @example
|
|
31
59
|
* ```typescript
|
|
60
|
+
* // With a default pattern
|
|
32
61
|
* const vib = vibration({ pattern: 200 });
|
|
33
62
|
*
|
|
34
63
|
* vib.vibrate(); // Uses default 200ms pattern
|
|
@@ -2,26 +2,52 @@ import { type Signal } from '@angular/core';
|
|
|
2
2
|
import type { MaybeSignal, WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface WebNotificationOptions extends NotificationOptions, WithInjector {
|
|
4
4
|
/**
|
|
5
|
-
* Auto-close notification after specified milliseconds.
|
|
5
|
+
* Auto-close the notification after the specified number of milliseconds.
|
|
6
|
+
*
|
|
7
|
+
* @see [Notification: close() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/close)
|
|
6
8
|
*/
|
|
7
9
|
readonly autoClose?: MaybeSignal<number>;
|
|
8
10
|
}
|
|
9
11
|
export interface WebNotificationRef {
|
|
10
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Whether the Notifications API is supported in the current browser.
|
|
14
|
+
*
|
|
15
|
+
* @see [Notifications API browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API#browser_compatibility)
|
|
16
|
+
*/
|
|
11
17
|
readonly isSupported: Signal<boolean>;
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Current notification permission state: `'granted'`, `'denied'`, or `'default'`.
|
|
20
|
+
*
|
|
21
|
+
* @see [Notification: permission static property on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/permission_static)
|
|
22
|
+
*/
|
|
13
23
|
readonly permission: Signal<NotificationPermission>;
|
|
14
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The currently active notification instance, or `null` if none is shown.
|
|
26
|
+
*
|
|
27
|
+
* @see [Notification on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification)
|
|
28
|
+
*/
|
|
15
29
|
readonly notification: Signal<Notification | null>;
|
|
16
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Request permission to show notifications.
|
|
32
|
+
*
|
|
33
|
+
* @see [Notification: requestPermission() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission_static)
|
|
34
|
+
*/
|
|
17
35
|
readonly requestPermission: () => Promise<NotificationPermission>;
|
|
18
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Show a notification. Automatically closes the previous one. Per-call options override constructor defaults.
|
|
38
|
+
*
|
|
39
|
+
* @see [Notification() constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification)
|
|
40
|
+
*/
|
|
19
41
|
readonly show: (title: string, options?: NotificationOptions) => Notification | undefined;
|
|
20
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Close the currently active notification.
|
|
44
|
+
*
|
|
45
|
+
* @see [Notification: close() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/close)
|
|
46
|
+
*/
|
|
21
47
|
readonly close: () => void;
|
|
22
48
|
}
|
|
23
49
|
/**
|
|
24
|
-
* Signal-based wrapper around the Notifications API.
|
|
50
|
+
* Signal-based wrapper around the [Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API).
|
|
25
51
|
*
|
|
26
52
|
* Tracks the current notification as a signal. Calling `show()` auto-closes
|
|
27
53
|
* the previous notification. Calling `close()` closes the current one.
|
|
@@ -42,7 +68,7 @@ export interface WebNotificationRef {
|
|
|
42
68
|
* }
|
|
43
69
|
* `
|
|
44
70
|
* })
|
|
45
|
-
* class
|
|
71
|
+
* export class NotificationDemo {
|
|
46
72
|
* readonly notif = webNotification({ icon: '/icon.png' });
|
|
47
73
|
*
|
|
48
74
|
* async requestPermission() {
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { type Signal } from '@angular/core';
|
|
2
2
|
import type { WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface WebShareRef {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Whether the Web Share API is supported in the current browser.
|
|
6
|
+
*
|
|
7
|
+
* @see [Web Share API browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API#browser_compatibility)
|
|
8
|
+
*/
|
|
5
9
|
readonly isSupported: Signal<boolean>;
|
|
6
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Whether the native share dialog is currently open.
|
|
12
|
+
*/
|
|
7
13
|
readonly isSharing: Signal<boolean>;
|
|
8
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Open the native share dialog with the provided data.
|
|
16
|
+
*
|
|
17
|
+
* @see [Navigator: share() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share)
|
|
18
|
+
*/
|
|
9
19
|
readonly share: (data: ShareData) => Promise<void>;
|
|
10
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Check whether the given data can be shared via the Web Share API.
|
|
22
|
+
*
|
|
23
|
+
* @see [Navigator: canShare() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/canShare)
|
|
24
|
+
*/
|
|
11
25
|
readonly canShare: (data?: ShareData) => boolean;
|
|
12
26
|
}
|
|
13
27
|
/**
|
|
@@ -27,7 +41,7 @@ export interface WebShareRef {
|
|
|
27
41
|
* }
|
|
28
42
|
* `
|
|
29
43
|
* })
|
|
30
|
-
* class
|
|
44
|
+
* export class WebShareDemo {
|
|
31
45
|
* readonly webShare = webShare();
|
|
32
46
|
*
|
|
33
47
|
* async shareContent() {
|
|
@@ -2,35 +2,59 @@ import { type Signal } from '@angular/core';
|
|
|
2
2
|
import type { MaybeSignal, WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface WebWorkerOptions extends WithInjector {
|
|
4
4
|
/**
|
|
5
|
-
* Worker type.
|
|
5
|
+
* Worker script type.
|
|
6
|
+
*
|
|
6
7
|
* @default 'classic'
|
|
8
|
+
* @see [Worker: Worker() constructor — type on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker#type)
|
|
7
9
|
*/
|
|
8
10
|
readonly type?: 'classic' | 'module';
|
|
9
11
|
/**
|
|
10
|
-
* Credentials mode.
|
|
12
|
+
* Credentials mode used when fetching the worker script.
|
|
13
|
+
*
|
|
14
|
+
* @see [Worker: Worker() constructor — credentials on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker#credentials)
|
|
11
15
|
*/
|
|
12
16
|
readonly credentials?: RequestCredentials;
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
18
|
+
* Identifying name for the worker, useful for debugging in DevTools.
|
|
19
|
+
*
|
|
20
|
+
* @see [Worker: Worker() constructor — name on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker#name)
|
|
15
21
|
*/
|
|
16
22
|
readonly name?: string;
|
|
17
23
|
}
|
|
18
24
|
export interface WebWorkerRef<I, O> {
|
|
19
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The last message received from the worker via `postMessage`.
|
|
27
|
+
* `undefined` until the first message is received.
|
|
28
|
+
*/
|
|
20
29
|
readonly data: Signal<O | undefined>;
|
|
21
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Whether the worker has been successfully created and is ready to receive messages.
|
|
32
|
+
*/
|
|
22
33
|
readonly isReady: Signal<boolean>;
|
|
23
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The last error emitted by the worker, or `null` if no error has occurred.
|
|
36
|
+
*/
|
|
24
37
|
readonly error: Signal<Error | null>;
|
|
25
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Send a message to the worker.
|
|
40
|
+
*
|
|
41
|
+
* @see [Worker.postMessage() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage)
|
|
42
|
+
*/
|
|
26
43
|
readonly post: (data: I) => void;
|
|
27
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Terminate the worker immediately, discarding any pending messages.
|
|
46
|
+
*
|
|
47
|
+
* @see [Worker.terminate() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Worker/terminate)
|
|
48
|
+
*/
|
|
28
49
|
readonly terminate: () => void;
|
|
29
50
|
}
|
|
30
51
|
/**
|
|
31
|
-
* Signal-based wrapper around the Web Workers API.
|
|
52
|
+
* Signal-based wrapper around the [Web Workers API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
|
|
53
|
+
* Run scripts in background threads without blocking the main thread.
|
|
54
|
+
*
|
|
55
|
+
* When `url` is a signal, the worker is automatically recreated whenever the URL changes.
|
|
32
56
|
*
|
|
33
|
-
* @param url - Worker script URL
|
|
57
|
+
* @param url - Worker script URL (static or reactive signal)
|
|
34
58
|
* @param options - Optional configuration
|
|
35
59
|
* @returns A WebWorkerRef with data signal and control methods
|
|
36
60
|
*
|
|
@@ -44,7 +68,7 @@ export interface WebWorkerRef<I, O> {
|
|
|
44
68
|
* }
|
|
45
69
|
* `
|
|
46
70
|
* })
|
|
47
|
-
* class
|
|
71
|
+
* export class WorkerDemo {
|
|
48
72
|
* readonly worker = webWorker<number, number>('/workers/calc.js');
|
|
49
73
|
* }
|
|
50
74
|
* ```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CreateSignalOptions, type Signal } from '@angular/core';
|
|
2
|
+
import type { WithInjector } from '@signality/core/types';
|
|
3
|
+
export type WindowFocusOptions = CreateSignalOptions<boolean> & WithInjector;
|
|
4
|
+
/**
|
|
5
|
+
* Signal-based wrapper around the [Window focus/blur events](https://developer.mozilla.org/en-US/docs/Web/API/Window/focus_event).
|
|
6
|
+
*
|
|
7
|
+
* @param options - Optional configuration including signal options and injector
|
|
8
|
+
* @returns A signal containing the current window focus state (`true` if focused, `false` if blurred)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* @Component({
|
|
13
|
+
* template: `
|
|
14
|
+
* @if (isFocused()) {
|
|
15
|
+
* <p>Window is focused</p>
|
|
16
|
+
* } @else {
|
|
17
|
+
* <p>Window is not focused</p>
|
|
18
|
+
* }
|
|
19
|
+
* `
|
|
20
|
+
* })
|
|
21
|
+
* export class FocusDemo {
|
|
22
|
+
* readonly isFocused = windowFocus();
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function windowFocus(options?: WindowFocusOptions): Signal<boolean>;
|
|
27
|
+
export declare const WINDOW_FOCUS: import("@angular/core").ProviderToken<Signal<boolean>>;
|
|
@@ -3,21 +3,20 @@ import type { WithInjector } from '@signality/core/types';
|
|
|
3
3
|
export interface WindowSizeOptions extends CreateSignalOptions<WindowSizeValue>, WithInjector {
|
|
4
4
|
/**
|
|
5
5
|
* Include scrollbar in dimensions calculation.
|
|
6
|
+
*
|
|
6
7
|
* @default false
|
|
7
8
|
*/
|
|
8
9
|
readonly includeScrollbar?: boolean;
|
|
9
10
|
/**
|
|
10
|
-
* Initial
|
|
11
|
+
* Initial value for SSR and before the first measurement.
|
|
12
|
+
*
|
|
13
|
+
* @default { width: 0, height: 0 }
|
|
11
14
|
*/
|
|
12
|
-
readonly initialValue?:
|
|
15
|
+
readonly initialValue?: WindowSizeValue;
|
|
13
16
|
}
|
|
14
17
|
export interface WindowSizeValue {
|
|
15
18
|
readonly width: number;
|
|
16
19
|
readonly height: number;
|
|
17
|
-
readonly innerWidth: number;
|
|
18
|
-
readonly innerHeight: number;
|
|
19
|
-
readonly outerWidth: number;
|
|
20
|
-
readonly outerHeight: number;
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
22
|
* Signal-based wrapper around the [Window API](https://developer.mozilla.org/en-US/docs/Web/API/Window) dimensions.
|
|
@@ -37,7 +36,7 @@ export interface WindowSizeValue {
|
|
|
37
36
|
* </div>
|
|
38
37
|
* `
|
|
39
38
|
* })
|
|
40
|
-
* class WindowSizeComponent {
|
|
39
|
+
* export class WindowSizeComponent {
|
|
41
40
|
* readonly size = windowSize();
|
|
42
41
|
* }
|
|
43
42
|
* ```
|
|
@@ -2,27 +2,77 @@ import { type Signal, type WritableSignal } from '@angular/core';
|
|
|
2
2
|
import type { MaybeElementSignal, MaybeSignal, WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface DropzoneOptions extends WithInjector {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Comma-separated list of accepted file types, matching the native HTML
|
|
6
|
+
* [`accept`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept) attribute format.
|
|
7
|
+
* Supports MIME types (`'image/png'`), wildcards (`'image/*'`), and file extensions (`'.pdf'`).
|
|
8
|
+
* Use `'*'` to accept all file types.
|
|
9
|
+
*
|
|
10
|
+
* @default '*'
|
|
11
|
+
* @see [accept attribute on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept)
|
|
7
12
|
*/
|
|
8
|
-
readonly accept?: MaybeSignal<string
|
|
13
|
+
readonly accept?: MaybeSignal<string>;
|
|
9
14
|
/**
|
|
10
|
-
*
|
|
15
|
+
* Whether to allow dropping multiple files at once.
|
|
16
|
+
* When `false`, only the first accepted file is kept.
|
|
17
|
+
*
|
|
11
18
|
* @default true
|
|
12
19
|
*/
|
|
13
20
|
readonly multiple?: MaybeSignal<boolean>;
|
|
14
21
|
/**
|
|
15
|
-
*
|
|
22
|
+
* When `true`, prevents files from being dropped anywhere outside the drop zone
|
|
23
|
+
* by intercepting `dragover` and `drop` events on the document.
|
|
24
|
+
*
|
|
16
25
|
* @default true
|
|
17
26
|
*/
|
|
18
27
|
readonly preventDocumentDrop?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Custom validation predicate called for each dropped file.
|
|
30
|
+
* Return `true` to keep the file, `false` to reject it.
|
|
31
|
+
*
|
|
32
|
+
* When provided, the `accept` option is ignored — the validator
|
|
33
|
+
* takes full responsibility for deciding which files are valid.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* dropzone(target, {
|
|
38
|
+
* validator: (file) => file.size <= 5 * 1024 * 1024, // max 5 MB
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
readonly validator?: (file: File) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Callback invoked with files that were rejected during a drop.
|
|
45
|
+
* Called once per drop with the full array of rejected files.
|
|
46
|
+
* Useful for showing toast notifications or validation errors.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* dropzone(target, {
|
|
51
|
+
* accept: 'image/*',
|
|
52
|
+
* onReject: (rejected) => {
|
|
53
|
+
* rejected.forEach(f => toast.error(`${f.name} is not an image`));
|
|
54
|
+
* },
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
readonly onReject?: (files: File[]) => void;
|
|
19
59
|
}
|
|
20
60
|
export interface DropzoneRef {
|
|
21
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* List of files dropped onto the zone, filtered by `accept` and `multiple`.
|
|
63
|
+
* A `WritableSignal` — can be reset externally (e.g. after upload).
|
|
64
|
+
*
|
|
65
|
+
* @see [DataTransfer.files on MDN](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/files)
|
|
66
|
+
*/
|
|
22
67
|
readonly files: WritableSignal<File[]>;
|
|
23
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Whether the user is currently dragging over the drop zone.
|
|
70
|
+
*/
|
|
24
71
|
readonly isOver: Signal<boolean>;
|
|
25
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Whether any drag operation is in progress anywhere on the document.
|
|
74
|
+
* Useful for showing a global drop overlay.
|
|
75
|
+
*/
|
|
26
76
|
readonly isDragging: Signal<boolean>;
|
|
27
77
|
}
|
|
28
78
|
/**
|
|
@@ -52,9 +102,9 @@ export interface DropzoneRef {
|
|
|
52
102
|
* </div>
|
|
53
103
|
* `
|
|
54
104
|
* })
|
|
55
|
-
* class
|
|
105
|
+
* export class DropzoneDemo {
|
|
56
106
|
* readonly zone = viewChild<ElementRef>('zone');
|
|
57
|
-
* readonly drop = dropzone(this.zone, { accept:
|
|
107
|
+
* readonly drop = dropzone(this.zone, { accept: 'image/*', multiple: true });
|
|
58
108
|
* }
|
|
59
109
|
* ```
|
|
60
110
|
*/
|
|
@@ -29,7 +29,7 @@ export interface ElementFocusOptions extends CreateSignalOptions<boolean>, WithI
|
|
|
29
29
|
* }
|
|
30
30
|
* `
|
|
31
31
|
* })
|
|
32
|
-
* class
|
|
32
|
+
* export class FocusDemo {
|
|
33
33
|
* readonly input = viewChild<ElementRef>('input');
|
|
34
34
|
* readonly isFocused = elementFocus(this.input);
|
|
35
35
|
* }
|
|
@@ -20,7 +20,7 @@ export type ElementFocusWithinOptions = CreateSignalOptions<boolean> & WithInjec
|
|
|
20
20
|
* </div>
|
|
21
21
|
* `
|
|
22
22
|
* })
|
|
23
|
-
* class
|
|
23
|
+
* export class FocusWithinDemo {
|
|
24
24
|
* readonly container = viewChild<ElementRef>('container');
|
|
25
25
|
* readonly isFocusedWithin = elementFocusWithin(this.container);
|
|
26
26
|
* }
|
|
@@ -18,7 +18,7 @@ export type ElementHoverOptions = CreateSignalOptions<boolean> & WithInjector;
|
|
|
18
18
|
* </div>
|
|
19
19
|
* `
|
|
20
20
|
* })
|
|
21
|
-
* class
|
|
21
|
+
* export class HoverDemo {
|
|
22
22
|
* readonly box = viewChild<ElementRef>('box');
|
|
23
23
|
* readonly isHovered = elementHover(this.box);
|
|
24
24
|
* }
|