@kitten-science/kitten-scientists
Version:
Add-on for the wonderful incremental browser game: https://kittensgame.com/web/
37 lines • 1.54 kB
TypeScript
import type { Setting } from "../../settings/Settings.js";
import { LabelListItem, type LabelListItemOptions } from "./LabelListItem.js";
import type { UiComponent } from "./UiComponent.js";
export type SettingListItemOptions = ThisType<SettingListItem> & LabelListItemOptions & {
/**
* Will be invoked when the user checks the checkbox.
*/
readonly onCheck?: (isBatchProcess?: boolean) => void | Promise<void>;
/**
* Will be invoked when the user unchecks the checkbox.
*/
readonly onUnCheck?: (isBatchProcess?: boolean) => void | Promise<void>;
/**
* Should the user be prevented from changing the value of the input?
*/
readonly readOnly?: boolean;
};
export declare class SettingListItem<TSetting extends Setting = Setting> extends LabelListItem {
readonly options: SettingListItemOptions;
readonly setting: TSetting;
readonly checkbox?: JQuery;
readOnly: boolean;
/**
* Construct a new setting element.
* This is a simple checkbox with a label.
*
* @param host The userscript instance.
* @param label The label on the setting element.
* @param setting The setting this element is linked to.
* @param options Options for this list item.
*/
constructor(parent: UiComponent, setting: TSetting, label: string, options?: SettingListItemOptions);
toString(): string;
check(isBatchProcess?: boolean): Promise<void>;
uncheck(isBatchProcess?: boolean): Promise<void>;
}
//# sourceMappingURL=SettingListItem.d.ts.map