Improved typing of Creature Properties
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
|
||||
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema';
|
||||
import type { Expand, InferType } from '/imports/api/utility/TypedSimpleSchema';
|
||||
import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
|
||||
|
||||
const NoteSchema = createPropertySchema({
|
||||
name: {
|
||||
@@ -35,12 +34,8 @@ const ComputedOnlyNoteSchema = createPropertySchema({
|
||||
},
|
||||
});
|
||||
|
||||
const ComputedNoteSchema = new SimpleSchema({})
|
||||
const ComputedNoteSchema = TypedSimpleSchema.from({})
|
||||
.extend(NoteSchema)
|
||||
.extend(ComputedOnlyNoteSchema);
|
||||
|
||||
export type Note = InferType<typeof NoteSchema>;
|
||||
export type ComputedOnlyNote = InferType<typeof ComputedOnlyNoteSchema>;
|
||||
export type ComputedNote = Expand<InferType<typeof NoteSchema> & InferType<typeof ComputedOnlyNoteSchema>>;
|
||||
|
||||
export { NoteSchema, ComputedNoteSchema, ComputedOnlyNoteSchema, };
|
||||
|
||||
Reference in New Issue
Block a user