Merge pull request #24496 from urish/base64-url

add types for base64-url
This commit is contained in:
Nathan Shively-Sanders
2018-03-26 11:18:37 -07:00
committed by GitHub
4 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import * as base64url from 'base64-url';
base64url.encode('Node.js is awesome.'); // $ExpectType string
base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg'); // $ExpectType string
base64url.escape('This+is/goingto+escape=='); // $ExpectType string
base64url.unescape('This-is_goingto-escape'); // $ExpectType string
base64url.encode('string to encode', 'ascii'); // $ExpectType string
base64url.decode('string to decode', 'ascii'); // $ExpectType string

9
types/base64-url/index.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
// Type definitions for base64-url 2.2
// Project: https://github.com/joaquimserafim/base64-url
// Definitions by: Uri Shaked <https://github.com/urish>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function decode(value: string, encoding?: string): string;
export function encode(value: string, encoding?: string): string;
export function escape(value: string): string;
export function unescape(value: string): string;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"base64-url-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }