From 377936895e4ba03115e6817fdf0b09d9af758cd4 Mon Sep 17 00:00:00 2001 From: Glenn Reyes Date: Fri, 6 Mar 2020 23:32:52 +0100 Subject: [PATCH] Add wordpress-hash-node (#42959) --- types/wordpress-hash-node/index.d.ts | 7 ++++++ types/wordpress-hash-node/tsconfig.json | 23 +++++++++++++++++++ types/wordpress-hash-node/tslint.json | 1 + .../wordpress-hash-node-tests.ts | 4 ++++ 4 files changed, 35 insertions(+) create mode 100644 types/wordpress-hash-node/index.d.ts create mode 100644 types/wordpress-hash-node/tsconfig.json create mode 100644 types/wordpress-hash-node/tslint.json create mode 100644 types/wordpress-hash-node/wordpress-hash-node-tests.ts 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);