import { Container } from 'pixi.js'; import { Signal } from 'typed-signals'; import { CheckBox } from './CheckBox'; import { List, ListType } from './List'; export type RadioBoxOptions = { items: CheckBox[]; type: ListType; elementsMargin: number; selectedItem?: number; }; /** * Creates a container-based controlling wrapper for checkbox elements, * for them top behave as radio buttons. * * Only one checkbox/radio button can be selected at a time. * * List of items is passed as an array of {@link CheckBox} objects. * @example * new RadioGroup({ * items: [ * new CheckBox({ * style: { * unchecked: `switch_off.png`, * checked: `switch_on.png`, * } * }), * new CheckBox({ * style: { * unchecked: `switch_off.png`, * checked: `switch_on.png`, * } * }), * new CheckBox({ * style: { * unchecked: `switch_off.png`, * checked: `switch_on.png`, * } * }), * ], * type: 'vertical' * }); */ export declare class RadioGroup extends Container { protected items: CheckBox[]; /** {@link List}, that holds and control all inned checkboxes. */ innerView: List | undefined; /** Text value of the selected item. */ value: string; /** ID of the selected item. */ selected: number; /** Fires, when new item is selected. */ onChange: Signal<(selectedItemID: number, selectedVal: string) => void>; protected options: RadioBoxOptions; constructor(options?: RadioBoxOptions); /** * Initiates a group. * @param options */ init(options: RadioBoxOptions): void; /** * Add items to a group. * @param {CheckBox[]} items - array of {@link CheckBox} instances. */ addItems(items: CheckBox[]): void; /** * Remove items from a group. * @param ids */ removeItems(ids: number[]): void; /** * Select item by ID. * @param id */ selectItem(id: number): void; } //# sourceMappingURL=RadioGroup.d.ts.map