chore(package): add missing typings

This commit is contained in:
Luke
2023-02-15 13:51:46 +01:00
parent 829bec2592
commit 66585521b4
4 changed files with 39 additions and 9 deletions

View File

@@ -1,7 +1,19 @@
import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
// Should really be improved at some point to only display properties depending on the input type
interface InputDialogRowProps {
type: 'input' | 'number' | 'checkbox' | 'select' | 'slider';
type:
| 'input'
| 'number'
| 'checkbox'
| 'select'
| 'multi-select'
| 'slider'
| 'color'
| 'date'
| 'date-range'
| 'time'
| 'text-area';
label: string;
options?: { value: string; label: string; default?: string }[];
password?: boolean;
@@ -13,13 +25,19 @@ interface InputDialogRowProps {
checked?: boolean;
min?: number;
max?: number;
autosize?: boolean;
step?: number;
required?: boolean;
format?: string;
description?: string;
}
type inputDialog = (
heading: string,
rows: string[] | InputDialogRowProps[]
rows: string[] | InputDialogRowProps[],
options: {
allowCancel?: boolean;
}
) => Promise<Array<string | number | boolean> | undefined>;
export const inputDialog: inputDialog = async (heading, rows) => await exports.ox_lib.inputDialog(heading, rows);