Skip to content

Commit

Permalink
Add missing option to typings (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
csprance authored and Alhadis committed Oct 13, 2018
1 parent e99e504 commit 9132740
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
53 changes: 32 additions & 21 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
export declare type Options = { options: any; argv: string[] };
export declare type Config = {
noAliasPropagation?: boolean;
noCamelCase?: boolean;
noBundling?: boolean;
ignoreEquals?: boolean;
duplicates?:
| "use-first"
| "use-last"
| "limit-first"
| "limit-last"
| "error"
| "append"
| "stack"
| "stack-values";
};
export declare function getOpts(
// Import the function like
// import getOpts = require('get-options');
// If you need the types you can import them like normal
// import { Options } from 'get-options';

/**
* Extract command-line options from a list of strings.
*/
declare function getOpts(
input: any[],
optdef: string | { [key: string]: string },
config: Config
): Options;
optdef?: string | { [key: string]: string },
config?: getOpts.Config
): getOpts.Options;

export = getOpts;

export default getOpts;
declare namespace getOpts {
export type Options = { options: any; argv: string[] };
export type Config = {
noAliasPropagation?: boolean | "first-only";
noCamelCase?: boolean;
noBundling?: boolean;
ignoreEquals?: boolean;
duplicates?:
| "use-first"
| "use-last"
| "limit-first"
| "limit-last"
| "error"
| "append"
| "stack"
| "stack-values";
};
}
Empty file modified package.json
100644 → 100755
Empty file.

0 comments on commit 9132740

Please sign in to comment.