Types

All types

Below listed types are used through out the whole shops resource.

---@meta

---@class ShopSettings
---@field useStock? boolean
---@field useCategories? boolean
---@field fluctuatePrices? boolean

---@class ShopPaymentMethods
---@field buy? string[]
---@field sell? string[]

---@class ShopItem
---@field name string
---@field category? string
---@field price number
---@field stock? number
---@field metadata? table<string, any>

---@class ShopItemsWithSelling
---@field buy ShopItem[]
---@field sell ShopItem[]

---@class ShopLocationOptions
---@field coords vector3
---@field label? string
---@field icon? string
---@field iconColor? string
---@field distance? number
---@field skipBlip? boolean

---@class ShopPedLocation: ShopLocationOptions
---@field ped string | number
---@field heading number

---@class ShopZoneLocation: ShopLocationOptions
---@field size vector3
---@field rotation number
---@field drawSprite boolean

---@class ShopPointLocation: ShopLocationOptions
---@field type? number
---@field scale? [number, number, number]
---@field color? [number, number, number]
---@field opacity? number
---@field options table<string, any>

---@class ShopBlip
---@field sprite number
---@field label? string
---@field color number
---@field scale number
---@field isShortRange? boolean

---@class ItemRequirement
---@field name string
---@field count number
---@field metadata? table<string, any>

---@class ShopConfig
---@field icon? string
---@field label string
---@field description? string
---@field group? string | table<string> | table<string, number>
---@field requiredItem? ItemRequirement | ItemRequirement[]
---@field settings? ShopSettings
---@field paymentMethods? ShopPaymentMethods
---@field items ShopItemsWithSelling | ShopItem[]
---@field model? number | number[] | string | string[]
---@field locations? table<ShopPedLocation | ShopZoneLocation | ShopPointLocation>
---@field blip? ShopBlip
---@field blipReference? number

---@class ShopPayload: ShopConfig
---@field id string

---@class ShopPayloadClient: ShopPayload
---@field loaded? boolean

---@class Category
---@field label string
---@field icon? string

---@class ThemeVariables
---@field b1 string
---@field b2 string
---@field b3 string
---@field bc string
---@field primary string
---@field pc string
---@field ['rounded-box'] string
---@field ['rounded-btn'] string
---@field ['rounded-badge'] string
---@field ['main-opacity'] string
---@field ['items-container-opacity'] string
---@field ['cart-item-opacity'] string

---@class PaymentMethodDefinition
---@field icon string
---@field balance fun(source): number
---@field remove fun(source, amount, reason): boolean
---@field add fun(source, amount, reason): boolean

---@class Log
---@field source? number
---@field action string
---@field message string
---@field data? table<string, any>
---@field identifiers? string[]
---@field tags? { discord?: string[]; ox: string[]; }