mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
34 lines
679 B
TypeScript
34 lines
679 B
TypeScript
import { asset } from './asset';
|
|
|
|
type ConsumableDefinitionFilter =
|
|
| {
|
|
type: 'tier';
|
|
min: number;
|
|
max: number;
|
|
}
|
|
| {
|
|
type: 'ids';
|
|
ids: number[];
|
|
}
|
|
| {
|
|
type: 'category';
|
|
categories: string[];
|
|
};
|
|
|
|
export interface ConsumableDefinitions {
|
|
[key: string]: {
|
|
id: number;
|
|
name: string;
|
|
effects?: Record<string, number>;
|
|
include: ConsumableDefinitionFilter[];
|
|
exclude?: ConsumableDefinitionFilter[];
|
|
};
|
|
}
|
|
|
|
export const consumableDefinitions = fetch(
|
|
asset('definitions/consumables.json'),
|
|
{
|
|
cache: 'no-cache',
|
|
},
|
|
).then(async (response) => response.json() as Promise<ConsumableDefinitions>);
|