feat(package): interface definitions

This commit is contained in:
Luke
2022-09-14 13:50:32 +02:00
parent 863ac03ca3
commit 4f0cc4c7c5
17 changed files with 355 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
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;
checked?: boolean;
min?: number;
max?: number;
step?: number;
}
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);