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 createPropertySchema from '/imports/api/properties/subSchemas/createPrope
import { storedIconsSchema } from '/imports/api/icons/Icons';
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX';
import { Expand, InferType, TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
/*
* Actions are things a character can do
@@ -258,12 +258,8 @@ const ComputedOnlyActionSchema = createPropertySchema({
},
});
const ComputedActionSchema = new TypedSimpleSchema({})
const ComputedActionSchema = TypedSimpleSchema.from({})
.extend(ActionSchema)
.extend(ComputedOnlyActionSchema);
export type Action = InferType<typeof ActionSchema>;
export type ComputedOnlyAction = InferType<typeof ComputedOnlyActionSchema>;
export type ComputedAction = Expand<InferType<typeof ActionSchema> & InferType<typeof ComputedOnlyActionSchema>>;
export { ActionSchema, ComputedOnlyActionSchema, ComputedActionSchema };