2022-09-14 13:50:32 +02:00
|
|
|
import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
|
|
|
|
|
|
|
|
|
|
interface InputDialogRowProps {
|
|
|
|
|
type: 'input' | 'number' | 'checkbox' | 'select' | 'slider';
|
|
|
|
|
label: string;
|
|
|
|
|
options?: { value: string; label: string; default?: string }[];
|
|
|
|
|
password?: boolean;
|
|
|
|
|
icon?: IconName | [IconPrefix, IconName];
|
|
|
|
|
iconColor?: string;
|
|
|
|
|
placeholder?: string;
|
|
|
|
|
default?: string | number;
|
2022-10-27 03:17:53 -04:00
|
|
|
disabled?: boolean;
|
2022-09-14 13:50:32 +02:00
|
|
|
checked?: boolean;
|
|
|
|
|
min?: number;
|
|
|
|
|
max?: number;
|
|
|
|
|
step?: number;
|
2022-10-27 13:45:27 +02:00
|
|
|
description?: string;
|
2022-09-14 13:50:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type inputDialog = (
|
|
|
|
|
heading: string,
|
|
|
|
|
rows: string[] | InputDialogRowProps[]
|
|
|
|
|
) => Promise<Array<string | number | boolean> | undefined>;
|
|
|
|
|
export const inputDialog: inputDialog = async (heading, rows) => await exports.ox_lib.inputDialog(heading, rows);
|
2022-09-29 11:39:30 +02:00
|
|
|
|
|
|
|
|
export const closeInputDialog = () => exports.ox_lib.inputDialog();
|