From 3ed76a97f05335504166fce1653da75f4face28f Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 4 Jun 2019 00:37:01 -0400 Subject: [PATCH] CLI: Move OptionDescription to utils/options so types agree (#612) --- NOTICE | 1 + cli/asc.d.ts | 13 +++---------- cli/util/options.d.ts | 23 +++++++++++++---------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/NOTICE b/NOTICE index c37e7d81..c99b6077 100644 --- a/NOTICE +++ b/NOTICE @@ -13,6 +13,7 @@ under the licensing terms detailed in LICENSE: * Joshua Tenner * Nidin Vinayakan <01@01alchemist.com> * Aaron Turner +* Willem Wyndham Portions of this software are derived from third-party works licensed under the following terms: diff --git a/cli/asc.d.ts b/cli/asc.d.ts index 8c745f97..c1e04fa1 100644 --- a/cli/asc.d.ts +++ b/cli/asc.d.ts @@ -1,3 +1,6 @@ +import { OptionDescription } from "./util/options"; +export { OptionDescription }; + /** Whether this is a webpack bundle or not. */ export const isBundle: boolean; @@ -7,16 +10,6 @@ export const isDev: boolean; /** AssemblyScript version. */ export const version: string; -/** Command line option description. */ -export interface OptionDescription { - /** Textual description. */ - description: string | string[]; - /** Option type, e.g. `string`. */ - type: string; - /** Option aliases, if any. */ - aliases?: string[]; -} - /** Available CLI options. */ export const options: { [key: string]: OptionDescription }; diff --git a/cli/util/options.d.ts b/cli/util/options.d.ts index 688b20bc..1126f392 100644 --- a/cli/util/options.d.ts +++ b/cli/util/options.d.ts @@ -1,15 +1,18 @@ +/** Command line option description. */ +export interface OptionDescription { + /** Textual description. */ + description?: string | string[], + /** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */ + type?: "b" | "i" | "f" | "s" | "I" | "F" | "S", + /** Substituted options, if any. */ + value?: { [key: string]: number | string }, + /** Short alias, if any. */ + alias?: string +} + /** Configuration object. */ interface Config { - [key: string]: { - /** Textual description. */ - description?: string | string[], - /** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */ - type?: "b" | "i" | "f" | "s", "I", "F", "S", - /** Substituted options, if any. */ - value?: { [key: string]: number | string }, - /** Short alias, if any. */ - alias?: string - }; + [key: string]: OptionDescription; } /** Parsing result. */