From 9132740573f901d0d2e4a385ebd39b73c70cc5f9 Mon Sep 17 00:00:00 2001 From: Chris Sprance Date: Sat, 13 Oct 2018 04:04:50 -0400 Subject: [PATCH] Add missing option to typings (#9) --- index.d.ts | 53 +++++++++++++++++++++++++++++++--------------------- package.json | 0 2 files changed, 32 insertions(+), 21 deletions(-) mode change 100644 => 100755 package.json diff --git a/index.d.ts b/index.d.ts index 71cce55..0cca969 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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"; + }; +} diff --git a/package.json b/package.json old mode 100644 new mode 100755