@signality/core 0.0.1-alpha.2 → 0.0.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 -1
- 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/wake-lock/index.d.ts +51 -12
- 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 +7 -19
- 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-wake-lock.mjs +33 -16
- package/fesm2022/signality-core-browser-wake-lock.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 -1
- 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 +27 -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 +25 -17
- 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/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-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,28 +1,58 @@
|
|
|
1
1
|
import { type Signal } from '@angular/core';
|
|
2
2
|
import type { WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface GamepadRef {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Whether the Gamepad API is supported in the current browser.
|
|
6
|
+
*
|
|
7
|
+
* @see [Gamepad API browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API#browser_compatibility)
|
|
8
|
+
*/
|
|
5
9
|
readonly isSupported: Signal<boolean>;
|
|
6
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Array of all connected gamepads. Indices match the gamepad's `index` property. May contain `null` for disconnected slots.
|
|
12
|
+
*
|
|
13
|
+
* @see [Navigator: getGamepads() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getGamepads)
|
|
14
|
+
*/
|
|
7
15
|
readonly gamepads: Signal<(Gamepad | null)[]>;
|
|
8
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The first connected gamepad, or `undefined` if none are connected.
|
|
18
|
+
*
|
|
19
|
+
* @see [Gamepad on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad)
|
|
20
|
+
*/
|
|
9
21
|
readonly activeGamepad: Signal<Gamepad | undefined>;
|
|
10
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Axes values of the active gamepad. Each value is in the range `[-1, 1]`.
|
|
24
|
+
*
|
|
25
|
+
* @see [Gamepad: axes on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/axes)
|
|
26
|
+
*/
|
|
11
27
|
readonly axes: Signal<readonly number[]>;
|
|
12
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Button states of the active gamepad.
|
|
30
|
+
*
|
|
31
|
+
* @see [Gamepad: buttons on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/buttons)
|
|
32
|
+
*/
|
|
13
33
|
readonly buttons: Signal<readonly GamepadButton[]>;
|
|
14
34
|
}
|
|
15
35
|
/**
|
|
16
|
-
* Signal-based wrapper around the Gamepad API.
|
|
36
|
+
* Signal-based wrapper around the [Gamepad API](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API).
|
|
17
37
|
*
|
|
18
38
|
* @param options - Optional injector for DI context
|
|
19
39
|
* @returns A GamepadRef with gamepad state signals
|
|
20
40
|
*
|
|
21
41
|
* @example
|
|
22
42
|
* ```typescript
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
43
|
+
* @Component({
|
|
44
|
+
* template: `
|
|
45
|
+
* @if (gp.isSupported()) {
|
|
46
|
+
* @for (pad of gp.gamepads(); track pad?.index) {
|
|
47
|
+
* <p>{{ pad?.id }}</p>
|
|
48
|
+
* }
|
|
49
|
+
* <p>Axes: {{ gp.axes() }}</p>
|
|
50
|
+
* }
|
|
51
|
+
* `
|
|
52
|
+
* })
|
|
53
|
+
* export class GamepadDemo {
|
|
54
|
+
* readonly gp = gamepad();
|
|
55
|
+
* }
|
|
26
56
|
* ```
|
|
27
57
|
*/
|
|
28
58
|
export declare function gamepad(options?: WithInjector): GamepadRef;
|
|
@@ -2,40 +2,71 @@ import { type Signal } from '@angular/core';
|
|
|
2
2
|
import type { WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface GeolocationOptions extends WithInjector {
|
|
4
4
|
/**
|
|
5
|
-
* Start tracking immediately.
|
|
6
|
-
*
|
|
5
|
+
* Start tracking immediately on initialization.
|
|
6
|
+
*
|
|
7
|
+
* @default false
|
|
7
8
|
*/
|
|
8
9
|
readonly immediate?: boolean;
|
|
9
10
|
/**
|
|
10
|
-
* Use GPS for
|
|
11
|
+
* Use GPS for higher accuracy. May be slower and consume more power.
|
|
12
|
+
*
|
|
11
13
|
* @default true
|
|
14
|
+
* @see [PositionOptions: enableHighAccuracy on MDN](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions/enableHighAccuracy)
|
|
12
15
|
*/
|
|
13
16
|
readonly enableHighAccuracy?: boolean;
|
|
14
17
|
/**
|
|
15
|
-
*
|
|
18
|
+
* Maximum age of a cached position in milliseconds. `0` forces a fresh lookup.
|
|
19
|
+
*
|
|
16
20
|
* @default 0
|
|
21
|
+
* @see [PositionOptions: maximumAge on MDN](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions/maximumAge)
|
|
17
22
|
*/
|
|
18
23
|
readonly maximumAge?: number;
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
25
|
+
* Maximum time in milliseconds allowed to retrieve a position before erroring.
|
|
26
|
+
*
|
|
21
27
|
* @default Infinity
|
|
28
|
+
* @see [PositionOptions: timeout on MDN](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions/timeout)
|
|
22
29
|
*/
|
|
23
30
|
readonly timeout?: number;
|
|
24
31
|
}
|
|
25
32
|
export interface GeolocationRef {
|
|
26
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Whether the Geolocation API is supported in the current browser.
|
|
35
|
+
*
|
|
36
|
+
* @see [Geolocation API browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API#browser_compatibility)
|
|
37
|
+
*/
|
|
27
38
|
readonly isSupported: Signal<boolean>;
|
|
28
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The most recent position, including coordinates and timestamp. `null` until first fix.
|
|
41
|
+
*
|
|
42
|
+
* @see [GeolocationPosition on MDN](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPosition)
|
|
43
|
+
*/
|
|
29
44
|
readonly position: Signal<GeolocationPosition | null>;
|
|
30
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* The last error returned by the Geolocation API, or `null` if no error.
|
|
47
|
+
*
|
|
48
|
+
* @see [GeolocationPositionError on MDN](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPositionError)
|
|
49
|
+
*/
|
|
31
50
|
readonly error: Signal<GeolocationPositionError | null>;
|
|
32
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Whether position watching is currently active.
|
|
53
|
+
*/
|
|
33
54
|
readonly isActive: Signal<boolean>;
|
|
34
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Whether a position fix is currently being fetched.
|
|
57
|
+
*/
|
|
35
58
|
readonly isLoading: Signal<boolean>;
|
|
36
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Start watching the device position.
|
|
61
|
+
*
|
|
62
|
+
* @see [Geolocation: watchPosition() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition)
|
|
63
|
+
*/
|
|
37
64
|
readonly start: () => void;
|
|
38
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Stop watching the device position.
|
|
67
|
+
*
|
|
68
|
+
* @see [Geolocation: clearWatch() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/clearWatch)
|
|
69
|
+
*/
|
|
39
70
|
readonly stop: () => void;
|
|
40
71
|
}
|
|
41
72
|
/**
|
|
@@ -56,7 +87,7 @@ export interface GeolocationRef {
|
|
|
56
87
|
* <button (click)="geo.stop()">Stop</button>
|
|
57
88
|
* <button (click)="geo.start()">Start</button>
|
|
58
89
|
* })
|
|
59
|
-
* class
|
|
90
|
+
* export class LocationDemo {
|
|
60
91
|
* readonly geo = geolocation();
|
|
61
92
|
* }
|
|
62
93
|
* ```
|
package/browser/index.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ export * from '@signality/core/browser/clipboard';
|
|
|
7
7
|
export * from '@signality/core/browser/device-posture';
|
|
8
8
|
export * from '@signality/core/browser/display-media';
|
|
9
9
|
export * from '@signality/core/browser/eye-dropper';
|
|
10
|
+
export * from '@signality/core/browser/file-dialog';
|
|
10
11
|
export * from '@signality/core/browser/favicon';
|
|
11
12
|
export * from '@signality/core/browser/fps';
|
|
13
|
+
export * from '@signality/core/browser/fullscreen';
|
|
12
14
|
export * from '@signality/core/browser/gamepad';
|
|
13
15
|
export * from '@signality/core/browser/geolocation';
|
|
14
16
|
export * from '@signality/core/browser/input-modality';
|
|
@@ -16,14 +18,19 @@ export * from '@signality/core/browser/listener';
|
|
|
16
18
|
export * from '@signality/core/browser/media-query';
|
|
17
19
|
export * from '@signality/core/browser/network';
|
|
18
20
|
export * from '@signality/core/browser/online';
|
|
21
|
+
export * from '@signality/core/browser/permission-state';
|
|
19
22
|
export * from '@signality/core/browser/page-visibility';
|
|
20
23
|
export * from '@signality/core/browser/picture-in-picture';
|
|
21
|
-
export * from '@signality/core/browser/
|
|
24
|
+
export * from '@signality/core/browser/screen-orientation';
|
|
22
25
|
export * from '@signality/core/browser/speech-recognition';
|
|
23
26
|
export * from '@signality/core/browser/speech-synthesis';
|
|
24
27
|
export * from '@signality/core/browser/storage';
|
|
25
28
|
export * from '@signality/core/browser/text-direction';
|
|
29
|
+
export * from '@signality/core/browser/text-selection';
|
|
26
30
|
export * from '@signality/core/browser/vibration';
|
|
27
31
|
export * from '@signality/core/browser/wake-lock';
|
|
28
32
|
export * from '@signality/core/browser/web-notification';
|
|
33
|
+
export * from '@signality/core/browser/web-share';
|
|
29
34
|
export * from '@signality/core/browser/web-worker';
|
|
35
|
+
export * from '@signality/core/browser/window-focus';
|
|
36
|
+
export * from '@signality/core/browser/window-size';
|
|
@@ -4,23 +4,51 @@ export type EffectiveConnectionType = 'slow-2g' | '2g' | '3g' | '4g';
|
|
|
4
4
|
export type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'wifi' | 'wimax' | 'none' | 'other' | 'unknown';
|
|
5
5
|
export type NetworkOptions = WithInjector;
|
|
6
6
|
export interface NetworkRef {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Whether the Network Information API is supported in the current browser.
|
|
9
|
+
*
|
|
10
|
+
* @see [Network Information API browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API#browser_compatibility)
|
|
11
|
+
*/
|
|
8
12
|
readonly isSupported: Signal<boolean>;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Whether the browser currently has network connectivity.
|
|
15
|
+
*
|
|
16
|
+
* @see [Navigator: onLine on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine)
|
|
17
|
+
*/
|
|
10
18
|
readonly isOnline: Signal<boolean>;
|
|
11
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Estimated effective connection type based on recently observed network conditions.
|
|
21
|
+
*
|
|
22
|
+
* @see [NetworkInformation: effectiveType on MDN](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/effectiveType)
|
|
23
|
+
*/
|
|
12
24
|
readonly effectiveType: Signal<EffectiveConnectionType | undefined>;
|
|
13
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Estimated downlink bandwidth in Mbps.
|
|
27
|
+
*
|
|
28
|
+
* @see [NetworkInformation: downlink on MDN](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlink)
|
|
29
|
+
*/
|
|
14
30
|
readonly downlink: Signal<number | undefined>;
|
|
15
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Estimated round-trip latency in milliseconds.
|
|
33
|
+
*
|
|
34
|
+
* @see [NetworkInformation: rtt on MDN](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/rtt)
|
|
35
|
+
*/
|
|
16
36
|
readonly rtt: Signal<number | undefined>;
|
|
17
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Whether the user has enabled a data-saving mode in their browser or OS.
|
|
39
|
+
*
|
|
40
|
+
* @see [NetworkInformation: saveData on MDN](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/saveData)
|
|
41
|
+
*/
|
|
18
42
|
readonly saveData: Signal<boolean>;
|
|
19
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* The physical connection type (e.g. `'wifi'`, `'cellular'`).
|
|
45
|
+
*
|
|
46
|
+
* @see [NetworkInformation: type on MDN](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/type)
|
|
47
|
+
*/
|
|
20
48
|
readonly type: Signal<ConnectionType | undefined>;
|
|
21
49
|
}
|
|
22
50
|
/**
|
|
23
|
-
* Signal-based wrapper around the Network Information API and online/offline events.
|
|
51
|
+
* Signal-based wrapper around the [Network Information API](https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API) and online/offline events.
|
|
24
52
|
*
|
|
25
53
|
* @param options - Optional configuration including injector
|
|
26
54
|
* @returns A NetworkRef with network status signals
|
|
@@ -35,7 +63,7 @@ export interface NetworkRef {
|
|
|
35
63
|
* }
|
|
36
64
|
* `
|
|
37
65
|
* })
|
|
38
|
-
* class NetworkComponent {
|
|
66
|
+
* export class NetworkComponent {
|
|
39
67
|
* readonly net = network();
|
|
40
68
|
* }
|
|
41
69
|
* ```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type CreateSignalOptions, type Signal } from '@angular/core';
|
|
2
|
+
import type { WithInjector } from '@signality/core/types';
|
|
3
|
+
export type PermissionStateOptions = CreateSignalOptions<PermissionState> & WithInjector;
|
|
4
|
+
/**
|
|
5
|
+
* Signal-based wrapper around the [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API).
|
|
6
|
+
*
|
|
7
|
+
* @param name - The permission name to query
|
|
8
|
+
* @param options - Optional configuration including signal options and injector
|
|
9
|
+
* @returns A signal containing the current `PermissionState` (`'granted'`, `'denied'`, or `'prompt'`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* @Component({
|
|
14
|
+
* template: `
|
|
15
|
+
* <p>Camera permission: {{ cameraPermission() }}</p>
|
|
16
|
+
* `
|
|
17
|
+
* })
|
|
18
|
+
* export class PermissionDemo {
|
|
19
|
+
* readonly cameraPermission = permissionState('camera');
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function permissionState(name: PermissionName, options?: PermissionStateOptions): Signal<PermissionState>;
|
|
@@ -2,15 +2,33 @@ import { type Signal } from '@angular/core';
|
|
|
2
2
|
import type { MaybeElementSignal, WithInjector } from '@signality/core/types';
|
|
3
3
|
export type PictureInPictureOptions = WithInjector;
|
|
4
4
|
export interface PictureInPictureRef {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Whether the Picture-in-Picture API is supported in the current browser.
|
|
7
|
+
*
|
|
8
|
+
* @see [Picture-in-Picture API browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_API#browser_compatibility)
|
|
9
|
+
*/
|
|
6
10
|
readonly isSupported: Signal<boolean>;
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Whether the target video element is currently displayed in Picture-in-Picture mode.
|
|
13
|
+
*
|
|
14
|
+
* @see [Document: pictureInPictureElement on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/pictureInPictureElement)
|
|
15
|
+
*/
|
|
8
16
|
readonly isActive: Signal<boolean>;
|
|
9
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Enter Picture-in-Picture mode for the target video element.
|
|
19
|
+
*
|
|
20
|
+
* @see [HTMLVideoElement: requestPictureInPicture() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/requestPictureInPicture)
|
|
21
|
+
*/
|
|
10
22
|
readonly enter: () => Promise<void>;
|
|
11
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Exit Picture-in-Picture mode.
|
|
25
|
+
*
|
|
26
|
+
* @see [Document: exitPictureInPicture() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/exitPictureInPicture)
|
|
27
|
+
*/
|
|
12
28
|
readonly exit: () => Promise<void>;
|
|
13
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Toggle Picture-in-Picture mode — enters if inactive, exits if active.
|
|
31
|
+
*/
|
|
14
32
|
readonly toggle: () => Promise<void>;
|
|
15
33
|
}
|
|
16
34
|
/**
|
|
@@ -33,7 +51,7 @@ export interface PictureInPictureRef {
|
|
|
33
51
|
* }
|
|
34
52
|
* `
|
|
35
53
|
* })
|
|
36
|
-
* class
|
|
54
|
+
* export class PiPDemo {
|
|
37
55
|
* readonly video = viewChild<HTMLVideoElement>('video');
|
|
38
56
|
* readonly pip = pictureInPicture(this.video);
|
|
39
57
|
* }
|
|
@@ -21,7 +21,7 @@ export interface ScreenOrientationOptions extends CreateSignalOptions<Orientatio
|
|
|
21
21
|
* <p>Orientation: {{ orientation() }}</p>
|
|
22
22
|
* `
|
|
23
23
|
* })
|
|
24
|
-
* class
|
|
24
|
+
* export class OrientationDemo {
|
|
25
25
|
* readonly orientation = screenOrientation();
|
|
26
26
|
* }
|
|
27
27
|
* ```
|
|
@@ -2,42 +2,80 @@ import { type Signal } from '@angular/core';
|
|
|
2
2
|
import type { MaybeSignal, WithInjector } from '@signality/core/types';
|
|
3
3
|
export interface SpeechRecognitionOptions extends WithInjector {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* BCP 47 language tag for recognition (e.g. `'en-US'`).
|
|
6
|
+
*
|
|
6
7
|
* @default 'en-US'
|
|
8
|
+
* @see [SpeechRecognition: lang on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/lang)
|
|
7
9
|
*/
|
|
8
10
|
readonly lang?: MaybeSignal<string>;
|
|
9
11
|
/**
|
|
10
|
-
* Whether to return interim results.
|
|
12
|
+
* Whether to return interim (in-progress) results alongside final ones.
|
|
13
|
+
*
|
|
11
14
|
* @default false
|
|
15
|
+
* @see [SpeechRecognition: interimResults on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/interimResults)
|
|
12
16
|
*/
|
|
13
17
|
readonly interimResults?: boolean;
|
|
14
18
|
/**
|
|
15
|
-
* Whether
|
|
19
|
+
* Whether recognition continues after the user stops speaking.
|
|
20
|
+
*
|
|
16
21
|
* @default false
|
|
22
|
+
* @see [SpeechRecognition: continuous on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/continuous)
|
|
17
23
|
*/
|
|
18
24
|
readonly continuous?: boolean;
|
|
19
25
|
/**
|
|
20
|
-
* Maximum number of alternative
|
|
26
|
+
* Maximum number of alternative recognition results per utterance.
|
|
27
|
+
*
|
|
21
28
|
* @default 1
|
|
29
|
+
* @see [SpeechRecognition: maxAlternatives on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/maxAlternatives)
|
|
22
30
|
*/
|
|
23
31
|
readonly maxAlternatives?: number;
|
|
24
32
|
}
|
|
25
33
|
export interface SpeechRecognitionRef {
|
|
26
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Whether the Speech Recognition API is supported in the current browser.
|
|
36
|
+
*
|
|
37
|
+
* @see [SpeechRecognition browser compatibility on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#browser_compatibility)
|
|
38
|
+
*/
|
|
27
39
|
readonly isSupported: Signal<boolean>;
|
|
28
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Whether speech recognition is currently active and listening.
|
|
42
|
+
*/
|
|
29
43
|
readonly isListening: Signal<boolean>;
|
|
30
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Accumulated final transcript text.
|
|
46
|
+
*
|
|
47
|
+
* @see [SpeechRecognitionResult on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionResult)
|
|
48
|
+
*/
|
|
31
49
|
readonly text: Signal<string>;
|
|
32
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* In-progress interim transcript. Only populated when `interimResults` is `true`.
|
|
52
|
+
*
|
|
53
|
+
* @see [SpeechRecognition: interimResults on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/interimResults)
|
|
54
|
+
*/
|
|
33
55
|
readonly interimText: Signal<string>;
|
|
34
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* The last recognition error, or `null` if no error occurred.
|
|
58
|
+
*
|
|
59
|
+
* @see [SpeechRecognitionErrorEvent on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionErrorEvent)
|
|
60
|
+
*/
|
|
35
61
|
readonly error: Signal<SpeechRecognitionErrorEvent | Error | null>;
|
|
36
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Start listening for speech input.
|
|
64
|
+
*
|
|
65
|
+
* @see [SpeechRecognition: start() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/start)
|
|
66
|
+
*/
|
|
37
67
|
readonly start: () => void;
|
|
38
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Stop listening and return any remaining results.
|
|
70
|
+
*
|
|
71
|
+
* @see [SpeechRecognition: stop() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/stop)
|
|
72
|
+
*/
|
|
39
73
|
readonly stop: () => void;
|
|
40
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Abort recognition immediately without returning results.
|
|
76
|
+
*
|
|
77
|
+
* @see [SpeechRecognition: abort() on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/abort)
|
|
78
|
+
*/
|
|
41
79
|
readonly abort: () => void;
|
|
42
80
|
}
|
|
43
81
|
/**
|
|
@@ -61,7 +99,7 @@ export interface SpeechRecognitionRef {
|
|
|
61
99
|
* }
|
|
62
100
|
* `
|
|
63
101
|
* })
|
|
64
|
-
* class SpeechComponent {
|
|
102
|
+
* export class SpeechComponent {
|
|
65
103
|
* readonly recognition = speechRecognition();
|
|
66
104
|
*
|
|
67
105
|
* toggleRecognition() {
|
|
@@ -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
|