-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): Vendor in TextEncoderCommon type (#5221)
`TextEncoderCommon` is a type from `lib.dom.d.ts`. We don't want to require users to set DOM types, so we vendor it in. It's a relatively simple type, so we don't have to worry about potential conflicts or user issues.
- Loading branch information
1 parent
fb1c284
commit fb267e0
Showing
4 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Vendored type from TS 3.8 `typescript/lib/lib.dom.d.ts`. | ||
* | ||
* Type is vendored in so that users don't have to opt-in to DOM types. | ||
*/ | ||
export interface TextEncoderCommon { | ||
/** | ||
* Returns "utf-8". | ||
*/ | ||
readonly encoding: string; | ||
} | ||
|
||
// Combination of global TextEncoder and Node require('util').TextEncoder | ||
export interface TextEncoderInternal extends TextEncoderCommon { | ||
encode(input?: string): Uint8Array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters