diff --git a/types/b2a/b2a-tests.ts b/types/b2a/b2a-tests.ts new file mode 100644 index 0000000000..9ab039fc41 --- /dev/null +++ b/types/b2a/b2a-tests.ts @@ -0,0 +1,4 @@ +import { btoa, atob } from "b2a"; + +const b64 = btoa ("foo"); +const text = atob (b64); diff --git a/types/b2a/index.d.ts b/types/b2a/index.d.ts new file mode 100644 index 0000000000..75782f076b --- /dev/null +++ b/types/b2a/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for b2a 1.0 +// Project: https://github.com/kaelzhang/b2a#readme +// Definitions by: 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 +}; diff --git a/types/b2a/tsconfig.json b/types/b2a/tsconfig.json new file mode 100644 index 0000000000..c68a414bce --- /dev/null +++ b/types/b2a/tsconfig.json @@ -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" + ] +} diff --git a/types/b2a/tslint.json b/types/b2a/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/b2a/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }