@manuth/woltlab-compiler
Version:
A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components
173 lines (172 loc) • 4.6 kB
TypeScript
import { Localization } from "../Globalization/Localization.js";
import { ICategory } from "./ICategory.js";
import { IOptionOptions } from "./IOptionOptions.js";
import { OptionItem } from "./OptionItem.js";
import { OptionType } from "./OptionType.js";
/**
* Represents an option.
*/
export declare abstract class Option {
/**
* The id of the option.
*/
private id;
/**
* The name of the option.
*/
private name;
/**
* The human-readable name of the option.
*/
private displayName;
/**
* The description of the option.
*/
private description;
/**
* The category of the option.
*/
private category;
/**
* The type of the option.
*/
private type;
/**
* The default value of the option.
*/
private defaultValue;
/**
* The show-order of the option.
*/
private showOrder;
/**
* The validation-pattern of the option.
*/
private validationPattern;
/**
* The items of the option.
*/
private items;
/**
* A list of options of which at least one needs to be enabled for the option to be shown.
*/
private options;
/**
* A list of options which should be visually enabled when this option is enabled.
*
* A leading exclamation mark (`!`, `U+0021`) will disable the specified option when this option is enabled.
* For `ComboBox` and `RadioButton` types the list should be prefixed by the name of the `selectoption`s followed by a colon (`:`, `U+003A`).
*
* This setting is a visual helper for the administrator only.
* It does not have an effect on the server side processing of the option.
*/
private enableOptions;
/**
* A set of additional properties of the option.
*/
private additionalProperties;
/**
* Initializes a new instance of the {@link Option `Option`} class.
*
* @param category
* The category of the option.
*
* @param options
* The options of the option.
*/
constructor(category: ICategory, options: IOptionOptions);
/**
* Gets or sets the id of the option.
*/
get ID(): string;
/**
* @inheritdoc
*/
set ID(value: string);
/**
* Gets or sets the name of the option.
*/
get Name(): string;
/**
* @inheritdoc
*/
set Name(value: string);
/**
* Gets the human-readable name of the option.
*/
get DisplayName(): Localization;
/**
* Gets the description of the option.
*/
get Description(): Localization;
/**
* Gets the category of the option.
*/
get Category(): ICategory;
/**
* Gets or sets the type of the option.
*/
get Type(): OptionType | string;
/**
* @inheritdoc
*/
set Type(value: OptionType | string);
/**
* Gets or sets the default value of the option.
*/
get DefaultValue(): unknown;
/**
* @inheritdoc
*/
set DefaultValue(value: unknown);
/**
* Gets or sets the show-order of the option.
*/
get ShowOrder(): number;
/**
* @inheritdoc
*/
set ShowOrder(value: number);
/**
* Gets or sets the validation-pattern of the option.
*/
get ValidationPattern(): RegExp;
/**
* @inheritdoc
*/
set ValidationPattern(value: RegExp);
/**
* Gets the items of the option.
*/
get Items(): OptionItem[];
/**
* Gets or sets a list of options of which at least one needs to be enabled for the option to be shown.
*/
get Options(): string[];
/**
* @inheritdoc
*/
set Options(value: string[]);
/**
* Gets or sets a list of options which should be visually enabled when this option is enabled.
*
* A leading exclamation mark (`!`, `U+0021`) will disable the specified option when this option is enabled.
* For `ComboBox` and `RadioButton` types the list should be prefixed by the name of the `selectoption`s followed by a colon (`:`, `U+003A`).
*
* This setting is a visual helper for the administrator only.
* It does not have an effect on the server side processing of the option.
*/
get EnableOptions(): string[];
/**
* @inheritdoc
*/
set EnableOptions(value: string[]);
/**
* Gets or sets a set of additional properties of the option.
*/
get AdditionalProperties(): Record<string, unknown>;
/**
* @inheritdoc
*/
set AdditionalProperties(value: Record<string, unknown>);
}