mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
fix(package): fix incorrect typings for context menu
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
|
import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
|
||||||
|
|
||||||
interface ContextMenuItem {
|
interface ContextMenuItem {
|
||||||
|
title?: string;
|
||||||
menu?: string;
|
menu?: string;
|
||||||
icon?: IconName | [IconPrefix, IconName];
|
icon?: IconName | [IconPrefix, IconName];
|
||||||
iconColor?: string;
|
iconColor?: string;
|
||||||
onSelect?: () => void;
|
onSelect?: (args: any) => void;
|
||||||
arrow?: boolean;
|
arrow?: boolean;
|
||||||
description?: boolean;
|
description?: string;
|
||||||
metadata?: string | { [key: string]: any } | string[];
|
metadata?: string | { [key: string]: any } | string[];
|
||||||
event?: string;
|
event?: string;
|
||||||
serverEvent?: string;
|
serverEvent?: string;
|
||||||
@@ -26,7 +27,7 @@ interface ContextMenuProps {
|
|||||||
options: { [key: string]: ContextMenuItem } | ContextMenuArrayItem[];
|
options: { [key: string]: ContextMenuItem } | ContextMenuArrayItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
type registerContext = (context: ContextMenuProps) => void;
|
type registerContext = (context: ContextMenuProps | ContextMenuProps[]) => void;
|
||||||
export const registerContext: registerContext = (context) => exports.ox_lib.registerContext(context);
|
export const registerContext: registerContext = (context) => exports.ox_lib.registerContext(context);
|
||||||
|
|
||||||
export const showContext = (id: string): void => exports.ox_lib.showContext(id);
|
export const showContext = (id: string): void => exports.ox_lib.showContext(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user