Skip to content

Instantly share code, notes, and snippets.

@Fleker
Created August 17, 2022 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fleker/cf05bbb1e79ecc71e52cf631cc4c4d87 to your computer and use it in GitHub Desktop.
Save Fleker/cf05bbb1e79ecc71e52cf631cc4c4d87 to your computer and use it in GitHub Desktop.
import {assert} from '@fleker/gents'
interface Item {
label: string
description: string
recovery: number
}
export const ITEM_MAP = {
potion: assert<Item>({
label: 'Potion',
description: 'Heals 50 HP',
recovery: 50,
}),
elixir: assert<Item>({
label: 'Elixir',
description: 'Heals 100 HP',
recovery: 100,
}),
wishdust: assert<Item>({
label: 'Wish Dust',
description: 'Heals all HP',
recovery: Infinity
}),
}
export type ItemId = keyof typeof ITEM_MAP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment