diff --git a/brz-core/server/thirdparties.service.ts b/brz-core/server/thirdparties.service.ts index 29d474a..8bdcfd4 100644 --- a/brz-core/server/thirdparties.service.ts +++ b/brz-core/server/thirdparties.service.ts @@ -1,15 +1,4 @@ -type InventoryItem = { - weight: number; - unique: boolean; - name: string; - type: string; - description: string; - label: string; - combinable: boolean; - useable: boolean; - shouldClose: boolean; - image: string; -}; +import { Adapter } from "../types/thirdparties.types"; declare const SETTINGS: any; @@ -18,16 +7,7 @@ const qbCoreGetPlayer = () => exports["qb-core"]?.GetCoreObject?.()?.Functions?.GetPlayer; const adapters: { - [key in string]: { - removeItem: (source: number, itemName: string) => boolean; - addItem: (source: number, itemName: string) => boolean; - getItem: (itemName: string) => InventoryItem | null; - notify: ( - source: number, - message: string, - type: "success" | "error" - ) => void; - }; + [key in string]: Adapter; } = { qbCore: { removeItem: (source: number, itemName: string) => { diff --git a/brz-core/types/thirdparties.types.ts b/brz-core/types/thirdparties.types.ts new file mode 100644 index 0000000..f7ccde1 --- /dev/null +++ b/brz-core/types/thirdparties.types.ts @@ -0,0 +1,19 @@ +export type Adapter = { + removeItem: (source: number, itemName: string) => boolean; + addItem: (source: number, itemName: string) => boolean; + getItem: (itemName: string) => InventoryItem | null; + notify: (source: number, message: string, type: "success" | "error") => void; +}; + +type InventoryItem = { + weight: number; + unique: boolean; + name: string; + type: string; + description: string; + label: string; + combinable: boolean; + useable: boolean; + shouldClose: boolean; + image: string; +};