mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-03-30 02:04:32 +00:00
46 lines
957 B
TypeScript
46 lines
957 B
TypeScript
// Type definitions for nopt 3.0.1
|
|
// Project: https://github.com/npm/nopt
|
|
// Definitions by: jbondc <https://github.com/jbondc>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
|
|
|
|
interface CommandData {
|
|
[key: string]: string
|
|
}
|
|
|
|
interface TypeDefs {
|
|
[key: string]: TypeInfo
|
|
}
|
|
|
|
interface TypeInfo {
|
|
type: Object
|
|
validate: (data: CommandData, k: string, val: string) => boolean
|
|
}
|
|
|
|
declare namespace nopt {
|
|
export function clean(data: CommandData, types: FlagTypeMap, typeDefs?: TypeDefs): string
|
|
export var typeDefs: TypeDefs
|
|
}
|
|
|
|
interface FlagTypeMap {
|
|
[k: string]: Object
|
|
}
|
|
|
|
interface ShortFlags {
|
|
[k: string]: string[] | string
|
|
}
|
|
|
|
declare function nopt(types: FlagTypeMap, shorthands?: ShortFlags, args?: string[], slice?: number): OptionsParsed
|
|
|
|
interface OptionsParsed {
|
|
[k: string]: any
|
|
argv: {
|
|
remain: string[]
|
|
cooked: string[]
|
|
original: string[]
|
|
}
|
|
}
|
|
|
|
export = nopt
|