@angular-helpers/browser-web-apis 21.4.0 → 21.6.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/README.es.md +68 -4
- package/README.md +64 -5
- package/fesm2022/angular-helpers-browser-web-apis-experimental.mjs +478 -0
- package/fesm2022/angular-helpers-browser-web-apis.mjs +739 -925
- package/package.json +6 -2
- package/types/angular-helpers-browser-web-apis-experimental.d.ts +325 -0
- package/types/angular-helpers-browser-web-apis.d.ts +253 -397
|
@@ -1,32 +1,15 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { DestroyRef, ElementRef, Signal, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { DestroyRef, ElementRef, Signal, InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
4
4
|
import { CanActivateFn } from '@angular/router';
|
|
5
5
|
|
|
6
|
-
type PermissionNameExt = PermissionName | 'clipboard-read' | 'clipboard-write';
|
|
7
|
-
interface PermissionRequest {
|
|
8
|
-
name: PermissionNameExt;
|
|
9
|
-
state: PermissionState;
|
|
10
|
-
}
|
|
11
|
-
interface BrowserPermissions {
|
|
12
|
-
query(descriptor: PermissionDescriptor): Promise<PermissionStatus>;
|
|
13
|
-
isSupported(): boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare class PermissionsService implements BrowserPermissions {
|
|
17
|
-
query(descriptor: PermissionDescriptor): Promise<PermissionStatus>;
|
|
18
|
-
isSupported(): boolean;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PermissionsService, never>;
|
|
20
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<PermissionsService>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
6
|
/**
|
|
24
7
|
* Base class for all Browser Web API services.
|
|
25
8
|
* Provides common functionality for:
|
|
26
9
|
* - Platform detection (browser vs server)
|
|
27
10
|
* - Support assertion via Template Method
|
|
28
11
|
* - Error creation with cause chaining
|
|
29
|
-
* - Structured logging
|
|
12
|
+
* - Structured logging via injectable BROWSER_API_LOGGER token
|
|
30
13
|
* - Lifecycle management with destroyRef
|
|
31
14
|
*
|
|
32
15
|
* Services that also need permission querying should extend
|
|
@@ -35,6 +18,7 @@ declare class PermissionsService implements BrowserPermissions {
|
|
|
35
18
|
declare abstract class BrowserApiBaseService {
|
|
36
19
|
protected destroyRef: DestroyRef;
|
|
37
20
|
protected platformId: Object;
|
|
21
|
+
private readonly logger;
|
|
38
22
|
/**
|
|
39
23
|
* Abstract method that must be implemented by child services.
|
|
40
24
|
* Returns the API name used in log messages and error strings.
|
|
@@ -49,8 +33,8 @@ declare abstract class BrowserApiBaseService {
|
|
|
49
33
|
*/
|
|
50
34
|
protected isServerEnvironment(): boolean;
|
|
51
35
|
/**
|
|
52
|
-
* Template Method:
|
|
53
|
-
*
|
|
36
|
+
* Template Method: asserts the service can run in the current environment.
|
|
37
|
+
* Subclasses must call super.ensureSupported() and then add their own API check.
|
|
54
38
|
*/
|
|
55
39
|
protected ensureSupported(): void;
|
|
56
40
|
/**
|
|
@@ -58,40 +42,43 @@ declare abstract class BrowserApiBaseService {
|
|
|
58
42
|
*/
|
|
59
43
|
protected createError(message: string, cause?: unknown): Error;
|
|
60
44
|
/**
|
|
61
|
-
* Log an error
|
|
45
|
+
* Log an error through the injected BROWSER_API_LOGGER (default: console).
|
|
62
46
|
*/
|
|
63
47
|
protected logError(message: string, error?: unknown): void;
|
|
64
48
|
/**
|
|
65
|
-
* Log
|
|
49
|
+
* Log a warning through the injected BROWSER_API_LOGGER (default: console).
|
|
50
|
+
*/
|
|
51
|
+
protected logWarn(message: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Log an informational message through the injected BROWSER_API_LOGGER (default: console).
|
|
66
54
|
*/
|
|
67
55
|
protected logInfo(message: string): void;
|
|
68
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<BrowserApiBaseService, never>;
|
|
69
57
|
static ɵprov: i0.ɵɵInjectableDeclaration<BrowserApiBaseService>;
|
|
70
58
|
}
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
declare abstract class PermissionAwareBrowserApiBaseService extends BrowserApiBaseService {
|
|
81
|
-
protected permissionsService: PermissionsService;
|
|
82
|
-
/**
|
|
83
|
-
* Query the Permissions API for the given permission name.
|
|
84
|
-
* Returns `true` if the permission state is `'granted'`.
|
|
85
|
-
*/
|
|
86
|
-
protected requestPermission(permission: PermissionNameExt): Promise<boolean>;
|
|
87
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PermissionAwareBrowserApiBaseService, never>;
|
|
88
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<PermissionAwareBrowserApiBaseService>;
|
|
60
|
+
type PermissionNameExt = PermissionName | 'clipboard-read' | 'clipboard-write';
|
|
61
|
+
interface PermissionRequest {
|
|
62
|
+
name: PermissionNameExt;
|
|
63
|
+
state: PermissionState;
|
|
64
|
+
}
|
|
65
|
+
interface BrowserPermissions {
|
|
66
|
+
query(descriptor: PermissionDescriptor): Promise<PermissionStatus>;
|
|
67
|
+
isSupported(): boolean;
|
|
89
68
|
}
|
|
90
69
|
|
|
91
|
-
declare class
|
|
70
|
+
declare class PermissionsService extends BrowserApiBaseService implements BrowserPermissions {
|
|
71
|
+
protected getApiName(): string;
|
|
72
|
+
query(descriptor: PermissionDescriptor): Promise<PermissionStatus>;
|
|
73
|
+
isSupported(): boolean;
|
|
74
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PermissionsService, never>;
|
|
75
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PermissionsService>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare class CameraService extends BrowserApiBaseService {
|
|
92
79
|
private currentStream;
|
|
93
80
|
protected getApiName(): string;
|
|
94
|
-
|
|
81
|
+
protected ensureSupported(): void;
|
|
95
82
|
startCamera(constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
|
96
83
|
stopCamera(): void;
|
|
97
84
|
switchCamera(deviceId: string, constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
|
@@ -106,7 +93,7 @@ declare class CameraService extends PermissionAwareBrowserApiBaseService {
|
|
|
106
93
|
|
|
107
94
|
declare class GeolocationService extends BrowserApiBaseService {
|
|
108
95
|
protected getApiName(): string;
|
|
109
|
-
|
|
96
|
+
protected ensureSupported(): void;
|
|
110
97
|
getCurrentPosition(options?: PositionOptions): Promise<GeolocationPosition>;
|
|
111
98
|
watchPosition(options?: PositionOptions): Observable<GeolocationPosition>;
|
|
112
99
|
clearWatch(watchId: number): void;
|
|
@@ -121,7 +108,7 @@ interface DisplayMediaConstraints {
|
|
|
121
108
|
}
|
|
122
109
|
declare class MediaDevicesService extends BrowserApiBaseService {
|
|
123
110
|
protected getApiName(): string;
|
|
124
|
-
|
|
111
|
+
protected ensureSupported(): void;
|
|
125
112
|
getDevices(): Promise<MediaDeviceInfo[]>;
|
|
126
113
|
getUserMedia(constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
|
127
114
|
getDisplayMedia(constraints?: DisplayMediaConstraints): Promise<MediaStream>;
|
|
@@ -138,17 +125,17 @@ declare class MediaDevicesService extends BrowserApiBaseService {
|
|
|
138
125
|
|
|
139
126
|
declare class NotificationService extends BrowserApiBaseService {
|
|
140
127
|
protected getApiName(): string;
|
|
128
|
+
protected ensureSupported(): void;
|
|
141
129
|
get permission(): NotificationPermission;
|
|
142
|
-
isSupported(): boolean;
|
|
143
130
|
requestNotificationPermission(): Promise<NotificationPermission>;
|
|
144
131
|
showNotification(title: string, options?: NotificationOptions): Promise<Notification>;
|
|
145
132
|
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
|
|
146
133
|
static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
|
|
147
134
|
}
|
|
148
135
|
|
|
149
|
-
declare class ClipboardService extends
|
|
136
|
+
declare class ClipboardService extends BrowserApiBaseService {
|
|
150
137
|
protected getApiName(): string;
|
|
151
|
-
|
|
138
|
+
protected ensureSupported(): void;
|
|
152
139
|
writeText(text: string): Promise<void>;
|
|
153
140
|
readText(): Promise<string>;
|
|
154
141
|
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardService, never>;
|
|
@@ -309,7 +296,7 @@ declare class BrowserCapabilityService {
|
|
|
309
296
|
isSecureContext(): boolean;
|
|
310
297
|
isSupported(capability: BrowserCapabilityId): boolean;
|
|
311
298
|
getAllStatuses(): {
|
|
312
|
-
id: "camera" | "geolocation" | "permissions" | "
|
|
299
|
+
id: "camera" | "geolocation" | "permissions" | "clipboard" | "notification" | "mediaDevices" | "webWorker" | "regexSecurity" | "webStorage" | "webShare" | "battery" | "webSocket" | "intersectionObserver" | "resizeObserver" | "pageVisibility" | "broadcastChannel" | "networkInformation" | "screenWakeLock" | "screenOrientation" | "fullscreen" | "fileSystemAccess" | "mediaRecorder" | "serverSentEvents" | "vibration" | "speechSynthesis" | "mutationObserver" | "performanceObserver" | "idleDetector" | "eyeDropper" | "barcodeDetector" | "webAudio" | "gamepad" | "webBluetooth" | "webUsb" | "webNfc" | "paymentRequest" | "credentialManagement";
|
|
313
300
|
label: "Permissions API" | "Geolocation API" | "Clipboard API" | "Notification API" | "MediaDevices API" | "Camera API" | "Web Worker API" | "Regex Security" | "Web Storage" | "Web Share" | "Battery API" | "WebSocket API" | "Intersection Observer" | "Resize Observer" | "Page Visibility API" | "Broadcast Channel API" | "Network Information API" | "Screen Wake Lock API" | "Screen Orientation API" | "Fullscreen API" | "File System Access API" | "MediaRecorder API" | "Server-Sent Events" | "Vibration API" | "Speech Synthesis API" | "Mutation Observer" | "Performance Observer" | "Idle Detection API" | "EyeDropper API" | "Barcode Detection API" | "Web Audio API" | "Gamepad API" | "Web Bluetooth API" | "WebUSB API" | "Web NFC API" | "Payment Request API" | "Credential Management API";
|
|
314
301
|
supported: boolean;
|
|
315
302
|
secureContext: boolean;
|
|
@@ -349,7 +336,7 @@ declare global {
|
|
|
349
336
|
declare class BatteryService extends BrowserApiBaseService {
|
|
350
337
|
private batteryManager;
|
|
351
338
|
protected getApiName(): string;
|
|
352
|
-
|
|
339
|
+
protected ensureSupported(): void;
|
|
353
340
|
initialize(): Promise<BatteryInfo>;
|
|
354
341
|
getBatteryInfo(): BatteryInfo;
|
|
355
342
|
watchBatteryInfo(): Observable<BatteryInfo>;
|
|
@@ -368,7 +355,7 @@ interface ShareResult {
|
|
|
368
355
|
}
|
|
369
356
|
declare class WebShareService extends BrowserApiBaseService {
|
|
370
357
|
protected getApiName(): string;
|
|
371
|
-
|
|
358
|
+
protected ensureSupported(): void;
|
|
372
359
|
share(data: ShareData): Promise<ShareResult>;
|
|
373
360
|
canShare(): boolean;
|
|
374
361
|
canShareFiles(): boolean;
|
|
@@ -396,21 +383,21 @@ interface StorageOptions {
|
|
|
396
383
|
deserialize?: (value: string) => StorageValue;
|
|
397
384
|
}
|
|
398
385
|
interface StorageEvent {
|
|
399
|
-
key: string;
|
|
386
|
+
key: string | null;
|
|
400
387
|
newValue: StorageValue | null;
|
|
401
388
|
oldValue: StorageValue | null;
|
|
402
389
|
storageArea: 'localStorage' | 'sessionStorage';
|
|
403
390
|
}
|
|
404
391
|
declare class WebStorageService extends BrowserApiBaseService {
|
|
405
392
|
private storageEvents;
|
|
406
|
-
protected destroyRef: DestroyRef;
|
|
407
393
|
constructor();
|
|
408
394
|
protected getApiName(): string;
|
|
409
|
-
|
|
395
|
+
protected ensureSupported(): void;
|
|
410
396
|
private setupEventListeners;
|
|
411
397
|
private serializeValue;
|
|
412
398
|
private deserializeValue;
|
|
413
399
|
private getKey;
|
|
400
|
+
private emitStorageChange;
|
|
414
401
|
setLocalStorage<T extends StorageValue>(key: string, value: T, options?: StorageOptions): boolean;
|
|
415
402
|
getLocalStorage<T extends StorageValue>(key: string, defaultValue?: T | null, options?: StorageOptions): T | null;
|
|
416
403
|
removeLocalStorage(key: string, options?: StorageOptions): boolean;
|
|
@@ -430,19 +417,112 @@ declare class WebStorageService extends BrowserApiBaseService {
|
|
|
430
417
|
static ɵprov: i0.ɵɵInjectableDeclaration<WebStorageService>;
|
|
431
418
|
}
|
|
432
419
|
|
|
433
|
-
interface
|
|
420
|
+
interface BrowserApiLogger {
|
|
421
|
+
info(message: string): void;
|
|
422
|
+
warn(message: string): void;
|
|
423
|
+
error(message: string, error?: unknown): void;
|
|
424
|
+
}
|
|
425
|
+
declare const BROWSER_API_LOGGER: InjectionToken<BrowserApiLogger>;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Configuration for a single WebSocket connection.
|
|
429
|
+
*/
|
|
430
|
+
interface WebSocketClientConfig {
|
|
434
431
|
url: string;
|
|
435
432
|
protocols?: string | string[];
|
|
433
|
+
/**
|
|
434
|
+
* Initial reconnect delay in milliseconds. Used as the base for exponential backoff.
|
|
435
|
+
* Set to `0` or omit to disable automatic reconnection.
|
|
436
|
+
*/
|
|
436
437
|
reconnectInterval?: number;
|
|
438
|
+
/** Maximum number of automatic reconnect attempts. Defaults to `0` (disabled). */
|
|
437
439
|
maxReconnectAttempts?: number;
|
|
440
|
+
/** Hard cap for reconnect delay in milliseconds. Defaults to `30_000`. */
|
|
441
|
+
maxReconnectDelay?: number;
|
|
442
|
+
/** Heartbeat interval in milliseconds. */
|
|
438
443
|
heartbeatInterval?: number;
|
|
444
|
+
/** Payload sent on every heartbeat tick when `heartbeatInterval` is set. */
|
|
439
445
|
heartbeatMessage?: unknown;
|
|
440
446
|
}
|
|
441
447
|
interface WebSocketMessage<T = unknown> {
|
|
448
|
+
/** Message identifier. Auto-generated when omitted. */
|
|
449
|
+
id?: string;
|
|
442
450
|
type: string;
|
|
443
451
|
data: T;
|
|
452
|
+
/** Server-assigned correlation id (used by `request()` to match responses). */
|
|
453
|
+
correlationId?: string;
|
|
444
454
|
timestamp?: number;
|
|
445
455
|
}
|
|
456
|
+
type WebSocketState = 'idle' | 'connecting' | 'open' | 'closing' | 'closed' | 'reconnecting';
|
|
457
|
+
interface WebSocketStatusV2 {
|
|
458
|
+
readonly state: WebSocketState;
|
|
459
|
+
readonly reconnectAttempts: number;
|
|
460
|
+
readonly error: string | null;
|
|
461
|
+
}
|
|
462
|
+
interface WebSocketRequestOptions {
|
|
463
|
+
/** Timeout in milliseconds. Defaults to `30_000`. */
|
|
464
|
+
timeout?: number;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Stateful WebSocket client wrapping a single connection. One instance per logical
|
|
468
|
+
* connection (do NOT share between `connect()` calls).
|
|
469
|
+
*
|
|
470
|
+
* Surfaces:
|
|
471
|
+
* - `status`: signal of the current connection state.
|
|
472
|
+
* - `messages$`: stream of every received message (parsed JSON).
|
|
473
|
+
* - `send` / `sendRaw`: outbound traffic.
|
|
474
|
+
* - `request<T>(type, data)`: round-trip with id correlation and timeout.
|
|
475
|
+
* - `close`: idempotent disposal.
|
|
476
|
+
*
|
|
477
|
+
* Reconnect uses exponential backoff with jitter, capped by `maxReconnectDelay`.
|
|
478
|
+
*/
|
|
479
|
+
declare class WebSocketClient {
|
|
480
|
+
private readonly config;
|
|
481
|
+
private readonly logger;
|
|
482
|
+
private socket;
|
|
483
|
+
private reconnectTimer;
|
|
484
|
+
private heartbeatTimer;
|
|
485
|
+
private readonly _status;
|
|
486
|
+
private readonly _messages$;
|
|
487
|
+
private readonly pendingRequests;
|
|
488
|
+
private disposed;
|
|
489
|
+
private reconnectAttempts;
|
|
490
|
+
constructor(config: WebSocketClientConfig, logger: BrowserApiLogger, destroyRef?: DestroyRef);
|
|
491
|
+
get status(): Signal<WebSocketStatusV2>;
|
|
492
|
+
get messages$(): Observable<WebSocketMessage>;
|
|
493
|
+
messagesByType<T = unknown>(type: string): Observable<WebSocketMessage<T>>;
|
|
494
|
+
send<T>(message: WebSocketMessage<T>): void;
|
|
495
|
+
sendRaw(data: string): void;
|
|
496
|
+
/**
|
|
497
|
+
* Send a message and await a correlated response. The server MUST echo back the
|
|
498
|
+
* `correlationId` from the request as `correlationId` on the response message.
|
|
499
|
+
*/
|
|
500
|
+
request<TRes = unknown, TReq = unknown>(type: string, data: TReq, opts?: WebSocketRequestOptions): Promise<TRes>;
|
|
501
|
+
close(): void;
|
|
502
|
+
/** Internal handle for tests and advanced usage. */
|
|
503
|
+
getNativeSocket(): WebSocket | null;
|
|
504
|
+
private openSocket;
|
|
505
|
+
private attachHandlers;
|
|
506
|
+
private handleIncoming;
|
|
507
|
+
private scheduleReconnect;
|
|
508
|
+
/**
|
|
509
|
+
* Exponential backoff with full jitter:
|
|
510
|
+
* baseDelay = min(maxDelay, interval * 2^(attempt - 1))
|
|
511
|
+
* delay = random(0, baseDelay)
|
|
512
|
+
*/
|
|
513
|
+
static computeBackoffDelay(attempt: number, interval: number, maxDelay: number): number;
|
|
514
|
+
private startHeartbeat;
|
|
515
|
+
private stopHeartbeat;
|
|
516
|
+
private clearTimers;
|
|
517
|
+
private rejectAllPending;
|
|
518
|
+
private updateStatus;
|
|
519
|
+
private generateId;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* @deprecated Use `WebSocketStatusV2` (via `WebSocketClient.status`).
|
|
524
|
+
* Kept for backward compatibility — will be removed in v22.
|
|
525
|
+
*/
|
|
446
526
|
interface WebSocketStatus {
|
|
447
527
|
connected: boolean;
|
|
448
528
|
connecting: boolean;
|
|
@@ -450,29 +530,70 @@ interface WebSocketStatus {
|
|
|
450
530
|
error?: string;
|
|
451
531
|
reconnectAttempts: number;
|
|
452
532
|
}
|
|
533
|
+
/**
|
|
534
|
+
* @deprecated Use `WebSocketClientConfig`. Kept as alias for backward compatibility.
|
|
535
|
+
*/
|
|
536
|
+
type WebSocketConfig = WebSocketClientConfig & {
|
|
537
|
+
/** @deprecated Use `heartbeatMessage` directly. */
|
|
538
|
+
heartbeatMessage?: unknown;
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Service that creates and tracks `WebSocketClient` instances.
|
|
543
|
+
*
|
|
544
|
+
* Preferred usage:
|
|
545
|
+
* ```ts
|
|
546
|
+
* const ws = inject(WebSocketService);
|
|
547
|
+
* const client = ws.createClient({ url: 'wss://...' });
|
|
548
|
+
* effect(() => console.log(client.status()));
|
|
549
|
+
* await client.request('ping', {});
|
|
550
|
+
* ```
|
|
551
|
+
*
|
|
552
|
+
* Legacy usage (`connect()` returning Observable) is preserved for one minor cycle
|
|
553
|
+
* and will be removed in v22.
|
|
554
|
+
*/
|
|
453
555
|
declare class WebSocketService extends BrowserApiBaseService {
|
|
454
|
-
private
|
|
455
|
-
private
|
|
456
|
-
private
|
|
457
|
-
|
|
458
|
-
private
|
|
459
|
-
private heartbeatTimer;
|
|
556
|
+
private readonly wsLogger;
|
|
557
|
+
private readonly clients;
|
|
558
|
+
private readonly _cleanup;
|
|
559
|
+
/** Legacy single-connection holder used by deprecated `connect()`/`send()` API. */
|
|
560
|
+
private legacyClient;
|
|
460
561
|
protected getApiName(): string;
|
|
461
|
-
|
|
562
|
+
protected ensureSupported(): void;
|
|
563
|
+
/**
|
|
564
|
+
* Create a new WebSocket client. The client owns one connection and is the recommended
|
|
565
|
+
* surface for all interactions (status signal, request/response, reconnect, etc.).
|
|
566
|
+
*
|
|
567
|
+
* The returned client is automatically disposed when the host injector is destroyed.
|
|
568
|
+
*/
|
|
569
|
+
createClient(config: WebSocketClientConfig): WebSocketClient;
|
|
570
|
+
/** Dispose every client created via `createClient()` (also called automatically on destroy). */
|
|
571
|
+
disposeAll(): void;
|
|
572
|
+
/**
|
|
573
|
+
* @deprecated Use {@link createClient} which returns a `WebSocketClient` exposing a
|
|
574
|
+
* status signal, request/response, and proper reconnect. This wrapper will be removed
|
|
575
|
+
* in v22.
|
|
576
|
+
*/
|
|
462
577
|
connect(config: WebSocketConfig): Observable<WebSocketStatus>;
|
|
578
|
+
/** @deprecated Use {@link createClient} and call `client.close()`. */
|
|
463
579
|
disconnect(): void;
|
|
580
|
+
/** @deprecated Use the client returned by {@link createClient}. */
|
|
464
581
|
send<T>(message: WebSocketMessage<T>): void;
|
|
582
|
+
/** @deprecated Use the client returned by {@link createClient}. */
|
|
465
583
|
sendRaw(data: string): void;
|
|
584
|
+
/** @deprecated Use `client.status` from {@link createClient}. */
|
|
466
585
|
getStatus(): Observable<WebSocketStatus>;
|
|
586
|
+
/** @deprecated Use `client.messages$` from {@link createClient}. */
|
|
467
587
|
getMessages<T = unknown>(): Observable<WebSocketMessage<T>>;
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
private updateStatus;
|
|
472
|
-
private getCurrentStatus;
|
|
588
|
+
/** @deprecated Use `client.messagesByType()` from {@link createClient}. */
|
|
589
|
+
getMessagesByType<T = unknown>(type: string): Observable<WebSocketMessage<T>>;
|
|
590
|
+
/** @deprecated Use the client returned by {@link createClient}. */
|
|
473
591
|
getNativeWebSocket(): WebSocket | null;
|
|
592
|
+
/** @deprecated Use `client.status()` from {@link createClient}. */
|
|
474
593
|
isConnected(): boolean;
|
|
594
|
+
/** @deprecated Use the native socket via `client.getNativeSocket()`. */
|
|
475
595
|
getReadyState(): number;
|
|
596
|
+
private warnLegacyOnce;
|
|
476
597
|
static ɵfac: i0.ɵɵFactoryDeclaration<WebSocketService, never>;
|
|
477
598
|
static ɵprov: i0.ɵɵInjectableDeclaration<WebSocketService>;
|
|
478
599
|
}
|
|
@@ -496,13 +617,13 @@ interface WorkerTask<T = unknown> {
|
|
|
496
617
|
transferable?: Transferable[];
|
|
497
618
|
}
|
|
498
619
|
declare class WebWorkerService extends BrowserApiBaseService {
|
|
499
|
-
protected destroyRef: DestroyRef;
|
|
500
620
|
private workers;
|
|
501
621
|
private workerStatuses;
|
|
502
622
|
private workerMessages;
|
|
503
623
|
private currentWorkerStatuses;
|
|
624
|
+
private readonly _cleanup;
|
|
504
625
|
protected getApiName(): string;
|
|
505
|
-
|
|
626
|
+
protected ensureSupported(): void;
|
|
506
627
|
createWorker(name: string, scriptUrl: string): Observable<WorkerStatus>;
|
|
507
628
|
terminateWorker(name: string): void;
|
|
508
629
|
terminateAllWorkers(): void;
|
|
@@ -704,7 +825,7 @@ declare class FileSystemAccessService extends BrowserApiBaseService {
|
|
|
704
825
|
protected getApiName(): string;
|
|
705
826
|
isSupported(): boolean;
|
|
706
827
|
private get win();
|
|
707
|
-
|
|
828
|
+
protected ensureSupported(): void;
|
|
708
829
|
openFile(options?: FileOpenOptions): Promise<File[]>;
|
|
709
830
|
saveFile(content: string | Blob, options?: FileSaveOptions): Promise<void>;
|
|
710
831
|
openDirectory(options?: {
|
|
@@ -858,54 +979,6 @@ declare class PerformanceObserverService extends BrowserApiBaseService {
|
|
|
858
979
|
static ɵprov: i0.ɵɵInjectableDeclaration<PerformanceObserverService>;
|
|
859
980
|
}
|
|
860
981
|
|
|
861
|
-
type UserIdleState = 'active' | 'idle';
|
|
862
|
-
type ScreenIdleState = 'locked' | 'unlocked';
|
|
863
|
-
interface IdleState {
|
|
864
|
-
user: UserIdleState;
|
|
865
|
-
screen: ScreenIdleState;
|
|
866
|
-
}
|
|
867
|
-
interface IdleDetectorOptions {
|
|
868
|
-
threshold?: number;
|
|
869
|
-
}
|
|
870
|
-
declare class IdleDetectorService extends BrowserApiBaseService {
|
|
871
|
-
protected getApiName(): string;
|
|
872
|
-
isSupported(): boolean;
|
|
873
|
-
requestPermission(): Promise<PermissionState>;
|
|
874
|
-
watch(options?: IdleDetectorOptions): Observable<IdleState>;
|
|
875
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<IdleDetectorService, never>;
|
|
876
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<IdleDetectorService>;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
interface ColorSelectionResult {
|
|
880
|
-
sRGBHex: string;
|
|
881
|
-
}
|
|
882
|
-
declare class EyeDropperService extends BrowserApiBaseService {
|
|
883
|
-
protected getApiName(): string;
|
|
884
|
-
isSupported(): boolean;
|
|
885
|
-
open(signal?: AbortSignal): Promise<ColorSelectionResult>;
|
|
886
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EyeDropperService, never>;
|
|
887
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<EyeDropperService>;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
type BarcodeFormat = 'aztec' | 'code_128' | 'code_39' | 'code_93' | 'codabar' | 'data_matrix' | 'ean_13' | 'ean_8' | 'itf' | 'pdf417' | 'qr_code' | 'upc_a' | 'upc_e' | 'unknown';
|
|
891
|
-
interface DetectedBarcode {
|
|
892
|
-
boundingBox: DOMRectReadOnly;
|
|
893
|
-
cornerPoints: ReadonlyArray<{
|
|
894
|
-
x: number;
|
|
895
|
-
y: number;
|
|
896
|
-
}>;
|
|
897
|
-
format: BarcodeFormat;
|
|
898
|
-
rawValue: string;
|
|
899
|
-
}
|
|
900
|
-
declare class BarcodeDetectorService extends BrowserApiBaseService {
|
|
901
|
-
protected getApiName(): string;
|
|
902
|
-
isSupported(): boolean;
|
|
903
|
-
getSupportedFormats(): Promise<BarcodeFormat[]>;
|
|
904
|
-
detect(image: ImageBitmapSource, formats?: BarcodeFormat[]): Promise<DetectedBarcode[]>;
|
|
905
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BarcodeDetectorService, never>;
|
|
906
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<BarcodeDetectorService>;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
982
|
type AudioContextState = 'suspended' | 'running' | 'closed';
|
|
910
983
|
interface AudioAnalyserData {
|
|
911
984
|
frequencyData: Uint8Array;
|
|
@@ -955,227 +1028,6 @@ declare class GamepadService extends BrowserApiBaseService {
|
|
|
955
1028
|
static ɵprov: i0.ɵɵInjectableDeclaration<GamepadService>;
|
|
956
1029
|
}
|
|
957
1030
|
|
|
958
|
-
interface BluetoothRequestDeviceOptions {
|
|
959
|
-
filters?: Array<{
|
|
960
|
-
services?: string[];
|
|
961
|
-
name?: string;
|
|
962
|
-
namePrefix?: string;
|
|
963
|
-
}>;
|
|
964
|
-
optionalServices?: string[];
|
|
965
|
-
acceptAllDevices?: boolean;
|
|
966
|
-
}
|
|
967
|
-
interface BluetoothRemoteGATTServer {
|
|
968
|
-
readonly connected: boolean;
|
|
969
|
-
readonly device: BluetoothDeviceRef;
|
|
970
|
-
connect(): Promise<BluetoothRemoteGATTServer>;
|
|
971
|
-
disconnect(): void;
|
|
972
|
-
getPrimaryService(service: string): Promise<BluetoothRemoteGATTService>;
|
|
973
|
-
}
|
|
974
|
-
interface BluetoothRemoteGATTService {
|
|
975
|
-
getCharacteristic(characteristic: string): Promise<BluetoothRemoteGATTCharacteristic>;
|
|
976
|
-
}
|
|
977
|
-
interface BluetoothRemoteGATTCharacteristic extends EventTarget {
|
|
978
|
-
readonly value: DataView | null;
|
|
979
|
-
readValue(): Promise<DataView>;
|
|
980
|
-
writeValue(value: BufferSource): Promise<void>;
|
|
981
|
-
startNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
|
|
982
|
-
stopNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
|
|
983
|
-
}
|
|
984
|
-
interface BluetoothDeviceRef extends EventTarget {
|
|
985
|
-
readonly id: string;
|
|
986
|
-
readonly name: string | undefined;
|
|
987
|
-
readonly gatt: BluetoothRemoteGATTServer | undefined;
|
|
988
|
-
}
|
|
989
|
-
interface UsbDeviceRef {
|
|
990
|
-
readonly vendorId: number;
|
|
991
|
-
readonly productId: number;
|
|
992
|
-
readonly productName: string | undefined;
|
|
993
|
-
readonly manufacturerName: string | undefined;
|
|
994
|
-
readonly serialNumber: string | undefined;
|
|
995
|
-
readonly opened: boolean;
|
|
996
|
-
open(): Promise<void>;
|
|
997
|
-
close(): Promise<void>;
|
|
998
|
-
selectConfiguration(configurationValue: number): Promise<void>;
|
|
999
|
-
claimInterface(interfaceNumber: number): Promise<void>;
|
|
1000
|
-
releaseInterface(interfaceNumber: number): Promise<void>;
|
|
1001
|
-
transferIn(endpointNumber: number, length: number): Promise<UsbTransferResult>;
|
|
1002
|
-
transferOut(endpointNumber: number, data: BufferSource): Promise<UsbTransferResult>;
|
|
1003
|
-
}
|
|
1004
|
-
interface UsbTransferResult {
|
|
1005
|
-
readonly data: DataView | undefined;
|
|
1006
|
-
readonly status: 'ok' | 'stall' | 'babble';
|
|
1007
|
-
}
|
|
1008
|
-
interface UsbDeviceFilterDef {
|
|
1009
|
-
vendorId?: number;
|
|
1010
|
-
productId?: number;
|
|
1011
|
-
classCode?: number;
|
|
1012
|
-
subclassCode?: number;
|
|
1013
|
-
protocolCode?: number;
|
|
1014
|
-
serialNumber?: string;
|
|
1015
|
-
}
|
|
1016
|
-
interface NdefMessage {
|
|
1017
|
-
records: NdefRecord[];
|
|
1018
|
-
}
|
|
1019
|
-
interface NdefRecord {
|
|
1020
|
-
recordType: string;
|
|
1021
|
-
mediaType?: string;
|
|
1022
|
-
id?: string;
|
|
1023
|
-
data?: DataView;
|
|
1024
|
-
encoding?: string;
|
|
1025
|
-
lang?: string;
|
|
1026
|
-
}
|
|
1027
|
-
interface NdefReadingEvent {
|
|
1028
|
-
serialNumber: string;
|
|
1029
|
-
message: NdefMessage;
|
|
1030
|
-
}
|
|
1031
|
-
interface NdefWriteOptions {
|
|
1032
|
-
overwrite?: boolean;
|
|
1033
|
-
signal?: AbortSignal;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
interface BluetoothDeviceInfo {
|
|
1037
|
-
id: string;
|
|
1038
|
-
name: string | undefined;
|
|
1039
|
-
connected: boolean;
|
|
1040
|
-
}
|
|
1041
|
-
declare class WebBluetoothService extends BrowserApiBaseService {
|
|
1042
|
-
protected getApiName(): string;
|
|
1043
|
-
isSupported(): boolean;
|
|
1044
|
-
requestDevice(options?: BluetoothRequestDeviceOptions): Promise<BluetoothDeviceRef>;
|
|
1045
|
-
connect(device: BluetoothDeviceRef): Promise<BluetoothRemoteGATTServer>;
|
|
1046
|
-
disconnect(device: BluetoothDeviceRef): void;
|
|
1047
|
-
watchDisconnection(device: BluetoothDeviceRef): Observable<void>;
|
|
1048
|
-
readCharacteristic(server: BluetoothRemoteGATTServer, serviceUuid: string, characteristicUuid: string): Promise<DataView>;
|
|
1049
|
-
writeCharacteristic(server: BluetoothRemoteGATTServer, serviceUuid: string, characteristicUuid: string, value: BufferSource): Promise<void>;
|
|
1050
|
-
watchCharacteristic(server: BluetoothRemoteGATTServer, serviceUuid: string, characteristicUuid: string): Observable<DataView>;
|
|
1051
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<WebBluetoothService, never>;
|
|
1052
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<WebBluetoothService>;
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
interface UsbDeviceInfo {
|
|
1056
|
-
vendorId: number;
|
|
1057
|
-
productId: number;
|
|
1058
|
-
productName: string | undefined;
|
|
1059
|
-
manufacturerName: string | undefined;
|
|
1060
|
-
serialNumber: string | undefined;
|
|
1061
|
-
opened: boolean;
|
|
1062
|
-
}
|
|
1063
|
-
declare class WebUsbService extends BrowserApiBaseService {
|
|
1064
|
-
protected getApiName(): string;
|
|
1065
|
-
isSupported(): boolean;
|
|
1066
|
-
requestDevice(filters?: UsbDeviceFilterDef[]): Promise<UsbDeviceRef>;
|
|
1067
|
-
getDevices(): Promise<UsbDeviceRef[]>;
|
|
1068
|
-
open(device: UsbDeviceRef): Promise<void>;
|
|
1069
|
-
close(device: UsbDeviceRef): Promise<void>;
|
|
1070
|
-
selectConfiguration(device: UsbDeviceRef, configurationValue: number): Promise<void>;
|
|
1071
|
-
claimInterface(device: UsbDeviceRef, interfaceNumber: number): Promise<void>;
|
|
1072
|
-
releaseInterface(device: UsbDeviceRef, interfaceNumber: number): Promise<void>;
|
|
1073
|
-
transferIn(device: UsbDeviceRef, endpointNumber: number, length: number): Promise<UsbTransferResult>;
|
|
1074
|
-
transferOut(device: UsbDeviceRef, endpointNumber: number, data: BufferSource): Promise<UsbTransferResult>;
|
|
1075
|
-
watchConnection(): Observable<{
|
|
1076
|
-
device: UsbDeviceRef;
|
|
1077
|
-
type: 'connect' | 'disconnect';
|
|
1078
|
-
}>;
|
|
1079
|
-
getDeviceInfo(device: UsbDeviceRef): UsbDeviceInfo;
|
|
1080
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<WebUsbService, never>;
|
|
1081
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<WebUsbService>;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
declare class WebNfcService extends BrowserApiBaseService {
|
|
1085
|
-
protected getApiName(): string;
|
|
1086
|
-
isSupported(): boolean;
|
|
1087
|
-
scan(): Observable<NdefReadingEvent>;
|
|
1088
|
-
write(message: NdefMessage | string, options?: NdefWriteOptions): Promise<void>;
|
|
1089
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<WebNfcService, never>;
|
|
1090
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<WebNfcService>;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
interface PaymentMethodConfig {
|
|
1094
|
-
supportedMethods: string;
|
|
1095
|
-
data?: Record<string, unknown>;
|
|
1096
|
-
}
|
|
1097
|
-
interface PaymentDetailsInit {
|
|
1098
|
-
total: {
|
|
1099
|
-
label: string;
|
|
1100
|
-
amount: {
|
|
1101
|
-
currency: string;
|
|
1102
|
-
value: string;
|
|
1103
|
-
};
|
|
1104
|
-
};
|
|
1105
|
-
displayItems?: Array<{
|
|
1106
|
-
label: string;
|
|
1107
|
-
amount: {
|
|
1108
|
-
currency: string;
|
|
1109
|
-
value: string;
|
|
1110
|
-
};
|
|
1111
|
-
}>;
|
|
1112
|
-
}
|
|
1113
|
-
interface PaymentOptionsConfig {
|
|
1114
|
-
requestPayerName?: boolean;
|
|
1115
|
-
requestPayerEmail?: boolean;
|
|
1116
|
-
requestPayerPhone?: boolean;
|
|
1117
|
-
requestShipping?: boolean;
|
|
1118
|
-
}
|
|
1119
|
-
interface PaymentResult {
|
|
1120
|
-
methodName: string;
|
|
1121
|
-
details: Record<string, unknown>;
|
|
1122
|
-
payerName: string | null;
|
|
1123
|
-
payerEmail: string | null;
|
|
1124
|
-
payerPhone: string | null;
|
|
1125
|
-
}
|
|
1126
|
-
declare class PaymentRequestService extends BrowserApiBaseService {
|
|
1127
|
-
protected getApiName(): string;
|
|
1128
|
-
isSupported(): boolean;
|
|
1129
|
-
canMakePayment(methods: PaymentMethodConfig[], details: PaymentDetailsInit): Promise<boolean>;
|
|
1130
|
-
show(methods: PaymentMethodConfig[], details: PaymentDetailsInit, options?: PaymentOptionsConfig): Promise<PaymentResult>;
|
|
1131
|
-
abort(methods: PaymentMethodConfig[], details: PaymentDetailsInit): Promise<void>;
|
|
1132
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentRequestService, never>;
|
|
1133
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<PaymentRequestService>;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
interface PasswordCredentialData {
|
|
1137
|
-
id: string;
|
|
1138
|
-
password: string;
|
|
1139
|
-
name?: string;
|
|
1140
|
-
iconURL?: string;
|
|
1141
|
-
}
|
|
1142
|
-
interface PublicKeyCredentialOptions {
|
|
1143
|
-
challenge: BufferSource;
|
|
1144
|
-
rp: {
|
|
1145
|
-
name: string;
|
|
1146
|
-
id?: string;
|
|
1147
|
-
};
|
|
1148
|
-
user: {
|
|
1149
|
-
id: BufferSource;
|
|
1150
|
-
name: string;
|
|
1151
|
-
displayName: string;
|
|
1152
|
-
};
|
|
1153
|
-
pubKeyCredParams: Array<{
|
|
1154
|
-
type: 'public-key';
|
|
1155
|
-
alg: number;
|
|
1156
|
-
}>;
|
|
1157
|
-
timeout?: number;
|
|
1158
|
-
attestation?: AttestationConveyancePreference;
|
|
1159
|
-
authenticatorSelection?: AuthenticatorSelectionCriteria;
|
|
1160
|
-
}
|
|
1161
|
-
interface CredentialResult {
|
|
1162
|
-
id: string;
|
|
1163
|
-
type: string;
|
|
1164
|
-
}
|
|
1165
|
-
declare class CredentialManagementService extends BrowserApiBaseService {
|
|
1166
|
-
protected getApiName(): string;
|
|
1167
|
-
isSupported(): boolean;
|
|
1168
|
-
isPublicKeySupported(): boolean;
|
|
1169
|
-
get(options?: CredentialRequestOptions): Promise<Credential | null>;
|
|
1170
|
-
store(credential: Credential): Promise<void>;
|
|
1171
|
-
createPasswordCredential(data: PasswordCredentialData): Promise<Credential>;
|
|
1172
|
-
createPublicKeyCredential(options: PublicKeyCredentialOptions): Promise<Credential | null>;
|
|
1173
|
-
preventSilentAccess(): Promise<void>;
|
|
1174
|
-
isConditionalMediationAvailable(): Promise<boolean>;
|
|
1175
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CredentialManagementService, never>;
|
|
1176
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CredentialManagementService>;
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
1031
|
interface MediaDevice {
|
|
1180
1032
|
deviceId: string;
|
|
1181
1033
|
groupId: string;
|
|
@@ -1322,15 +1174,6 @@ interface PerformanceObserverRef {
|
|
|
1322
1174
|
}
|
|
1323
1175
|
declare function injectPerformanceObserver(config: PerformanceObserverConfig): PerformanceObserverRef;
|
|
1324
1176
|
|
|
1325
|
-
interface IdleDetectorRef {
|
|
1326
|
-
readonly state: Signal<IdleState>;
|
|
1327
|
-
readonly userState: Signal<UserIdleState>;
|
|
1328
|
-
readonly screenState: Signal<ScreenIdleState>;
|
|
1329
|
-
readonly isUserIdle: Signal<boolean>;
|
|
1330
|
-
readonly isScreenLocked: Signal<boolean>;
|
|
1331
|
-
}
|
|
1332
|
-
declare function injectIdleDetector(options?: IdleDetectorOptions): IdleDetectorRef;
|
|
1333
|
-
|
|
1334
1177
|
interface GamepadRef {
|
|
1335
1178
|
readonly state: Signal<GamepadState | null>;
|
|
1336
1179
|
readonly connected: Signal<boolean>;
|
|
@@ -1367,6 +1210,67 @@ declare class BrowserSupportUtil {
|
|
|
1367
1210
|
*/
|
|
1368
1211
|
declare const permissionGuard: (permission: PermissionNameExt) => CanActivateFn;
|
|
1369
1212
|
|
|
1213
|
+
declare function providePermissions(): EnvironmentProviders;
|
|
1214
|
+
|
|
1215
|
+
declare function provideCamera(): EnvironmentProviders;
|
|
1216
|
+
|
|
1217
|
+
declare function provideGeolocation(): EnvironmentProviders;
|
|
1218
|
+
|
|
1219
|
+
declare function provideNotifications(): EnvironmentProviders;
|
|
1220
|
+
|
|
1221
|
+
declare function provideClipboard(): EnvironmentProviders;
|
|
1222
|
+
|
|
1223
|
+
declare function provideMediaDevices(): EnvironmentProviders;
|
|
1224
|
+
|
|
1225
|
+
declare function provideScreenWakeLock(): EnvironmentProviders;
|
|
1226
|
+
|
|
1227
|
+
declare function provideFileSystemAccess(): EnvironmentProviders;
|
|
1228
|
+
|
|
1229
|
+
declare function provideMediaRecorder(): EnvironmentProviders;
|
|
1230
|
+
|
|
1231
|
+
declare function provideBattery(): EnvironmentProviders;
|
|
1232
|
+
|
|
1233
|
+
declare function provideWebShare(): EnvironmentProviders;
|
|
1234
|
+
|
|
1235
|
+
declare function provideWebStorage(): EnvironmentProviders;
|
|
1236
|
+
|
|
1237
|
+
declare function provideWebSocket(): EnvironmentProviders;
|
|
1238
|
+
|
|
1239
|
+
declare function provideWebWorker(): EnvironmentProviders;
|
|
1240
|
+
|
|
1241
|
+
declare function provideIntersectionObserver(): EnvironmentProviders;
|
|
1242
|
+
|
|
1243
|
+
declare function provideResizeObserver(): EnvironmentProviders;
|
|
1244
|
+
|
|
1245
|
+
declare function providePageVisibility(): EnvironmentProviders;
|
|
1246
|
+
|
|
1247
|
+
declare function provideBroadcastChannel(): EnvironmentProviders;
|
|
1248
|
+
|
|
1249
|
+
declare function provideNetworkInformation(): EnvironmentProviders;
|
|
1250
|
+
|
|
1251
|
+
declare function provideScreenOrientation(): EnvironmentProviders;
|
|
1252
|
+
|
|
1253
|
+
declare function provideFullscreen(): EnvironmentProviders;
|
|
1254
|
+
|
|
1255
|
+
declare function provideServerSentEvents(): EnvironmentProviders;
|
|
1256
|
+
|
|
1257
|
+
declare function provideVibration(): EnvironmentProviders;
|
|
1258
|
+
|
|
1259
|
+
declare function provideSpeechSynthesis(): EnvironmentProviders;
|
|
1260
|
+
|
|
1261
|
+
declare function provideMutationObserver(): EnvironmentProviders;
|
|
1262
|
+
|
|
1263
|
+
declare function providePerformanceObserver(): EnvironmentProviders;
|
|
1264
|
+
|
|
1265
|
+
declare function provideWebAudio(): EnvironmentProviders;
|
|
1266
|
+
|
|
1267
|
+
declare function provideGamepad(): EnvironmentProviders;
|
|
1268
|
+
|
|
1269
|
+
declare function provideMediaApis(): EnvironmentProviders;
|
|
1270
|
+
declare function provideLocationApis(): EnvironmentProviders;
|
|
1271
|
+
declare function provideStorageApis(): EnvironmentProviders;
|
|
1272
|
+
declare function provideCommunicationApis(): EnvironmentProviders;
|
|
1273
|
+
|
|
1370
1274
|
interface BrowserWebApisConfig {
|
|
1371
1275
|
enableCamera?: boolean;
|
|
1372
1276
|
enableGeolocation?: boolean;
|
|
@@ -1393,61 +1297,13 @@ interface BrowserWebApisConfig {
|
|
|
1393
1297
|
enableSpeechSynthesis?: boolean;
|
|
1394
1298
|
enableMutationObserver?: boolean;
|
|
1395
1299
|
enablePerformanceObserver?: boolean;
|
|
1396
|
-
enableIdleDetector?: boolean;
|
|
1397
|
-
enableEyeDropper?: boolean;
|
|
1398
|
-
enableBarcodeDetector?: boolean;
|
|
1399
1300
|
enableWebAudio?: boolean;
|
|
1400
1301
|
enableGamepad?: boolean;
|
|
1401
|
-
enableWebBluetooth?: boolean;
|
|
1402
|
-
enableWebUsb?: boolean;
|
|
1403
|
-
enableWebNfc?: boolean;
|
|
1404
|
-
enablePaymentRequest?: boolean;
|
|
1405
|
-
enableCredentialManagement?: boolean;
|
|
1406
1302
|
}
|
|
1407
1303
|
declare const defaultBrowserWebApisConfig: BrowserWebApisConfig;
|
|
1408
1304
|
declare function provideBrowserWebApis(config?: BrowserWebApisConfig): EnvironmentProviders;
|
|
1409
|
-
declare function provideCamera(): EnvironmentProviders;
|
|
1410
|
-
declare function provideGeolocation(): EnvironmentProviders;
|
|
1411
|
-
declare function provideNotifications(): EnvironmentProviders;
|
|
1412
|
-
declare function provideClipboard(): EnvironmentProviders;
|
|
1413
|
-
declare function provideMediaDevices(): EnvironmentProviders;
|
|
1414
|
-
declare function provideBattery(): EnvironmentProviders;
|
|
1415
|
-
declare function provideWebShare(): EnvironmentProviders;
|
|
1416
|
-
declare function provideWebStorage(): EnvironmentProviders;
|
|
1417
|
-
declare function provideWebSocket(): EnvironmentProviders;
|
|
1418
|
-
declare function provideWebWorker(): EnvironmentProviders;
|
|
1419
|
-
declare function providePermissions(): EnvironmentProviders;
|
|
1420
|
-
declare function provideMediaApis(): EnvironmentProviders;
|
|
1421
|
-
declare function provideLocationApis(): EnvironmentProviders;
|
|
1422
|
-
declare function provideStorageApis(): EnvironmentProviders;
|
|
1423
|
-
declare function provideCommunicationApis(): EnvironmentProviders;
|
|
1424
|
-
declare function provideIntersectionObserver(): EnvironmentProviders;
|
|
1425
|
-
declare function provideResizeObserver(): EnvironmentProviders;
|
|
1426
|
-
declare function providePageVisibility(): EnvironmentProviders;
|
|
1427
|
-
declare function provideBroadcastChannel(): EnvironmentProviders;
|
|
1428
|
-
declare function provideNetworkInformation(): EnvironmentProviders;
|
|
1429
|
-
declare function provideScreenWakeLock(): EnvironmentProviders;
|
|
1430
|
-
declare function provideScreenOrientation(): EnvironmentProviders;
|
|
1431
|
-
declare function provideFullscreen(): EnvironmentProviders;
|
|
1432
|
-
declare function provideFileSystemAccess(): EnvironmentProviders;
|
|
1433
|
-
declare function provideMediaRecorder(): EnvironmentProviders;
|
|
1434
|
-
declare function provideServerSentEvents(): EnvironmentProviders;
|
|
1435
|
-
declare function provideVibration(): EnvironmentProviders;
|
|
1436
|
-
declare function provideSpeechSynthesis(): EnvironmentProviders;
|
|
1437
|
-
declare function provideMutationObserver(): EnvironmentProviders;
|
|
1438
|
-
declare function providePerformanceObserver(): EnvironmentProviders;
|
|
1439
|
-
declare function provideIdleDetector(): EnvironmentProviders;
|
|
1440
|
-
declare function provideEyeDropper(): EnvironmentProviders;
|
|
1441
|
-
declare function provideBarcodeDetector(): EnvironmentProviders;
|
|
1442
|
-
declare function provideWebAudio(): EnvironmentProviders;
|
|
1443
|
-
declare function provideGamepad(): EnvironmentProviders;
|
|
1444
|
-
declare function provideWebBluetooth(): EnvironmentProviders;
|
|
1445
|
-
declare function provideWebUsb(): EnvironmentProviders;
|
|
1446
|
-
declare function provideWebNfc(): EnvironmentProviders;
|
|
1447
|
-
declare function providePaymentRequest(): EnvironmentProviders;
|
|
1448
|
-
declare function provideCredentialManagement(): EnvironmentProviders;
|
|
1449
1305
|
|
|
1450
1306
|
declare const version = "0.1.0";
|
|
1451
1307
|
|
|
1452
|
-
export {
|
|
1453
|
-
export type { AudioAnalyserData, AudioContextState,
|
|
1308
|
+
export { BROWSER_API_LOGGER, BatteryService, BroadcastChannelService, BrowserApiBaseService, BrowserCapabilityService, BrowserSupportUtil, CameraService, ClipboardService, ConnectionRegistryBaseService, FileSystemAccessService, FullscreenService, GamepadService, GeolocationService, IntersectionObserverService, MediaDevicesService, MediaRecorderService, MutationObserverService, NetworkInformationService, NotificationService, PageVisibilityService, PerformanceObserverService, PermissionsService, ResizeObserverService, ScreenOrientationService, ScreenWakeLockService, ServerSentEventsService, SpeechSynthesisService, VibrationService, WebAudioService, WebShareService, WebSocketClient, WebSocketService, WebStorageService, WebWorkerService, permissionGuard as createPermissionGuard, defaultBrowserWebApisConfig, injectGamepad, injectIntersectionObserver, injectMutationObserver, injectNetworkInformation, injectPageVisibility, injectPerformanceObserver, injectResizeObserver, injectScreenOrientation, permissionGuard, provideBattery, provideBroadcastChannel, provideBrowserWebApis, provideCamera, provideClipboard, provideCommunicationApis, provideFileSystemAccess, provideFullscreen, provideGamepad, provideGeolocation, provideIntersectionObserver, provideLocationApis, provideMediaApis, provideMediaDevices, provideMediaRecorder, provideMutationObserver, provideNetworkInformation, provideNotifications, providePageVisibility, providePerformanceObserver, providePermissions, provideResizeObserver, provideScreenOrientation, provideScreenWakeLock, provideServerSentEvents, provideSpeechSynthesis, provideStorageApis, provideVibration, provideWebAudio, provideWebShare, provideWebSocket, provideWebStorage, provideWebWorker, version };
|
|
1309
|
+
export type { AudioAnalyserData, AudioContextState, BatteryInfo, BatteryManager, BrowserApiLogger, BrowserCapabilityId, BrowserError, BrowserPermissions, BrowserWebApisConfig, CameraCapabilities, CameraInfo, ConnectionType, EffectiveConnectionType, ElementInput, ElementSize, ErrorCallback, EventHandler, FileOpenOptions, FileSaveOptions, GamepadRef, GamepadState, GeolocationCoordinates, GeolocationError, GeolocationOptions, GeolocationPosition$1 as GeolocationPosition, GeolocationWatchOptions, IntersectionObserverOptions, IntersectionRef, MediaDevice, MediaDeviceKind, MediaDevicesInfo, MediaStreamConstraints$1 as MediaStreamConstraints, MediaTrackConstraints$1 as MediaTrackConstraints, MutationObserverOptions, MutationRef, NetworkInformation, NetworkInformationRef, OrientationInfo, OrientationLockType, OrientationType, PageVisibilityRef, PerformanceEntryType, PerformanceObserverConfig, PerformanceObserverRef, PermissionNameExt, PermissionRequest, RecordingOptions, RecordingResult, RecordingState, ResizeObserverOptions, ResizeRef, SSEConfig, SSEConnectionState, SSEMessage, ScreenOrientationRef, SpeechOptions, SpeechState, StorageEvent, StorageOptions, StorageValue, VibrationPattern, VibrationPreset, VisibilityState, WakeLockStatus, WakeLockType, WebSocketClientConfig, WebSocketConfig, WebSocketMessage, WebSocketRequestOptions, WebSocketState, WebSocketStatus, WebSocketStatusV2, WorkerMessage, WorkerStatus, WorkerTask };
|