From aa7919b988178d2e4a90579232d02d7115bb6203 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 2 Mar 2021 19:54:03 +0100 Subject: [PATCH] feat(resources/marketplace): added typings client side --- phone/src/common/typings/marketplace.ts | 9 +++++++++ resources/client/cl_sellout.ts | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 phone/src/common/typings/marketplace.ts diff --git a/phone/src/common/typings/marketplace.ts b/phone/src/common/typings/marketplace.ts new file mode 100644 index 0000000..6e6bdd3 --- /dev/null +++ b/phone/src/common/typings/marketplace.ts @@ -0,0 +1,9 @@ +export interface MarketplaceListing { + id: number; + identifier?: string; + name: string; + number: string; + title: string; + url: string; + description: string; +} \ No newline at end of file diff --git a/resources/client/cl_sellout.ts b/resources/client/cl_sellout.ts index 584b7dd..e4fe69b 100644 --- a/resources/client/cl_sellout.ts +++ b/resources/client/cl_sellout.ts @@ -1,6 +1,8 @@ import events from '../utils/events'; +import { MarketplaceListing } from '../../phone/src/common/typings/marketplace'; +import { IAlertProps } from '../../phone/src/common/typings/alerts'; -onNet(events.SELLOUT_SEND_LISTING, (listing: any) => { +onNet(events.SELLOUT_SEND_LISTING, (listing: MarketplaceListing) => { SendNuiMessage( JSON.stringify({ app: 'SELLOUT', @@ -11,7 +13,7 @@ onNet(events.SELLOUT_SEND_LISTING, (listing: any) => { }); RegisterNuiCallbackType(events.SELLOUT_ADD_LISTING); -on(`__cfx_nui:${events.SELLOUT_ADD_LISTING}`, (data: any) => { +on(`__cfx_nui:${events.SELLOUT_ADD_LISTING}`, (data: MarketplaceListing) => { emitNet(events.SELLOUT_ADD_LISTING, data); setTimeout(() => { @@ -21,7 +23,7 @@ on(`__cfx_nui:${events.SELLOUT_ADD_LISTING}`, (data: any) => { }); -onNet(events.SELLOUT_ACTION_RESULT, (alert: { message: string, type: string }) => { +onNet(events.SELLOUT_ACTION_RESULT, (alert: IAlertProps) => { SendNuiMessage( JSON.stringify({ app: "SELLOUT",