@angular-helpers/browser-web-apis 21.1.0 → 21.2.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 +418 -2
- package/README.md +389 -2
- package/fesm2022/angular-helpers-browser-web-apis.mjs +1104 -3
- package/package.json +1 -1
- package/types/angular-helpers-browser-web-apis.d.ts +400 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { DestroyRef, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { DestroyRef, Signal, ElementRef, EnvironmentProviders } from '@angular/core';
|
|
4
4
|
import { CanActivateFn } from '@angular/router';
|
|
5
5
|
|
|
6
6
|
type PermissionNameExt = PermissionName | 'clipboard-read' | 'clipboard-write';
|
|
@@ -126,7 +126,7 @@ declare class ClipboardService extends BrowserApiBaseService {
|
|
|
126
126
|
static ɵprov: i0.ɵɵInjectableDeclaration<ClipboardService>;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
type BrowserCapabilityId = 'permissions' | 'geolocation' | 'clipboard' | 'notification' | 'mediaDevices' | 'camera' | 'webWorker' | 'regexSecurity' | 'webStorage' | 'webShare' | 'battery' | 'webSocket';
|
|
129
|
+
type BrowserCapabilityId = 'permissions' | 'geolocation' | 'clipboard' | 'notification' | 'mediaDevices' | 'camera' | 'webWorker' | 'regexSecurity' | 'webStorage' | 'webShare' | 'battery' | 'webSocket' | 'intersectionObserver' | 'resizeObserver' | 'pageVisibility' | 'broadcastChannel' | 'networkInformation' | 'screenWakeLock' | 'screenOrientation' | 'fullscreen' | 'fileSystemAccess' | 'mediaRecorder' | 'serverSentEvents' | 'vibration' | 'speechSynthesis';
|
|
130
130
|
declare class BrowserCapabilityService {
|
|
131
131
|
getCapabilities(): readonly [{
|
|
132
132
|
readonly id: "permissions";
|
|
@@ -176,12 +176,64 @@ declare class BrowserCapabilityService {
|
|
|
176
176
|
readonly id: "webSocket";
|
|
177
177
|
readonly label: "WebSocket API";
|
|
178
178
|
readonly requiresSecureContext: false;
|
|
179
|
+
}, {
|
|
180
|
+
readonly id: "intersectionObserver";
|
|
181
|
+
readonly label: "Intersection Observer";
|
|
182
|
+
readonly requiresSecureContext: false;
|
|
183
|
+
}, {
|
|
184
|
+
readonly id: "resizeObserver";
|
|
185
|
+
readonly label: "Resize Observer";
|
|
186
|
+
readonly requiresSecureContext: false;
|
|
187
|
+
}, {
|
|
188
|
+
readonly id: "pageVisibility";
|
|
189
|
+
readonly label: "Page Visibility API";
|
|
190
|
+
readonly requiresSecureContext: false;
|
|
191
|
+
}, {
|
|
192
|
+
readonly id: "broadcastChannel";
|
|
193
|
+
readonly label: "Broadcast Channel API";
|
|
194
|
+
readonly requiresSecureContext: false;
|
|
195
|
+
}, {
|
|
196
|
+
readonly id: "networkInformation";
|
|
197
|
+
readonly label: "Network Information API";
|
|
198
|
+
readonly requiresSecureContext: false;
|
|
199
|
+
}, {
|
|
200
|
+
readonly id: "screenWakeLock";
|
|
201
|
+
readonly label: "Screen Wake Lock API";
|
|
202
|
+
readonly requiresSecureContext: true;
|
|
203
|
+
}, {
|
|
204
|
+
readonly id: "screenOrientation";
|
|
205
|
+
readonly label: "Screen Orientation API";
|
|
206
|
+
readonly requiresSecureContext: false;
|
|
207
|
+
}, {
|
|
208
|
+
readonly id: "fullscreen";
|
|
209
|
+
readonly label: "Fullscreen API";
|
|
210
|
+
readonly requiresSecureContext: false;
|
|
211
|
+
}, {
|
|
212
|
+
readonly id: "fileSystemAccess";
|
|
213
|
+
readonly label: "File System Access API";
|
|
214
|
+
readonly requiresSecureContext: true;
|
|
215
|
+
}, {
|
|
216
|
+
readonly id: "mediaRecorder";
|
|
217
|
+
readonly label: "MediaRecorder API";
|
|
218
|
+
readonly requiresSecureContext: true;
|
|
219
|
+
}, {
|
|
220
|
+
readonly id: "serverSentEvents";
|
|
221
|
+
readonly label: "Server-Sent Events";
|
|
222
|
+
readonly requiresSecureContext: false;
|
|
223
|
+
}, {
|
|
224
|
+
readonly id: "vibration";
|
|
225
|
+
readonly label: "Vibration API";
|
|
226
|
+
readonly requiresSecureContext: false;
|
|
227
|
+
}, {
|
|
228
|
+
readonly id: "speechSynthesis";
|
|
229
|
+
readonly label: "Speech Synthesis API";
|
|
230
|
+
readonly requiresSecureContext: false;
|
|
179
231
|
}];
|
|
180
232
|
isSecureContext(): boolean;
|
|
181
233
|
isSupported(capability: BrowserCapabilityId): boolean;
|
|
182
234
|
getAllStatuses(): {
|
|
183
|
-
id: "camera" | "geolocation" | "permissions" | "mediaDevices" | "clipboard" | "notification" | "webWorker" | "regexSecurity" | "webStorage" | "webShare" | "battery" | "webSocket";
|
|
184
|
-
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";
|
|
235
|
+
id: "camera" | "geolocation" | "permissions" | "mediaDevices" | "clipboard" | "notification" | "webWorker" | "regexSecurity" | "webStorage" | "webShare" | "battery" | "webSocket" | "intersectionObserver" | "resizeObserver" | "pageVisibility" | "broadcastChannel" | "networkInformation" | "screenWakeLock" | "screenOrientation" | "fullscreen" | "fileSystemAccess" | "mediaRecorder" | "serverSentEvents" | "vibration" | "speechSynthesis";
|
|
236
|
+
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";
|
|
185
237
|
supported: boolean;
|
|
186
238
|
secureContext: boolean;
|
|
187
239
|
requiresSecureContext: boolean;
|
|
@@ -387,6 +439,278 @@ declare class WebWorkerService extends BrowserApiBaseService {
|
|
|
387
439
|
static ɵprov: i0.ɵɵInjectableDeclaration<WebWorkerService>;
|
|
388
440
|
}
|
|
389
441
|
|
|
442
|
+
interface IntersectionObserverOptions {
|
|
443
|
+
root?: Element | Document | null;
|
|
444
|
+
rootMargin?: string;
|
|
445
|
+
threshold?: number | number[];
|
|
446
|
+
}
|
|
447
|
+
declare class IntersectionObserverService {
|
|
448
|
+
private readonly platformId;
|
|
449
|
+
isSupported(): boolean;
|
|
450
|
+
observe(element: Element, options?: IntersectionObserverOptions): Observable<IntersectionObserverEntry[]>;
|
|
451
|
+
observeVisibility(element: Element, options?: IntersectionObserverOptions): Observable<boolean>;
|
|
452
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionObserverService, never>;
|
|
453
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<IntersectionObserverService>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
interface ResizeObserverOptions {
|
|
457
|
+
box?: ResizeObserverBoxOptions;
|
|
458
|
+
}
|
|
459
|
+
interface ElementSize {
|
|
460
|
+
width: number;
|
|
461
|
+
height: number;
|
|
462
|
+
inlineSize: number;
|
|
463
|
+
blockSize: number;
|
|
464
|
+
}
|
|
465
|
+
declare class ResizeObserverService {
|
|
466
|
+
private readonly platformId;
|
|
467
|
+
isSupported(): boolean;
|
|
468
|
+
observe(element: Element, options?: ResizeObserverOptions): Observable<ResizeObserverEntry[]>;
|
|
469
|
+
observeSize(element: Element, options?: ResizeObserverOptions): Observable<ElementSize>;
|
|
470
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeObserverService, never>;
|
|
471
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ResizeObserverService>;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
type VisibilityState = 'visible' | 'hidden' | 'prerender';
|
|
475
|
+
declare class PageVisibilityService {
|
|
476
|
+
private readonly platformId;
|
|
477
|
+
isSupported(): boolean;
|
|
478
|
+
get isHidden(): boolean;
|
|
479
|
+
get visibilityState(): VisibilityState;
|
|
480
|
+
watch(): Observable<VisibilityState>;
|
|
481
|
+
watchVisibility(): Observable<boolean>;
|
|
482
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PageVisibilityService, never>;
|
|
483
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PageVisibilityService>;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
declare class BroadcastChannelService {
|
|
487
|
+
private readonly destroyRef;
|
|
488
|
+
private readonly platformId;
|
|
489
|
+
private channels;
|
|
490
|
+
isSupported(): boolean;
|
|
491
|
+
private ensureSupport;
|
|
492
|
+
open<T = unknown>(name: string): Observable<T>;
|
|
493
|
+
post<T = unknown>(name: string, data: T): void;
|
|
494
|
+
close(name: string): void;
|
|
495
|
+
closeAll(): void;
|
|
496
|
+
getOpenChannels(): string[];
|
|
497
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BroadcastChannelService, never>;
|
|
498
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BroadcastChannelService>;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown';
|
|
502
|
+
type EffectiveConnectionType = 'slow-2g' | '2g' | '3g' | '4g';
|
|
503
|
+
interface NetworkInformation {
|
|
504
|
+
type?: ConnectionType;
|
|
505
|
+
effectiveType?: EffectiveConnectionType;
|
|
506
|
+
downlink?: number;
|
|
507
|
+
downlinkMax?: number;
|
|
508
|
+
rtt?: number;
|
|
509
|
+
saveData?: boolean;
|
|
510
|
+
online: boolean;
|
|
511
|
+
}
|
|
512
|
+
declare class NetworkInformationService {
|
|
513
|
+
private readonly platformId;
|
|
514
|
+
isSupported(): boolean;
|
|
515
|
+
getSnapshot(): NetworkInformation;
|
|
516
|
+
watch(): Observable<NetworkInformation>;
|
|
517
|
+
get isOnline(): boolean;
|
|
518
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NetworkInformationService, never>;
|
|
519
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NetworkInformationService>;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
type WakeLockType = 'screen';
|
|
523
|
+
interface WakeLockStatus {
|
|
524
|
+
active: boolean;
|
|
525
|
+
type?: WakeLockType;
|
|
526
|
+
released?: boolean;
|
|
527
|
+
}
|
|
528
|
+
declare class ScreenWakeLockService extends BrowserApiBaseService {
|
|
529
|
+
private sentinel;
|
|
530
|
+
protected getApiName(): string;
|
|
531
|
+
isSupported(): boolean;
|
|
532
|
+
get isActive(): boolean;
|
|
533
|
+
request(type?: WakeLockType): Promise<WakeLockStatus>;
|
|
534
|
+
release(): Promise<void>;
|
|
535
|
+
watchStatus(): Observable<WakeLockStatus>;
|
|
536
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScreenWakeLockService, never>;
|
|
537
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ScreenWakeLockService>;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
type OrientationType = 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary';
|
|
541
|
+
type OrientationLockType = 'any' | 'natural' | 'landscape' | 'portrait' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary';
|
|
542
|
+
interface OrientationInfo {
|
|
543
|
+
type: OrientationType;
|
|
544
|
+
angle: number;
|
|
545
|
+
}
|
|
546
|
+
declare class ScreenOrientationService {
|
|
547
|
+
private readonly platformId;
|
|
548
|
+
isSupported(): boolean;
|
|
549
|
+
getSnapshot(): OrientationInfo;
|
|
550
|
+
get isPortrait(): boolean;
|
|
551
|
+
get isLandscape(): boolean;
|
|
552
|
+
watch(): Observable<OrientationInfo>;
|
|
553
|
+
lock(orientation: OrientationLockType): Promise<void>;
|
|
554
|
+
unlock(): void;
|
|
555
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScreenOrientationService, never>;
|
|
556
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ScreenOrientationService>;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
declare class FullscreenService {
|
|
560
|
+
private readonly destroyRef;
|
|
561
|
+
private readonly platformId;
|
|
562
|
+
isSupported(): boolean;
|
|
563
|
+
get isFullscreen(): boolean;
|
|
564
|
+
get fullscreenElement(): Element | null;
|
|
565
|
+
request(element?: Element): Promise<void>;
|
|
566
|
+
exit(): Promise<void>;
|
|
567
|
+
toggle(element?: Element): Promise<void>;
|
|
568
|
+
watch(): Observable<boolean>;
|
|
569
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FullscreenService, never>;
|
|
570
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FullscreenService>;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
interface FileOpenOptions {
|
|
574
|
+
multiple?: boolean;
|
|
575
|
+
excludeAcceptAllOption?: boolean;
|
|
576
|
+
types?: Array<{
|
|
577
|
+
description?: string;
|
|
578
|
+
accept: Record<string, string[]>;
|
|
579
|
+
}>;
|
|
580
|
+
}
|
|
581
|
+
interface FileSaveOptions {
|
|
582
|
+
suggestedName?: string;
|
|
583
|
+
excludeAcceptAllOption?: boolean;
|
|
584
|
+
types?: Array<{
|
|
585
|
+
description?: string;
|
|
586
|
+
accept: Record<string, string[]>;
|
|
587
|
+
}>;
|
|
588
|
+
}
|
|
589
|
+
declare class FileSystemAccessService extends BrowserApiBaseService {
|
|
590
|
+
protected getApiName(): string;
|
|
591
|
+
isSupported(): boolean;
|
|
592
|
+
private get win();
|
|
593
|
+
private ensureSupport;
|
|
594
|
+
openFile(options?: FileOpenOptions): Promise<File[]>;
|
|
595
|
+
saveFile(content: string | Blob, options?: FileSaveOptions): Promise<void>;
|
|
596
|
+
openDirectory(options?: {
|
|
597
|
+
id?: string;
|
|
598
|
+
mode?: 'read' | 'readwrite';
|
|
599
|
+
startIn?: string;
|
|
600
|
+
}): Promise<FileSystemDirectoryHandle | null>;
|
|
601
|
+
readFileAsText(file: File): Promise<string>;
|
|
602
|
+
readFileAsArrayBuffer(file: File): Promise<ArrayBuffer>;
|
|
603
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileSystemAccessService, never>;
|
|
604
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FileSystemAccessService>;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
type RecordingState = 'inactive' | 'recording' | 'paused';
|
|
608
|
+
interface RecordingOptions {
|
|
609
|
+
mimeType?: string;
|
|
610
|
+
audioBitsPerSecond?: number;
|
|
611
|
+
videoBitsPerSecond?: number;
|
|
612
|
+
bitsPerSecond?: number;
|
|
613
|
+
timeslice?: number;
|
|
614
|
+
}
|
|
615
|
+
interface RecordingResult {
|
|
616
|
+
blob: Blob;
|
|
617
|
+
url: string;
|
|
618
|
+
mimeType: string;
|
|
619
|
+
duration: number;
|
|
620
|
+
}
|
|
621
|
+
declare class MediaRecorderService extends BrowserApiBaseService {
|
|
622
|
+
private recorder;
|
|
623
|
+
private chunks;
|
|
624
|
+
private startTime;
|
|
625
|
+
private readonly dataSubject;
|
|
626
|
+
private readonly stateSubject;
|
|
627
|
+
protected getApiName(): string;
|
|
628
|
+
isSupported(): boolean;
|
|
629
|
+
get state(): RecordingState;
|
|
630
|
+
static isTypeSupported(mimeType: string): boolean;
|
|
631
|
+
watchState(): Observable<RecordingState>;
|
|
632
|
+
watchData(): Observable<Blob>;
|
|
633
|
+
start(stream: MediaStream, options?: RecordingOptions): Promise<void>;
|
|
634
|
+
pause(): void;
|
|
635
|
+
resume(): void;
|
|
636
|
+
stop(): RecordingResult | null;
|
|
637
|
+
getResult(): RecordingResult | null;
|
|
638
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MediaRecorderService, never>;
|
|
639
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MediaRecorderService>;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
type SSEConnectionState = 'connecting' | 'open' | 'closed';
|
|
643
|
+
interface SSEMessage<T = unknown> {
|
|
644
|
+
data: T;
|
|
645
|
+
type: string;
|
|
646
|
+
lastEventId: string;
|
|
647
|
+
origin: string;
|
|
648
|
+
}
|
|
649
|
+
interface SSEConfig {
|
|
650
|
+
withCredentials?: boolean;
|
|
651
|
+
eventTypes?: string[];
|
|
652
|
+
}
|
|
653
|
+
declare class ServerSentEventsService {
|
|
654
|
+
private readonly destroyRef;
|
|
655
|
+
private readonly platformId;
|
|
656
|
+
private sources;
|
|
657
|
+
isSupported(): boolean;
|
|
658
|
+
private ensureSupport;
|
|
659
|
+
connect<T = unknown>(url: string, config?: SSEConfig): Observable<SSEMessage<T>>;
|
|
660
|
+
disconnect(url: string): void;
|
|
661
|
+
disconnectAll(): void;
|
|
662
|
+
getState(url: string): SSEConnectionState;
|
|
663
|
+
getActiveConnections(): string[];
|
|
664
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ServerSentEventsService, never>;
|
|
665
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ServerSentEventsService>;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
type VibrationPattern = number | number[];
|
|
669
|
+
interface VibrationPreset {
|
|
670
|
+
success: VibrationPattern;
|
|
671
|
+
error: VibrationPattern;
|
|
672
|
+
notification: VibrationPattern;
|
|
673
|
+
doubleTap: VibrationPattern;
|
|
674
|
+
}
|
|
675
|
+
declare class VibrationService {
|
|
676
|
+
private readonly platformId;
|
|
677
|
+
readonly presets: VibrationPreset;
|
|
678
|
+
isSupported(): boolean;
|
|
679
|
+
vibrate(pattern?: VibrationPattern): boolean;
|
|
680
|
+
success(): boolean;
|
|
681
|
+
error(): boolean;
|
|
682
|
+
notification(): boolean;
|
|
683
|
+
doubleTap(): boolean;
|
|
684
|
+
stop(): boolean;
|
|
685
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VibrationService, never>;
|
|
686
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<VibrationService>;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
type SpeechState = 'idle' | 'speaking' | 'paused';
|
|
690
|
+
interface SpeechOptions {
|
|
691
|
+
lang?: string;
|
|
692
|
+
voice?: SpeechSynthesisVoice;
|
|
693
|
+
volume?: number;
|
|
694
|
+
rate?: number;
|
|
695
|
+
pitch?: number;
|
|
696
|
+
}
|
|
697
|
+
declare class SpeechSynthesisService {
|
|
698
|
+
private readonly destroyRef;
|
|
699
|
+
private readonly platformId;
|
|
700
|
+
isSupported(): boolean;
|
|
701
|
+
private ensureSupport;
|
|
702
|
+
get state(): SpeechState;
|
|
703
|
+
get isPending(): boolean;
|
|
704
|
+
getVoices(): SpeechSynthesisVoice[];
|
|
705
|
+
watchVoices(): Observable<SpeechSynthesisVoice[]>;
|
|
706
|
+
speak(text: string, options?: SpeechOptions): Observable<SpeechState>;
|
|
707
|
+
pause(): void;
|
|
708
|
+
resume(): void;
|
|
709
|
+
cancel(): void;
|
|
710
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SpeechSynthesisService, never>;
|
|
711
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SpeechSynthesisService>;
|
|
712
|
+
}
|
|
713
|
+
|
|
390
714
|
interface MediaDevice {
|
|
391
715
|
deviceId: string;
|
|
392
716
|
groupId: string;
|
|
@@ -476,6 +800,50 @@ interface GeolocationWatchOptions extends GeolocationOptions {
|
|
|
476
800
|
maximumAge?: number;
|
|
477
801
|
}
|
|
478
802
|
|
|
803
|
+
interface PageVisibilityRef {
|
|
804
|
+
readonly state: Signal<VisibilityState>;
|
|
805
|
+
readonly isVisible: Signal<boolean>;
|
|
806
|
+
readonly isHidden: Signal<boolean>;
|
|
807
|
+
}
|
|
808
|
+
declare function injectPageVisibility(): PageVisibilityRef;
|
|
809
|
+
|
|
810
|
+
interface ResizeRef {
|
|
811
|
+
readonly size: Signal<ElementSize | null>;
|
|
812
|
+
readonly width: Signal<number>;
|
|
813
|
+
readonly height: Signal<number>;
|
|
814
|
+
readonly inlineSize: Signal<number>;
|
|
815
|
+
readonly blockSize: Signal<number>;
|
|
816
|
+
}
|
|
817
|
+
declare function injectResizeObserver(elementOrRef: Element | ElementRef<Element>, options?: ResizeObserverOptions): ResizeRef;
|
|
818
|
+
|
|
819
|
+
interface IntersectionRef {
|
|
820
|
+
readonly isIntersecting: Signal<boolean>;
|
|
821
|
+
readonly isVisible: Signal<boolean>;
|
|
822
|
+
}
|
|
823
|
+
declare function injectIntersectionObserver(elementOrRef: Element | ElementRef<Element>, options?: IntersectionObserverOptions): IntersectionRef;
|
|
824
|
+
|
|
825
|
+
interface NetworkInformationRef {
|
|
826
|
+
readonly snapshot: Signal<NetworkInformation>;
|
|
827
|
+
readonly online: Signal<boolean>;
|
|
828
|
+
readonly effectiveType: Signal<EffectiveConnectionType | undefined>;
|
|
829
|
+
readonly downlink: Signal<number | undefined>;
|
|
830
|
+
readonly rtt: Signal<number | undefined>;
|
|
831
|
+
readonly type: Signal<ConnectionType | undefined>;
|
|
832
|
+
readonly saveData: Signal<boolean | undefined>;
|
|
833
|
+
}
|
|
834
|
+
declare function injectNetworkInformation(): NetworkInformationRef;
|
|
835
|
+
|
|
836
|
+
interface ScreenOrientationRef {
|
|
837
|
+
readonly orientation: Signal<OrientationInfo>;
|
|
838
|
+
readonly type: Signal<OrientationType>;
|
|
839
|
+
readonly angle: Signal<number>;
|
|
840
|
+
readonly isPortrait: Signal<boolean>;
|
|
841
|
+
readonly isLandscape: Signal<boolean>;
|
|
842
|
+
lock(orientation: OrientationLockType): Promise<void>;
|
|
843
|
+
unlock(): void;
|
|
844
|
+
}
|
|
845
|
+
declare function injectScreenOrientation(): ScreenOrientationRef;
|
|
846
|
+
|
|
479
847
|
declare class BrowserSupportUtil {
|
|
480
848
|
static isSupported(feature: string): boolean;
|
|
481
849
|
static getUnsupportedFeatures(): string[];
|
|
@@ -512,6 +880,19 @@ interface BrowserWebApisConfig {
|
|
|
512
880
|
enableWebStorage?: boolean;
|
|
513
881
|
enableWebSocket?: boolean;
|
|
514
882
|
enableWebWorker?: boolean;
|
|
883
|
+
enableIntersectionObserver?: boolean;
|
|
884
|
+
enableResizeObserver?: boolean;
|
|
885
|
+
enablePageVisibility?: boolean;
|
|
886
|
+
enableBroadcastChannel?: boolean;
|
|
887
|
+
enableNetworkInformation?: boolean;
|
|
888
|
+
enableScreenWakeLock?: boolean;
|
|
889
|
+
enableScreenOrientation?: boolean;
|
|
890
|
+
enableFullscreen?: boolean;
|
|
891
|
+
enableFileSystemAccess?: boolean;
|
|
892
|
+
enableMediaRecorder?: boolean;
|
|
893
|
+
enableServerSentEvents?: boolean;
|
|
894
|
+
enableVibration?: boolean;
|
|
895
|
+
enableSpeechSynthesis?: boolean;
|
|
515
896
|
}
|
|
516
897
|
declare const defaultBrowserWebApisConfig: BrowserWebApisConfig;
|
|
517
898
|
declare function provideBrowserWebApis(config?: BrowserWebApisConfig): EnvironmentProviders;
|
|
@@ -530,8 +911,21 @@ declare function provideMediaApis(): EnvironmentProviders;
|
|
|
530
911
|
declare function provideLocationApis(): EnvironmentProviders;
|
|
531
912
|
declare function provideStorageApis(): EnvironmentProviders;
|
|
532
913
|
declare function provideCommunicationApis(): EnvironmentProviders;
|
|
914
|
+
declare function provideIntersectionObserver(): EnvironmentProviders;
|
|
915
|
+
declare function provideResizeObserver(): EnvironmentProviders;
|
|
916
|
+
declare function providePageVisibility(): EnvironmentProviders;
|
|
917
|
+
declare function provideBroadcastChannel(): EnvironmentProviders;
|
|
918
|
+
declare function provideNetworkInformation(): EnvironmentProviders;
|
|
919
|
+
declare function provideScreenWakeLock(): EnvironmentProviders;
|
|
920
|
+
declare function provideScreenOrientation(): EnvironmentProviders;
|
|
921
|
+
declare function provideFullscreen(): EnvironmentProviders;
|
|
922
|
+
declare function provideFileSystemAccess(): EnvironmentProviders;
|
|
923
|
+
declare function provideMediaRecorder(): EnvironmentProviders;
|
|
924
|
+
declare function provideServerSentEvents(): EnvironmentProviders;
|
|
925
|
+
declare function provideVibration(): EnvironmentProviders;
|
|
926
|
+
declare function provideSpeechSynthesis(): EnvironmentProviders;
|
|
533
927
|
|
|
534
928
|
declare const version = "0.1.0";
|
|
535
929
|
|
|
536
|
-
export { BatteryService, BrowserApiBaseService, BrowserCapabilityService, BrowserSupportUtil, CameraService, ClipboardService, GeolocationService, MediaDevicesService, NotificationService, PermissionsService, WebShareService, WebSocketService, WebStorageService, WebWorkerService, permissionGuard as createPermissionGuard, defaultBrowserWebApisConfig, permissionGuard, provideBattery, provideBrowserWebApis, provideCamera, provideClipboard, provideCommunicationApis, provideGeolocation, provideLocationApis, provideMediaApis, provideMediaDevices, provideNotifications, providePermissions, provideStorageApis, provideWebShare, provideWebSocket, provideWebStorage, provideWebWorker, version };
|
|
537
|
-
export type { BatteryInfo, BatteryManager, BrowserCapabilityId, BrowserError, BrowserPermissions, BrowserWebApisConfig, CameraCapabilities, CameraInfo, ErrorCallback, EventHandler, GeolocationCoordinates, GeolocationError, GeolocationOptions, GeolocationPosition$1 as GeolocationPosition, GeolocationWatchOptions, MediaDevice, MediaDeviceKind, MediaDevicesInfo, MediaStreamConstraints$1 as MediaStreamConstraints, MediaTrackConstraints$1 as MediaTrackConstraints, PermissionNameExt, PermissionRequest, StorageEvent, StorageOptions, StorageValue, WebSocketConfig, WebSocketMessage, WebSocketStatus, WorkerMessage, WorkerStatus, WorkerTask };
|
|
930
|
+
export { BatteryService, BroadcastChannelService, BrowserApiBaseService, BrowserCapabilityService, BrowserSupportUtil, CameraService, ClipboardService, FileSystemAccessService, FullscreenService, GeolocationService, IntersectionObserverService, MediaDevicesService, MediaRecorderService, NetworkInformationService, NotificationService, PageVisibilityService, PermissionsService, ResizeObserverService, ScreenOrientationService, ScreenWakeLockService, ServerSentEventsService, SpeechSynthesisService, VibrationService, WebShareService, WebSocketService, WebStorageService, WebWorkerService, permissionGuard as createPermissionGuard, defaultBrowserWebApisConfig, injectIntersectionObserver, injectNetworkInformation, injectPageVisibility, injectResizeObserver, injectScreenOrientation, permissionGuard, provideBattery, provideBroadcastChannel, provideBrowserWebApis, provideCamera, provideClipboard, provideCommunicationApis, provideFileSystemAccess, provideFullscreen, provideGeolocation, provideIntersectionObserver, provideLocationApis, provideMediaApis, provideMediaDevices, provideMediaRecorder, provideNetworkInformation, provideNotifications, providePageVisibility, providePermissions, provideResizeObserver, provideScreenOrientation, provideScreenWakeLock, provideServerSentEvents, provideSpeechSynthesis, provideStorageApis, provideVibration, provideWebShare, provideWebSocket, provideWebStorage, provideWebWorker, version };
|
|
931
|
+
export type { BatteryInfo, BatteryManager, BrowserCapabilityId, BrowserError, BrowserPermissions, BrowserWebApisConfig, CameraCapabilities, CameraInfo, ConnectionType, EffectiveConnectionType, ElementSize, ErrorCallback, EventHandler, FileOpenOptions, FileSaveOptions, GeolocationCoordinates, GeolocationError, GeolocationOptions, GeolocationPosition$1 as GeolocationPosition, GeolocationWatchOptions, IntersectionObserverOptions, IntersectionRef, MediaDevice, MediaDeviceKind, MediaDevicesInfo, MediaStreamConstraints$1 as MediaStreamConstraints, MediaTrackConstraints$1 as MediaTrackConstraints, NetworkInformation, NetworkInformationRef, OrientationInfo, OrientationLockType, OrientationType, PageVisibilityRef, PermissionNameExt, PermissionRequest, RecordingOptions, RecordingResult, RecordingState, ResizeObserverOptions, ResizeRef, SSEConfig, SSEConnectionState, SSEMessage, ScreenOrientationRef, SpeechOptions, SpeechState, StorageEvent, StorageOptions, StorageValue, VibrationPattern, VibrationPreset, VisibilityState, WakeLockStatus, WakeLockType, WebSocketConfig, WebSocketMessage, WebSocketStatus, WorkerMessage, WorkerStatus, WorkerTask };
|