Skip to content

Move OptionDescription to utils/options so types agree #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ under the licensing terms detailed in LICENSE:
* Joshua Tenner <[email protected]>
* Nidin Vinayakan <[email protected]>
* Aaron Turner <[email protected]>
* Willem Wyndham <[email protected]>

Portions of this software are derived from third-party works licensed under
the following terms:
Expand Down
13 changes: 3 additions & 10 deletions cli/asc.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { OptionDescription }from "./util/options";
export { OptionDescription };

/** Whether this is a webpack bundle or not. */
export const isBundle: boolean;

Expand All @@ -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 };

Expand Down
23 changes: 13 additions & 10 deletions cli/util/options.d.ts
Original file line number Diff line number Diff line change
@@ -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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice find! did that even work before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nut sure it was ever used. Since it was just the type definition file and no one tried to use the type with a typescript project.

/** 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. */
Expand Down