Files
DefinitelyTyped/types/fastestsmallesttextencoderdecoder/fastestsmallesttextencoderdecoder-tests.ts
Loren ☺️ 2839c0845c 🤖 Merge PR #63028 Add @types/fastestsmallesttextencoderdecoder by @lorensr
* Add generated files

* Add functions
2022-11-01 17:36:05 -07:00

9 lines
465 B
TypeScript

import { encode, decode, TextEncoder, TextDecoder, EncodingProgress } from 'fastestsmallesttextencoderdecoder';
const bytes = encode('hi'); // $ExpectType Uint8Array
decode(bytes); // $ExpectType string
decode(bytes, { stream: true }); // $ExpectType string
new TextDecoder().decode(bytes, { stream: true }); // $ExpectType string
new TextEncoder().encode('hi'); // $ExpectType Uint8Array
new TextEncoder().encodeInfo('hi', bytes); // $ExpectType EncodingProgress