Kamus Generik TypeScript

// You should check the source of why you have to force string and number
// Example 1 with Generic with default value

type DefaultSlotType = "something" | "something2"

type PlayerInventory<T extends  string | number = DefaultSlotType> = Record<T, InventorySlotSchema>

// Example 2 without default

type PlayerInventory<T extends  string | number> = Record<T, InventorySlotSchema>

// Example 2 without default and just a string
type PlayerInventory<T extends string> = Record<T, InventorySlotSchema>
MassimoMx