Improved typing of Creature Properties

This commit is contained in:
ThaumRystra
2025-01-14 13:21:43 +02:00
parent 1b05b8d3bf
commit c0d1412463
50 changed files with 158 additions and 449 deletions

View File

@@ -3,7 +3,7 @@ import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX';
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema';
import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema';
import type { Expand, InferType } from '/imports/api/utility/TypedSimpleSchema';
import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
/*
* PointBuys are reason-value attached to skills and abilities
@@ -128,12 +128,8 @@ const ComputedOnlyPointBuySchema = createPropertySchema({
},
});
const ComputedPointBuySchema = new SimpleSchema({})
const ComputedPointBuySchema = TypedSimpleSchema.from({})
.extend(ComputedOnlyPointBuySchema)
.extend(PointBuySchema);
export type PointBuy = InferType<typeof PointBuySchema>;
export type ComputedOnlyPointBuy = InferType<typeof ComputedOnlyPointBuySchema>;
export type ComputedPointBuy = Expand<InferType<typeof PointBuySchema> & InferType<typeof ComputedOnlyPointBuySchema>>;
export { PointBuySchema, ComputedPointBuySchema, ComputedOnlyPointBuySchema };