mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
chore(package): add missing typings
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user