Add types to the 'b2a' NPM package (#35363)

* Add b2a types

* Update tsconfig.json

* b2a build fixes
This commit is contained in:
PatPL 2019-05-14 20:12:09 +02:00 committed by Nathan Shively-Sanders
parent 3619e307a9
commit e4d71d1dd4
4 changed files with 47 additions and 0 deletions

4
types/b2a/b2a-tests.ts Normal file
View File

@ -0,0 +1,4 @@
import { btoa, atob } from "b2a";
const b64 = btoa ("foo");
const text = atob (b64);

19
types/b2a/index.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
// Type definitions for b2a 1.0
// Project: https://github.com/kaelzhang/b2a#readme
// Definitions by: PatPL <https://github.com/PatPL>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Converts base64 string back into original text
*/
declare function atob(base64: string): string;
/**
* Converts text into base64 string
*/
declare function btoa(text: string): string;
export {
atob,
btoa
};

23
types/b2a/tsconfig.json Normal file
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",
"b2a-tests.ts"
]
}

1
types/b2a/tslint.json Normal file
View File

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