Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // Type definitions for yargs-parser 20.2
  2. // Project: https://github.com/yargs/yargs-parser#readme
  3. // Definitions by: Miles Johnson <https://github.com/milesj>
  4. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  5. // TypeScript Version: 2.2
  6. declare namespace yargsParser {
  7. interface Arguments {
  8. /** Non-option arguments */
  9. _: string[];
  10. /** The script name or node command */
  11. $0: string;
  12. /** All remaining options */
  13. [argName: string]: any;
  14. }
  15. interface DetailedArguments {
  16. /** An object representing the parsed value of `args` */
  17. argv: Arguments;
  18. /** Populated with an error object if an exception occurred during parsing. */
  19. error: Error | null;
  20. /** The inferred list of aliases built by combining lists in opts.alias. */
  21. aliases: { [alias: string]: string[] };
  22. /** Any new aliases added via camel-case expansion. */
  23. newAliases: { [alias: string]: boolean };
  24. /** The configuration loaded from the yargs stanza in package.json. */
  25. configuration: Configuration;
  26. }
  27. interface Configuration {
  28. /** Should variables prefixed with --no be treated as negations? Default is `true` */
  29. 'boolean-negation': boolean;
  30. /** Should hyphenated arguments be expanded into camel-case aliases? Default is `true` */
  31. 'camel-case-expansion': boolean;
  32. /** Should arrays be combined when provided by both command line arguments and a configuration file. Default is `false` */
  33. 'combine-arrays': boolean;
  34. /** Should keys that contain . be treated as objects? Default is `true` */
  35. 'dot-notation': boolean;
  36. /** Should arguments be coerced into an array when duplicated. Default is `true` */
  37. 'duplicate-arguments-array': boolean;
  38. /** Should array arguments be coerced into a single array when duplicated. Default is `true` */
  39. 'flatten-duplicate-arrays': boolean;
  40. /** Should arrays consume more than one positional argument following their flag. Default is `true` */
  41. 'greedy-arrays': boolean;
  42. /** Should nargs consume dash options as well as positional arguments. Default is `false` */
  43. 'nargs-eats-options': boolean;
  44. /** Should parsing stop at the first text argument? This is similar to how e.g. ssh parses its command line. Default is `false` */
  45. 'halt-at-non-option': boolean;
  46. /** The prefix to use for negated boolean variables. Default is `'no-'` */
  47. 'negation-prefix': string;
  48. /** Should keys that look like numbers be treated as such? Default is `true` */
  49. 'parse-numbers': boolean;
  50. /** Should positional keys that look like numbers be treated as such? Default is `true` */
  51. 'parse-positional-numbers': boolean;
  52. /** Should unparsed flags be stored in -- or _. Default is `false` */
  53. 'populate--': boolean;
  54. /** Should a placeholder be added for keys not set via the corresponding CLI argument? Default is `false` */
  55. 'set-placeholder-key': boolean;
  56. /** Should a group of short-options be treated as boolean flags? Default is `true` */
  57. 'short-option-groups': boolean;
  58. /** Should aliases be removed before returning results? Default is `false` */
  59. 'strip-aliased': boolean;
  60. /** Should dashed keys be removed before returning results? This option has no effect if camel-case-expansion is disabled. Default is `false` */
  61. 'strip-dashed': boolean;
  62. /** Should unknown options be treated like regular arguments? An unknown option is one that is not configured in opts. Default is `false` */
  63. 'unknown-options-as-args': boolean;
  64. }
  65. interface Options {
  66. /** An object representing the set of aliases for a key: `{ alias: { foo: ['f']} }`. */
  67. alias?: { [key: string]: string | string[] } | undefined;
  68. /**
  69. * Indicate that keys should be parsed as an array: `{ array: ['foo', 'bar'] }`.
  70. * Indicate that keys should be parsed as an array and coerced to booleans / numbers:
  71. * { array: [ { key: 'foo', boolean: true }, {key: 'bar', number: true} ] }`.
  72. */
  73. array?: string[] | Array<{ key: string; boolean?: boolean | undefined, number?: boolean | undefined }> | undefined;
  74. /** Arguments should be parsed as booleans: `{ boolean: ['x', 'y'] }`. */
  75. boolean?: string[] | undefined;
  76. /** Indicate a key that represents a path to a configuration file (this file will be loaded and parsed). */
  77. config?: string | string[] | { [key: string]: boolean } | undefined;
  78. /** Provide configuration options to the yargs-parser. */
  79. configuration?: Partial<Configuration> | undefined;
  80. /**
  81. * Provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error), e.g.
  82. * `{ coerce: { foo: function (arg) { return modifiedArg } } }`.
  83. */
  84. coerce?: { [key: string]: (arg: any) => any } | undefined;
  85. /** Indicate a key that should be used as a counter, e.g., `-vvv = {v: 3}`. */
  86. count?: string[] | undefined;
  87. /** Provide default values for keys: `{ default: { x: 33, y: 'hello world!' } }`. */
  88. default?: { [key: string]: any } | undefined;
  89. /** Environment variables (`process.env`) with the prefix provided should be parsed. */
  90. envPrefix?: string | undefined;
  91. /** Specify that a key requires n arguments: `{ narg: {x: 2} }`. */
  92. narg?: { [key: string]: number } | undefined;
  93. /** `path.normalize()` will be applied to values set to this key. */
  94. normalize?: string[] | undefined;
  95. /** Keys should be treated as strings (even if they resemble a number `-x 33`). */
  96. string?: string[] | undefined;
  97. /** Keys should be treated as numbers. */
  98. number?: string[] | undefined;
  99. }
  100. interface Parser {
  101. (argv: string | string[], opts?: Options): Arguments;
  102. detailed(argv: string | string[], opts?: Options): DetailedArguments;
  103. }
  104. }
  105. declare var yargsParser: yargsParser.Parser;
  106. export = yargsParser;