@types/audioworklet 0.0.23 → 0.0.26

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.23 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Faudioworklet%400.0.23.
31
+ You can read what changed in version 0.0.26 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Faudioworklet%400.0.26.
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,12 +118,27 @@ 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
125
  transfer?: Transferable[];
89
126
  }
90
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;
140
+ }
141
+
91
142
  interface Transformer<I = any, O = any> {
92
143
  flush?: TransformerFlushCallback<O>;
93
144
  readableType?: undefined;
@@ -111,6 +162,42 @@ 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
+ throwIfAborted(): void;
189
+ addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
190
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
191
+ removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
192
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
193
+ }
194
+
195
+ declare var AbortSignal: {
196
+ prototype: AbortSignal;
197
+ new(): AbortSignal;
198
+ // abort(reason?: any): AbortSignal; - To be re-added in the future
199
+ };
200
+
114
201
  interface AudioWorkletGlobalScope extends WorkletGlobalScope {
115
202
  readonly currentFrame: number;
116
203
  readonly currentTime: number;
@@ -132,6 +219,10 @@ declare var AudioWorkletProcessor: {
132
219
  new(): AudioWorkletProcessor;
133
220
  };
134
221
 
222
+ interface AudioWorkletProcessorImpl extends AudioWorkletProcessor {
223
+ process(inputs: Float32Array[][], outputs: Float32Array[][], parameters: Record<string, Float32Array>): boolean;
224
+ }
225
+
135
226
  /** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */
136
227
  interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
137
228
  readonly highWaterMark: number;
@@ -154,6 +245,32 @@ declare var CountQueuingStrategy: {
154
245
  new(init: QueuingStrategyInit): CountQueuingStrategy;
155
246
  };
156
247
 
248
+ interface CustomEvent<T = any> extends Event {
249
+ /** Returns any custom data event was created with. Typically used for synthetic events. */
250
+ readonly detail: T;
251
+ /** @deprecated */
252
+ initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void;
253
+ }
254
+
255
+ declare var CustomEvent: {
256
+ prototype: CustomEvent;
257
+ new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
258
+ };
259
+
260
+ /** Events providing information related to errors in scripts or in files. */
261
+ interface ErrorEvent extends Event {
262
+ readonly colno: number;
263
+ readonly error: any;
264
+ readonly filename: string;
265
+ readonly lineno: number;
266
+ readonly message: string;
267
+ }
268
+
269
+ declare var ErrorEvent: {
270
+ prototype: ErrorEvent;
271
+ new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;
272
+ };
273
+
157
274
  /** An event which takes place in the DOM. */
158
275
  interface Event {
159
276
  /** 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 +360,11 @@ declare var EventTarget: {
243
360
  new(): EventTarget;
244
361
  };
245
362
 
363
+ interface GenericTransformStream {
364
+ readonly readable: ReadableStream;
365
+ readonly writable: WritableStream;
366
+ }
367
+
246
368
  /** A message received by a target object. */
247
369
  interface MessageEvent<T = any> extends Event {
248
370
  /** Returns the data of the message. */
@@ -295,6 +417,103 @@ declare var MessagePort: {
295
417
  new(): MessagePort;
296
418
  };
297
419
 
420
+ interface PerformanceEventMap {
421
+ "resourcetimingbufferfull": Event;
422
+ }
423
+
424
+ /** 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. */
425
+ interface Performance extends EventTarget {
426
+ onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
427
+ readonly timeOrigin: DOMHighResTimeStamp;
428
+ clearMarks(markName?: string): void;
429
+ clearMeasures(measureName?: string): void;
430
+ clearResourceTimings(): void;
431
+ getEntries(): PerformanceEntryList;
432
+ getEntriesByName(name: string, type?: string): PerformanceEntryList;
433
+ getEntriesByType(type: string): PerformanceEntryList;
434
+ mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
435
+ measure(measureName: string, startOrMeasureOptions?: string | PerformanceMeasureOptions, endMark?: string): PerformanceMeasure;
436
+ now(): DOMHighResTimeStamp;
437
+ setResourceTimingBufferSize(maxSize: number): void;
438
+ toJSON(): any;
439
+ addEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
440
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
441
+ removeEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
442
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
443
+ }
444
+
445
+ declare var Performance: {
446
+ prototype: Performance;
447
+ new(): Performance;
448
+ };
449
+
450
+ /** 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). */
451
+ interface PerformanceEntry {
452
+ readonly duration: DOMHighResTimeStamp;
453
+ readonly entryType: string;
454
+ readonly name: string;
455
+ readonly startTime: DOMHighResTimeStamp;
456
+ toJSON(): any;
457
+ }
458
+
459
+ declare var PerformanceEntry: {
460
+ prototype: PerformanceEntry;
461
+ new(): PerformanceEntry;
462
+ };
463
+
464
+ /** 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. */
465
+ interface PerformanceMark extends PerformanceEntry {
466
+ readonly detail: any;
467
+ }
468
+
469
+ declare var PerformanceMark: {
470
+ prototype: PerformanceMark;
471
+ new(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
472
+ };
473
+
474
+ /** 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. */
475
+ interface PerformanceMeasure extends PerformanceEntry {
476
+ readonly detail: any;
477
+ }
478
+
479
+ declare var PerformanceMeasure: {
480
+ prototype: PerformanceMeasure;
481
+ new(): PerformanceMeasure;
482
+ };
483
+
484
+ interface PerformanceObserver {
485
+ disconnect(): void;
486
+ observe(options?: PerformanceObserverInit): void;
487
+ takeRecords(): PerformanceEntryList;
488
+ }
489
+
490
+ declare var PerformanceObserver: {
491
+ prototype: PerformanceObserver;
492
+ new(callback: PerformanceObserverCallback): PerformanceObserver;
493
+ readonly supportedEntryTypes: ReadonlyArray<string>;
494
+ };
495
+
496
+ interface PerformanceObserverEntryList {
497
+ getEntries(): PerformanceEntryList;
498
+ getEntriesByName(name: string, type?: string): PerformanceEntryList;
499
+ getEntriesByType(type: string): PerformanceEntryList;
500
+ }
501
+
502
+ declare var PerformanceObserverEntryList: {
503
+ prototype: PerformanceObserverEntryList;
504
+ new(): PerformanceObserverEntryList;
505
+ };
506
+
507
+ interface PromiseRejectionEvent extends Event {
508
+ readonly promise: Promise<any>;
509
+ readonly reason: any;
510
+ }
511
+
512
+ declare var PromiseRejectionEvent: {
513
+ prototype: PromiseRejectionEvent;
514
+ new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
515
+ };
516
+
298
517
  /** 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
518
  interface ReadableStream<R = any> {
300
519
  readonly locked: boolean;
@@ -337,6 +556,76 @@ interface ReadableStreamGenericReader {
337
556
  cancel(reason?: any): Promise<void>;
338
557
  }
339
558
 
559
+ /** 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. */
560
+ interface TextDecoder extends TextDecoderCommon {
561
+ /**
562
+ * 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.
563
+ *
564
+ * ```
565
+ * var string = "", decoder = new TextDecoder(encoding), buffer;
566
+ * while(buffer = next_chunk()) {
567
+ * string += decoder.decode(buffer, {stream:true});
568
+ * }
569
+ * string += decoder.decode(); // end-of-queue
570
+ * ```
571
+ *
572
+ * If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
573
+ */
574
+ decode(input?: BufferSource, options?: TextDecodeOptions): string;
575
+ }
576
+
577
+ declare var TextDecoder: {
578
+ prototype: TextDecoder;
579
+ new(label?: string, options?: TextDecoderOptions): TextDecoder;
580
+ };
581
+
582
+ interface TextDecoderCommon {
583
+ /** Returns encoding's name, lowercased. */
584
+ readonly encoding: string;
585
+ /** Returns true if error mode is "fatal", otherwise false. */
586
+ readonly fatal: boolean;
587
+ /** Returns the value of ignore BOM. */
588
+ readonly ignoreBOM: boolean;
589
+ }
590
+
591
+ interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon {
592
+ readonly readable: ReadableStream<string>;
593
+ readonly writable: WritableStream<BufferSource>;
594
+ }
595
+
596
+ declare var TextDecoderStream: {
597
+ prototype: TextDecoderStream;
598
+ new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
599
+ };
600
+
601
+ /** 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. */
602
+ interface TextEncoder extends TextEncoderCommon {
603
+ /** Returns the result of running UTF-8's encoder. */
604
+ encode(input?: string): Uint8Array;
605
+ /** 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. */
606
+ encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
607
+ }
608
+
609
+ declare var TextEncoder: {
610
+ prototype: TextEncoder;
611
+ new(): TextEncoder;
612
+ };
613
+
614
+ interface TextEncoderCommon {
615
+ /** Returns "utf-8". */
616
+ readonly encoding: string;
617
+ }
618
+
619
+ interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {
620
+ readonly readable: ReadableStream<Uint8Array>;
621
+ readonly writable: WritableStream<string>;
622
+ }
623
+
624
+ declare var TextEncoderStream: {
625
+ prototype: TextEncoderStream;
626
+ new(): TextEncoderStream;
627
+ };
628
+
340
629
  interface TransformStream<I = any, O = any> {
341
630
  readonly readable: ReadableStream<O>;
342
631
  readonly writable: WritableStream<I>;
@@ -359,6 +648,54 @@ declare var TransformStreamDefaultController: {
359
648
  new(): TransformStreamDefaultController;
360
649
  };
361
650
 
651
+ /** The URL interface represents an object providing static methods used for creating object URLs. */
652
+ interface URL {
653
+ hash: string;
654
+ host: string;
655
+ hostname: string;
656
+ href: string;
657
+ toString(): string;
658
+ readonly origin: string;
659
+ password: string;
660
+ pathname: string;
661
+ port: string;
662
+ protocol: string;
663
+ search: string;
664
+ readonly searchParams: URLSearchParams;
665
+ username: string;
666
+ toJSON(): string;
667
+ }
668
+
669
+ declare var URL: {
670
+ prototype: URL;
671
+ new(url: string | URL, base?: string | URL): URL;
672
+ };
673
+
674
+ interface URLSearchParams {
675
+ /** Appends a specified key/value pair as a new search parameter. */
676
+ append(name: string, value: string): void;
677
+ /** Deletes the given search parameter, and its associated value, from the list of all search parameters. */
678
+ delete(name: string): void;
679
+ /** Returns the first value associated to the given search parameter. */
680
+ get(name: string): string | null;
681
+ /** Returns all the values association with a given search parameter. */
682
+ getAll(name: string): string[];
683
+ /** Returns a Boolean indicating if such a search parameter exists. */
684
+ has(name: string): boolean;
685
+ /** Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. */
686
+ set(name: string, value: string): void;
687
+ sort(): void;
688
+ /** Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */
689
+ toString(): string;
690
+ forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
691
+ }
692
+
693
+ declare var URLSearchParams: {
694
+ prototype: URLSearchParams;
695
+ new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
696
+ toString(): string;
697
+ };
698
+
362
699
  /** Available only in secure contexts. */
363
700
  interface WorkletGlobalScope {
364
701
  }
@@ -560,7 +897,11 @@ declare namespace WebAssembly {
560
897
  }
561
898
 
562
899
  interface AudioWorkletProcessorConstructor {
563
- (options: any): AudioWorkletProcessor;
900
+ new (options: any): AudioWorkletProcessorImpl;
901
+ }
902
+
903
+ interface PerformanceObserverCallback {
904
+ (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
564
905
  }
565
906
 
566
907
  interface QueuingStrategySize<T = any> {
@@ -615,6 +956,7 @@ type BufferSource = ArrayBufferView | ArrayBuffer;
615
956
  type DOMHighResTimeStamp = number;
616
957
  type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
617
958
  type MessageEventSource = MessagePort;
959
+ type PerformanceEntryList = PerformanceEntry[];
618
960
  type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
619
961
  type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
620
962
  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.23",
3
+ "version": "0.0.26",
4
4
  "description": "Types for the global scope of Audio Worklets",
5
5
  "license": "MIT",
6
6
  "contributors": [],