Improved typing of Creature Properties
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
|
||||
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema';
|
||||
import { Expand, InferType, TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
|
||||
import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
|
||||
|
||||
const BranchSchema = createPropertySchema({
|
||||
branchType: {
|
||||
@@ -52,12 +52,8 @@ const ComputedOnlyBranchSchema = createPropertySchema({
|
||||
},
|
||||
});
|
||||
|
||||
const ComputedBranchSchema = new TypedSimpleSchema({})
|
||||
const ComputedBranchSchema = TypedSimpleSchema.from({})
|
||||
.extend(BranchSchema)
|
||||
.extend(ComputedOnlyBranchSchema);
|
||||
|
||||
export type Branch = InferType<typeof BranchSchema>;
|
||||
export type ComputedOnlyBranch = InferType<typeof ComputedOnlyBranchSchema>;
|
||||
export type ComputedBranch = Expand<InferType<typeof BranchSchema> & InferType<typeof ComputedBranchSchema>>;
|
||||
|
||||
export { BranchSchema, ComputedBranchSchema, ComputedOnlyBranchSchema }
|
||||
|
||||
Reference in New Issue
Block a user