Skip to content

Commit

Permalink
feat: moving types to own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
pedropapa committed Sep 28, 2024
1 parent 6bc7666 commit 4edcec5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
24 changes: 2 additions & 22 deletions brz-core/server/thirdparties.service.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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) => {
Expand Down
19 changes: 19 additions & 0 deletions brz-core/types/thirdparties.types.ts
Original file line number Diff line number Diff line change
@@ -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;
};

0 comments on commit 4edcec5

Please sign in to comment.