diff --git a/types/fast64/fast64-tests.ts b/types/fast64/fast64-tests.ts new file mode 100644 index 0000000000..f038b9d0a8 --- /dev/null +++ b/types/fast64/fast64-tests.ts @@ -0,0 +1,8 @@ +import * as fast64 from "fast64"; + +fast64.encode(""); // $ExpectType string +fast64.decode(""); // $ExpectType string +fast64.decode("", { uint8Array: true }); // $ExpectType Uint8Array +fast64.urlencode(""); // $ExpectType string +fast64.urldecode(""); // $ExpectType string +fast64.urldecode("", { uint8Array: true }); // $ExpectType Uint8Array diff --git a/types/fast64/index.d.ts b/types/fast64/index.d.ts new file mode 100644 index 0000000000..47f067859c --- /dev/null +++ b/types/fast64/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for fast64 0.5 +// Project: https://github.com/superhuman/fast64 +// Definitions by: Rares Matei +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Options { + uint8Array: boolean; +} + +export function encode(value: string): string; +export function decode(base64: string): string; +export function decode(base64: string, options: Options): Uint8Array; +export function urlencode(value: string): string; +export function urldecode(base64: string): string; +export function urldecode(base64: string, options: Options): Uint8Array; diff --git a/types/fast64/tsconfig.json b/types/fast64/tsconfig.json new file mode 100644 index 0000000000..4ad215d37c --- /dev/null +++ b/types/fast64/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", + "fast64-tests.ts" + ] +} \ No newline at end of file diff --git a/types/fast64/tslint.json b/types/fast64/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fast64/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }