diff --git a/package/client/resource/interface/context.ts b/package/client/resource/interface/context.ts index 0a00054..64bb48e 100644 --- a/package/client/resource/interface/context.ts +++ b/package/client/resource/interface/context.ts @@ -1,14 +1,17 @@ import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types'; interface ContextMenuItem { - title?: string; menu?: string; + title?: string; + description?: string; + arrow?: boolean; + image?: string; icon?: IconName | [IconPrefix, IconName]; iconColor?: string; + progress?: number; + colorScheme?: string; onSelect?: (args: any) => void; - arrow?: boolean; - description?: string; - metadata?: string | { [key: string]: any } | string[]; + metadata?: string[] | { [key: string]: any } | { label: string; value: any; progress?: number }[]; disabled?: boolean; event?: string; serverEvent?: string; diff --git a/package/client/resource/interface/input.ts b/package/client/resource/interface/input.ts index ebfe1aa..a03ddbb 100644 --- a/package/client/resource/interface/input.ts +++ b/package/client/resource/interface/input.ts @@ -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 | undefined>; export const inputDialog: inputDialog = async (heading, rows) => await exports.ox_lib.inputDialog(heading, rows); diff --git a/package/client/resource/interface/notify.ts b/package/client/resource/interface/notify.ts index 66714be..bc01638 100644 --- a/package/client/resource/interface/notify.ts +++ b/package/client/resource/interface/notify.ts @@ -1,11 +1,19 @@ import { CSSProperties } from 'react'; import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types'; -type NotificationPosition = 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'; +type NotificationPosition = + | 'top' + | 'top-right' + | 'top-left' + | 'bottom' + | 'bottom-right' + | 'bottom-left' + | 'center-right' + | 'center-left'; type NotificationType = 'inform' | 'error' | 'success'; interface NotifyProps { - id?: string; + id?: string | number; title?: string; description?: string; duration?: number; @@ -18,6 +26,7 @@ interface NotifyProps { export const notify = (data: NotifyProps): void => exports.ox_lib.notify(data); +// Keep for backwards compat with v2 interface DefaultNotifyProps { title?: string; description?: string; diff --git a/package/client/resource/interface/skillcheck.ts b/package/client/resource/interface/skillcheck.ts index 8056354..cbb5e5b 100644 --- a/package/client/resource/interface/skillcheck.ts +++ b/package/client/resource/interface/skillcheck.ts @@ -1,4 +1,4 @@ type SkillCheckDifficulty = 'easy' | 'medium' | 'hard' | { areaSize: number; speedMultiplier: number }; -export const skillCheck = (difficulty: SkillCheckDifficulty | SkillCheckDifficulty[]) => +export const skillCheck = (difficulty: SkillCheckDifficulty | SkillCheckDifficulty[], inputs?: string[]) => exports.ox_lib.skillCheck(difficulty);