Files
cocos4/scripts/module-division/tools/division-config.ts
T
Yun Hsiao Wu ff19a901c1 refine details (#5164)
* effect adapt

* restore tslint

* refine math constants
2019-08-15 21:52:32 -05:00

77 lines
1.3 KiB
TypeScript

// tslint:disable:interface-name
export interface ModuleDivision {
$schema?: string;
/**
* The group or items.
*/
groupOrItems: Array<Item | ItemGroup>;
}
interface Displayable {
/**
* Display text.
*/
text: string;
/**
* Description.
*/
description?: string;
}
interface BaseItem extends Displayable {
/**
* Whether if this item is required to provide.
*/
required?: boolean;
/**
* If true, this field indicates the item is marked as bundled by default.
*/
default?: boolean;
}
export interface Simple extends BaseItem {
/**
* Entry(s) to the module.
*/
entry: string | string[];
}
export interface SelectionOption extends Displayable {
/**
* Entry(s) of the option.
*/
entry: string | string[];
}
export interface SingleSelection extends BaseItem {
/**
* Options.
*/
options: SelectionOption[];
/**
* Indicates the n-th option is selected by default if the item is marked as bundled.
* Defaults to 0.
*/
defaultOption?: number;
}
export interface ItemGroup extends Displayable {
/**
* Items in this group.
*/
items: Item[];
/**
* Whether if at least one item shall be selected.
*/
required?: boolean;
}
export type Item = Simple | SingleSelection;