From dd980c087a917ef4dc93cf4c3de6cab228fd8936 Mon Sep 17 00:00:00 2001 From: BehindTheMath Date: Thu, 19 Oct 2017 19:15:07 -0400 Subject: [PATCH] [github-username-regex] Add definitions (#20665) * [github-username-regex] Add definitions * [github-username-regex] Change to match CommonJS export format --- .../github-username-regex-tests.ts | 4 ++++ types/github-username-regex/index.d.ts | 7 ++++++ types/github-username-regex/tsconfig.json | 23 +++++++++++++++++++ types/github-username-regex/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 types/github-username-regex/github-username-regex-tests.ts create mode 100644 types/github-username-regex/index.d.ts create mode 100644 types/github-username-regex/tsconfig.json create mode 100644 types/github-username-regex/tslint.json diff --git a/types/github-username-regex/github-username-regex-tests.ts b/types/github-username-regex/github-username-regex-tests.ts new file mode 100644 index 0000000000..d829752776 --- /dev/null +++ b/types/github-username-regex/github-username-regex-tests.ts @@ -0,0 +1,4 @@ +import githubUsernameRegex = require("github-username-regex"); + +const githubUsernameRegexString: string = githubUsernameRegex.source; +const valid: boolean = githubUsernameRegex.test("abc-123"); diff --git a/types/github-username-regex/index.d.ts b/types/github-username-regex/index.d.ts new file mode 100644 index 0000000000..59b3d703f7 --- /dev/null +++ b/types/github-username-regex/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for github-username-regex 1.0 +// Project: https://github.com/shinnn/github-username-regex +// Definitions by: BehindTheMath +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const githubUsernameRegex: RegExp; +export = githubUsernameRegex; diff --git a/types/github-username-regex/tsconfig.json b/types/github-username-regex/tsconfig.json new file mode 100644 index 0000000000..4a30cf07ad --- /dev/null +++ b/types/github-username-regex/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", + "github-username-regex-tests.ts" + ] +} diff --git a/types/github-username-regex/tslint.json b/types/github-username-regex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/github-username-regex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }