diff --git a/types/wordpress-hash-node/index.d.ts b/types/wordpress-hash-node/index.d.ts new file mode 100644 index 0000000000..145475f0d2 --- /dev/null +++ b/types/wordpress-hash-node/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for wordpress-hash-node 1.0 +// Project: https://github.com/AlexAlbala/wordpress-hash-node +// Definitions by: Glenn Reyes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function HashPassword(password: string): string; +export function CheckPassword(password: string, hash: string): boolean; diff --git a/types/wordpress-hash-node/tsconfig.json b/types/wordpress-hash-node/tsconfig.json new file mode 100644 index 0000000000..225c04b3dc --- /dev/null +++ b/types/wordpress-hash-node/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "wordpress-hash-node-tests.ts" + ] +} diff --git a/types/wordpress-hash-node/tslint.json b/types/wordpress-hash-node/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/wordpress-hash-node/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/wordpress-hash-node/wordpress-hash-node-tests.ts b/types/wordpress-hash-node/wordpress-hash-node-tests.ts new file mode 100644 index 0000000000..464e83bd2a --- /dev/null +++ b/types/wordpress-hash-node/wordpress-hash-node-tests.ts @@ -0,0 +1,4 @@ +import { HashPassword, CheckPassword } from 'wordpress-hash-node'; + +const hash: string = HashPassword('foo'); +const valid: boolean = CheckPassword('foo', hash);