@types/audioworklet 0.0.22 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,4 +28,4 @@ This project does not respect semantic versioning as almost every change could p
28
28
 
29
29
  ## Deploy Metadata
30
30
 
31
- You can read what changed in version 0.0.22 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Faudioworklet%400.0.22.
31
+ You can read what changed in version 0.0.25 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Faudioworklet%400.0.25.
package/index.d.ts CHANGED
@@ -7,6 +7,19 @@
7
7
  interface AddEventListenerOptions extends EventListenerOptions {
8
8
  once?: boolean;
9
9
  passive?: boolean;
10
+ signal?: AbortSignal;
11
+ }
12
+
13
+ interface CustomEventInit<T = any> extends EventInit {
14
+ detail?: T;
15
+ }
16
+
17
+ interface ErrorEventInit extends EventInit {
18
+ colno?: number;
19
+ error?: any;
20
+ filename?: string;
21
+ lineno?: number;
22
+ message?: string;
10
23
  }
11
24
 
12
25
  interface EventInit {
@@ -27,6 +40,29 @@ interface MessageEventInit<T = any> extends EventInit {
27
40
  source?: MessageEventSource | null;
28
41
  }
29
42
 
43
+ interface PerformanceMarkOptions {
44
+ detail?: any;
45
+ startTime?: DOMHighResTimeStamp;
46
+ }
47
+
48
+ interface PerformanceMeasureOptions {
49
+ detail?: any;
50
+ duration?: DOMHighResTimeStamp;
51
+ end?: string | DOMHighResTimeStamp;
52
+ start?: string | DOMHighResTimeStamp;
53
+ }
54
+
55
+ interface PerformanceObserverInit {
56
+ buffered?: boolean;
57
+ entryTypes?: string[];
58
+ type?: string;
59
+ }
60
+
61
+ interface PromiseRejectionEventInit extends EventInit {
62
+ promise: Promise<any>;
63
+ reason?: any;
64
+ }
65
+
30
66
  interface QueuingStrategy<T = any> {
31
67
  highWaterMark?: number;
32
68
  size?: QueuingStrategySize<T>;
@@ -82,10 +118,25 @@ interface StreamPipeOptions {
82
118
  * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
83
119
  */
84
120
  preventClose?: boolean;
121
+ signal?: AbortSignal;
85
122
  }
86
123
 
87
124
  interface StructuredSerializeOptions {
88
- transfer?: any[];
125
+ transfer?: Transferable[];
126
+ }
127
+
128
+ interface TextDecodeOptions {
129
+ stream?: boolean;
130
+ }
131
+
132
+ interface TextDecoderOptions {
133
+ fatal?: boolean;
134
+ ignoreBOM?: boolean;
135
+ }
136
+
137
+ interface TextEncoderEncodeIntoResult {
138
+ read?: number;
139
+ written?: number;
89
140
  }
90
141
 
91
142
  interface Transformer<I = any, O = any> {
@@ -111,6 +162,41 @@ interface UnderlyingSource<R = any> {
111
162
  type?: undefined;
112
163
  }
113
164
 
165
+ /** A controller object that allows you to abort one or more DOM requests as and when desired. */
166
+ interface AbortController {
167
+ /** Returns the AbortSignal object associated with this object. */
168
+ readonly signal: AbortSignal;
169
+ /** Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */
170
+ abort(reason?: any): void;
171
+ }
172
+
173
+ declare var AbortController: {
174
+ prototype: AbortController;
175
+ new(): AbortController;
176
+ };
177
+
178
+ interface AbortSignalEventMap {
179
+ "abort": Event;
180
+ }
181
+
182
+ /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
183
+ interface AbortSignal extends EventTarget {
184
+ /** Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */
185
+ readonly aborted: boolean;
186
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
187
+ readonly reason: any;
188
+ addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
189
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
190
+ removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
191
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
192
+ }
193
+
194
+ declare var AbortSignal: {
195
+ prototype: AbortSignal;
196
+ new(): AbortSignal;
197
+ // abort(reason?: any): AbortSignal; - To be re-added in the future
198
+ };
199
+
114
200
  interface AudioWorkletGlobalScope extends WorkletGlobalScope {
115
201
  readonly currentFrame: number;
116
202
  readonly currentTime: number;
@@ -154,6 +240,32 @@ declare var CountQueuingStrategy: {
154
240
  new(init: QueuingStrategyInit): CountQueuingStrategy;
155
241
  };
156
242
 
243
+ interface CustomEvent<T = any> extends Event {
244
+ /** Returns any custom data event was created with. Typically used for synthetic events. */
245
+ readonly detail: T;
246
+ /** @deprecated */
247
+ initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void;
248
+ }
249
+
250
+ declare var CustomEvent: {
251
+ prototype: CustomEvent;
252
+ new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
253
+ };
254
+
255
+ /** Events providing information related to errors in scripts or in files. */
256
+ interface ErrorEvent extends Event {
257
+ readonly colno: number;
258
+ readonly error: any;
259
+ readonly filename: string;
260
+ readonly lineno: number;
261
+ readonly message: string;
262
+ }
263
+
264
+ declare var ErrorEvent: {
265
+ prototype: ErrorEvent;
266
+ new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;
267
+ };
268
+
157
269
  /** An event which takes place in the DOM. */
158
270
  interface Event {
159
271
  /** Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. */
@@ -243,6 +355,11 @@ declare var EventTarget: {
243
355
  new(): EventTarget;
244
356
  };
245
357
 
358
+ interface GenericTransformStream {
359
+ readonly readable: ReadableStream;
360
+ readonly writable: WritableStream;
361
+ }
362
+
246
363
  /** A message received by a target object. */
247
364
  interface MessageEvent<T = any> extends Event {
248
365
  /** Returns the data of the message. */
@@ -295,6 +412,103 @@ declare var MessagePort: {
295
412
  new(): MessagePort;
296
413
  };
297
414
 
415
+ interface PerformanceEventMap {
416
+ "resourcetimingbufferfull": Event;
417
+ }
418
+
419
+ /** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
420
+ interface Performance extends EventTarget {
421
+ onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
422
+ readonly timeOrigin: DOMHighResTimeStamp;
423
+ clearMarks(markName?: string): void;
424
+ clearMeasures(measureName?: string): void;
425
+ clearResourceTimings(): void;
426
+ getEntries(): PerformanceEntryList;
427
+ getEntriesByName(name: string, type?: string): PerformanceEntryList;
428
+ getEntriesByType(type: string): PerformanceEntryList;
429
+ mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
430
+ measure(measureName: string, startOrMeasureOptions?: string | PerformanceMeasureOptions, endMark?: string): PerformanceMeasure;
431
+ now(): DOMHighResTimeStamp;
432
+ setResourceTimingBufferSize(maxSize: number): void;
433
+ toJSON(): any;
434
+ addEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
435
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
436
+ removeEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
437
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
438
+ }
439
+
440
+ declare var Performance: {
441
+ prototype: Performance;
442
+ new(): Performance;
443
+ };
444
+
445
+ /** Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image). */
446
+ interface PerformanceEntry {
447
+ readonly duration: DOMHighResTimeStamp;
448
+ readonly entryType: string;
449
+ readonly name: string;
450
+ readonly startTime: DOMHighResTimeStamp;
451
+ toJSON(): any;
452
+ }
453
+
454
+ declare var PerformanceEntry: {
455
+ prototype: PerformanceEntry;
456
+ new(): PerformanceEntry;
457
+ };
458
+
459
+ /** PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline. */
460
+ interface PerformanceMark extends PerformanceEntry {
461
+ readonly detail: any;
462
+ }
463
+
464
+ declare var PerformanceMark: {
465
+ prototype: PerformanceMark;
466
+ new(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
467
+ };
468
+
469
+ /** PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline. */
470
+ interface PerformanceMeasure extends PerformanceEntry {
471
+ readonly detail: any;
472
+ }
473
+
474
+ declare var PerformanceMeasure: {
475
+ prototype: PerformanceMeasure;
476
+ new(): PerformanceMeasure;
477
+ };
478
+
479
+ interface PerformanceObserver {
480
+ disconnect(): void;
481
+ observe(options?: PerformanceObserverInit): void;
482
+ takeRecords(): PerformanceEntryList;
483
+ }
484
+
485
+ declare var PerformanceObserver: {
486
+ prototype: PerformanceObserver;
487
+ new(callback: PerformanceObserverCallback): PerformanceObserver;
488
+ readonly supportedEntryTypes: ReadonlyArray<string>;
489
+ };
490
+
491
+ interface PerformanceObserverEntryList {
492
+ getEntries(): PerformanceEntryList;
493
+ getEntriesByName(name: string, type?: string): PerformanceEntryList;
494
+ getEntriesByType(type: string): PerformanceEntryList;
495
+ }
496
+
497
+ declare var PerformanceObserverEntryList: {
498
+ prototype: PerformanceObserverEntryList;
499
+ new(): PerformanceObserverEntryList;
500
+ };
501
+
502
+ interface PromiseRejectionEvent extends Event {
503
+ readonly promise: Promise<any>;
504
+ readonly reason: any;
505
+ }
506
+
507
+ declare var PromiseRejectionEvent: {
508
+ prototype: PromiseRejectionEvent;
509
+ new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
510
+ };
511
+
298
512
  /** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
299
513
  interface ReadableStream<R = any> {
300
514
  readonly locked: boolean;
@@ -337,6 +551,76 @@ interface ReadableStreamGenericReader {
337
551
  cancel(reason?: any): Promise<void>;
338
552
  }
339
553
 
554
+ /** A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */
555
+ interface TextDecoder extends TextDecoderCommon {
556
+ /**
557
+ * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
558
+ *
559
+ * ```
560
+ * var string = "", decoder = new TextDecoder(encoding), buffer;
561
+ * while(buffer = next_chunk()) {
562
+ * string += decoder.decode(buffer, {stream:true});
563
+ * }
564
+ * string += decoder.decode(); // end-of-queue
565
+ * ```
566
+ *
567
+ * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
568
+ */
569
+ decode(input?: BufferSource, options?: TextDecodeOptions): string;
570
+ }
571
+
572
+ declare var TextDecoder: {
573
+ prototype: TextDecoder;
574
+ new(label?: string, options?: TextDecoderOptions): TextDecoder;
575
+ };
576
+
577
+ interface TextDecoderCommon {
578
+ /** Returns encoding's name, lowercased. */
579
+ readonly encoding: string;
580
+ /** Returns true if error mode is "fatal", otherwise false. */
581
+ readonly fatal: boolean;
582
+ /** Returns the value of ignore BOM. */
583
+ readonly ignoreBOM: boolean;
584
+ }
585
+
586
+ interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon {
587
+ readonly readable: ReadableStream<string>;
588
+ readonly writable: WritableStream<BufferSource>;
589
+ }
590
+
591
+ declare var TextDecoderStream: {
592
+ prototype: TextDecoderStream;
593
+ new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
594
+ };
595
+
596
+ /** TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */
597
+ interface TextEncoder extends TextEncoderCommon {
598
+ /** Returns the result of running UTF-8's encoder. */
599
+ encode(input?: string): Uint8Array;
600
+ /** Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. */
601
+ encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
602
+ }
603
+
604
+ declare var TextEncoder: {
605
+ prototype: TextEncoder;
606
+ new(): TextEncoder;
607
+ };
608
+
609
+ interface TextEncoderCommon {
610
+ /** Returns "utf-8". */
611
+ readonly encoding: string;
612
+ }
613
+
614
+ interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
615
+ readonly readable: ReadableStream<Uint8Array>;
616
+ readonly writable: WritableStream<string>;
617
+ }
618
+
619
+ declare var TextEncoderStream: {
620
+ prototype: TextEncoderStream;
621
+ new(): TextEncoderStream;
622
+ };
623
+
340
624
  interface TransformStream<I = any, O = any> {
341
625
  readonly readable: ReadableStream<O>;
342
626
  readonly writable: WritableStream<I>;
@@ -359,6 +643,54 @@ declare var TransformStreamDefaultController: {
359
643
  new(): TransformStreamDefaultController;
360
644
  };
361
645
 
646
+ /** The URL interface represents an object providing static methods used for creating object URLs. */
647
+ interface URL {
648
+ hash: string;
649
+ host: string;
650
+ hostname: string;
651
+ href: string;
652
+ toString(): string;
653
+ readonly origin: string;
654
+ password: string;
655
+ pathname: string;
656
+ port: string;
657
+ protocol: string;
658
+ search: string;
659
+ readonly searchParams: URLSearchParams;
660
+ username: string;
661
+ toJSON(): string;
662
+ }
663
+
664
+ declare var URL: {
665
+ prototype: URL;
666
+ new(url: string | URL, base?: string | URL): URL;
667
+ };
668
+
669
+ interface URLSearchParams {
670
+ /** Appends a specified key/value pair as a new search parameter. */
671
+ append(name: string, value: string): void;
672
+ /** Deletes the given search parameter, and its associated value, from the list of all search parameters. */
673
+ delete(name: string): void;
674
+ /** Returns the first value associated to the given search parameter. */
675
+ get(name: string): string | null;
676
+ /** Returns all the values association with a given search parameter. */
677
+ getAll(name: string): string[];
678
+ /** Returns a Boolean indicating if such a search parameter exists. */
679
+ has(name: string): boolean;
680
+ /** Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. */
681
+ set(name: string, value: string): void;
682
+ sort(): void;
683
+ /** Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
684
+ toString(): string;
685
+ forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
686
+ }
687
+
688
+ declare var URLSearchParams: {
689
+ prototype: URLSearchParams;
690
+ new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
691
+ toString(): string;
692
+ };
693
+
362
694
  /** Available only in secure contexts. */
363
695
  interface WorkletGlobalScope {
364
696
  }
@@ -547,7 +879,7 @@ declare namespace WebAssembly {
547
879
 
548
880
  type ImportExportKind = "function" | "global" | "memory" | "table";
549
881
  type TableKind = "anyfunc" | "externref";
550
- type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64";
882
+ type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
551
883
  type ExportValue = Function | Global | Memory | Table;
552
884
  type Exports = Record<string, ExportValue>;
553
885
  type ImportValue = ExportValue | number;
@@ -563,6 +895,10 @@ interface AudioWorkletProcessorConstructor {
563
895
  (options: any): AudioWorkletProcessor;
564
896
  }
565
897
 
898
+ interface PerformanceObserverCallback {
899
+ (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
900
+ }
901
+
566
902
  interface QueuingStrategySize<T = any> {
567
903
  (chunk: T): number;
568
904
  }
@@ -615,6 +951,7 @@ type BufferSource = ArrayBufferView | ArrayBuffer;
615
951
  type DOMHighResTimeStamp = number;
616
952
  type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
617
953
  type MessageEventSource = MessagePort;
954
+ type PerformanceEntryList = PerformanceEntry[];
618
955
  type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
619
956
  type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
620
957
  type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
package/iterable.d.ts CHANGED
@@ -6,3 +6,13 @@ interface MessageEvent<T = any> {
6
6
  /** @deprecated */
7
7
  initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
8
8
  }
9
+
10
+ interface URLSearchParams {
11
+ [Symbol.iterator](): IterableIterator<[string, string]>;
12
+ /** Returns an array of key, value pairs for every entry in the search params. */
13
+ entries(): IterableIterator<[string, string]>;
14
+ /** Returns a list of keys in the search params. */
15
+ keys(): IterableIterator<string>;
16
+ /** Returns a list of values in the search params. */
17
+ values(): IterableIterator<string>;
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/audioworklet",
3
- "version": "0.0.22",
3
+ "version": "0.0.25",
4
4
  "description": "Types for the global scope of Audio Worklets",
5
5
  "license": "MIT",
6
6
  "contributors": [],