-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hello! While running tsc on my TypeScript code that uses TextDecoder.decode I discovered that the TypeScript types for it are incorrect.
Take a look here: https://github.com/fastly/js-compute-runtime/blob/v3.35.1/types/globals.d.ts#L881:
declare class TextDecoder {
// TODO: We should throw a RangeError if supplied a `label` that we do not support
constructor(label?: 'unicode-1-1-utf-8' | 'utf-8' | 'utf8');
decode(input?: ArrayBuffer | ArrayBufferView): string;
get encoding(): 'utf-8';
}Note that the decode method is declared with only a single argument, but your docs and C++ code (as well as the MDN docs) support a second options argument.
That causes the following error when attempting to pass a second argument:

Metadata
Metadata
Assignees
Labels
No labels