Improved typing of Creature Properties
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
|
||||
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema';
|
||||
import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema';
|
||||
import type { Expand, InferType } from '/imports/api/utility/TypedSimpleSchema';
|
||||
import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
|
||||
|
||||
/*
|
||||
* Effects are reason-value attached to skills and abilities
|
||||
@@ -61,12 +60,8 @@ const ComputedOnlyEffectSchema = createPropertySchema({
|
||||
},
|
||||
});
|
||||
|
||||
const ComputedEffectSchema = new SimpleSchema({})
|
||||
const ComputedEffectSchema = TypedSimpleSchema.from({})
|
||||
.extend(ComputedOnlyEffectSchema)
|
||||
.extend(EffectSchema);
|
||||
|
||||
export type Effect = InferType<typeof EffectSchema>;
|
||||
export type ComputedOnlyEffect = InferType<typeof ComputedOnlyEffectSchema>;
|
||||
export type ComputedEffect = Expand<InferType<typeof EffectSchema> & InferType<typeof ComputedOnlyEffectSchema>>;
|
||||
|
||||
export { EffectSchema, ComputedEffectSchema, ComputedOnlyEffectSchema };
|
||||
|
||||
Reference in New Issue
Block a user