-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.ts
More file actions
27 lines (22 loc) · 793 Bytes
/
index.d.ts
File metadata and controls
27 lines (22 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Encoding, MixedEncoding, KnownEncoding, KnownEncodingName } from './lib/encoding'
export class Transcoder<T = any> {
/**
* Create a Transcoder.
* @param formats Formats supported by consumer.
*/
constructor (formats: Array<'buffer'|'view'|'utf8'>)
/**
* Get an array of supported encoding objects.
*/
encodings (): Array<Encoding<any, T, any>>
/**
* Get the given encoding, creating a transcoder encoding if necessary.
* @param encoding Named encoding or encoding object.
*/
encoding<TIn, TFormat, TOut> (
encoding: MixedEncoding<TIn, TFormat, TOut>
): Encoding<TIn, T, TOut>
encoding<N extends KnownEncodingName> (encoding: N): KnownEncoding<N, T>
encoding (encoding: string): Encoding<any, T, any>
}
export * from './lib/encoding'