-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
32 lines (32 loc) · 1.3 KB
/
Copy pathindex.d.ts
File metadata and controls
32 lines (32 loc) · 1.3 KB
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
28
29
30
31
32
/// <reference types="node" />
interface Base64Options {
/**
* Whether or not to use a URL-safe charset.
* @since 0.0.3
*/
urlSafe?: boolean;
}
interface EncodeOptions extends Base64Options {
}
interface DecodeOptions extends Base64Options {
}
/**
*
* Encodes `input` to base64 format.
* @param input A string.
* @param opts Encoding options. See {@link Base64Options} and {@link EncodeOptions}.
* @returns A base64 representation of `input`.
* @see [Base64Options](Base64Options) for details on properties common to {@link encode} and {@link decode}.
* @see [EncodeOptions](EncodeOptions) for details on properties exclusive to {@link encode}.
*/
declare function encode(input: Buffer | string, opts?: EncodeOptions): string;
/**
* Decodes `input` back to its original form.
* @param input A valid base64 string.
* @param opts Decoding options. See {@link Base64Options} and {@link DecodeOptions}.
* @returns The result of decoding `input`.
* @see [Base64Options](Base64Options) for details on properties common to {@link encode} and {@link decode}.
* @see [DecodeOptions](DecodeOptions) for details on properties exclusive to {@link decode}.
*/
declare function decode(input: string | Buffer, opts?: EncodeOptions): string;
export { encode, decode, Base64Options, DecodeOptions, EncodeOptions };