mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
actually import the declaration
This commit is contained in:
Vendored
+26
-1
@@ -2,12 +2,37 @@
|
||||
// Project: https://github.com/lukeed/mri
|
||||
// Definitions by: Brendan Forster <https://github.com/shiftkey>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
export = mri;
|
||||
|
||||
declare function mri(args: any, opts: any): any;
|
||||
declare function mri(args: ReadonlyArray<string>, options?: mri.Options): mri.Argv;
|
||||
|
||||
declare namespace mri {
|
||||
const prototype: {
|
||||
};
|
||||
|
||||
/** A string or array of strings */
|
||||
type ArrayOrString = string | ReadonlyArray<string>;
|
||||
|
||||
/** An object with any keys whose values conform to a specific type */
|
||||
interface DictionaryObject<T = any> {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/** Additional aliases for specific flags */
|
||||
alias?: DictionaryObject<ArrayOrString>;
|
||||
/** A flag or array of flags whose values are boolean */
|
||||
boolean?: ArrayOrString;
|
||||
/** Default values for flags */
|
||||
default?: DictionaryObject;
|
||||
string?: ArrayOrString;
|
||||
unknown?: (flag: string) => void;
|
||||
}
|
||||
|
||||
interface Argv extends DictionaryObject {
|
||||
/** anything after `--` or between options */
|
||||
_: ReadonlyArray<string>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as mri from 'mri';
|
||||
|
||||
const first = mri(['--foo', 'bar']);
|
||||
|
||||
const second = mri(['--foo', 'bar'], {
|
||||
default: { foo: true, baz: 'hello', bat: 42 }
|
||||
});
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"strict-export-declare-modifiers": false,
|
||||
"prefer-method-signature": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user