diff --git a/types/commander-remaining-args/commander-remaining-args-tests.ts b/types/commander-remaining-args/commander-remaining-args-tests.ts new file mode 100644 index 0000000000..4dcbcad13e --- /dev/null +++ b/types/commander-remaining-args/commander-remaining-args-tests.ts @@ -0,0 +1,6 @@ +import cli = require('commander'); +import getRemainingArgs = require('commander-remaining-args'); + +cli.allowUnknownOption().option('--some-flag'); + +getRemainingArgs(cli); // ['--unknown-flag', '--unknown-arg=value', '-x']) diff --git a/types/commander-remaining-args/index.d.ts b/types/commander-remaining-args/index.d.ts new file mode 100644 index 0000000000..19d53204eb --- /dev/null +++ b/types/commander-remaining-args/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for commander-remaining-args 1.2 +// Project: https://github.com/axelchalon/commander-remaining-args#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import { Command } from 'commander'; + +declare function getRemainingArgs(cli: Command): string[]; + +export = getRemainingArgs; diff --git a/types/commander-remaining-args/package.json b/types/commander-remaining-args/package.json new file mode 100644 index 0000000000..2b2a046468 --- /dev/null +++ b/types/commander-remaining-args/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "commander": "^2.20.0" + } +} diff --git a/types/commander-remaining-args/tsconfig.json b/types/commander-remaining-args/tsconfig.json new file mode 100644 index 0000000000..a19d8420f1 --- /dev/null +++ b/types/commander-remaining-args/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", + "commander-remaining-args-tests.ts" + ] +} diff --git a/types/commander-remaining-args/tslint.json b/types/commander-remaining-args/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/commander-remaining-args/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }