forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urlsafe-base64.d.ts
50 lines (45 loc) · 1.2 KB
/
urlsafe-base64.d.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Type definitions for urlsafe-base64 v1.0.0
// Project: https://github.com/RGBboy/urlsafe-base64
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
declare module 'urlsafe-base64' {
/**
* Library version.
*/
export var version: string;
/**
* .encode
*
* return an encoded Buffer as URL Safe Base64
*
* Note: This function encodes to the RFC 4648 Spec where '+' is encoded
* as '-' and '/' is encoded as '_'. The padding character '=' is
* removed.
*
* @param {Buffer} buffer
* @return {String}
* @api public
*/
export function encode(buffer: Buffer): string;
/**
* .decode
*
* return an decoded URL Safe Base64 as Buffer
*
* @param {String}
* @return {Buffer}
* @api public
*/
export function decode(base64: string): Buffer;
/**
* .validate
*
* Validates a string if it is URL Safe Base64 encoded.
*
* @param {String}
* @return {Boolean}
* @api public
*/
export function validate(base64: string): boolean;
}