Fixed some typing errors

This commit is contained in:
Thaum Rystra
2024-05-31 17:13:58 +02:00
parent 68fb743302
commit 0891702bd9
6 changed files with 15 additions and 11 deletions

View File

@@ -13,6 +13,7 @@
"nearley",
"ngraph",
"ostrio",
"Ruleset",
"snackbars",
"Spellcasting",
"uncomputed",

View File

@@ -3,7 +3,7 @@ declare module 'meteor/mdg:validated-method' {
rateLimit: {
numRequests: number,
timeInterval: number,
}
};
}
type Return<TFunc> = TFunc extends (...args: any[]) => infer TReturn ? TReturn : never;
type Argument<TFunc> = TFunc extends (...args: infer TArgs) => any ? TArgs extends [infer TArg] ? TArg

View File

@@ -17,17 +17,17 @@ export type Creature = Colored & Shared & {
allowedLibraryCollections: string[],
// Stats that are computed and denormalized outside of recomputation
denormalizedStats: {
denormalizedStats?: {
xp: number,
milestoneLevels: number,
},
propCount: number,
propCount?: number,
// Does the character need a recompute?
dirty?: boolean,
// Version of computation engine that was last used to compute this creature
computeVersion?: string,
type: 'pc' | 'npc' | 'monster',
computeErrors: {
computeErrors?: {
type: string,
details?: any,
}[],

View File

@@ -15,7 +15,7 @@ import SimpleSchema from 'simpl-schema';
const insertCreature = new ValidatedMethod({
name: 'creatures.insertCreature',
mixins: [RateLimiterMixin, simpleSchemaMixin],
schema: CreatureSchema.pick(
validate: CreatureSchema.pick(
'name',
'gender',
'alignment',
@@ -26,7 +26,7 @@ const insertCreature = new ValidatedMethod({
type: SimpleSchema.Integer,
min: 0,
},
}),
}).validator(),
rateLimit: {
numRequests: 5,
timeInterval: 5000,
@@ -48,8 +48,13 @@ const insertCreature = new ValidatedMethod({
name,
gender,
alignment,
type: 'pc',
allowedLibraries,
allowedLibraryCollections,
settings: {},
readers: [],
writers: [],
public: false,
});
// Insert experience to get character to starting level
@@ -61,7 +66,6 @@ const insertCreature = new ValidatedMethod({
creatureId
},
creatureId,
userId,
});
}
@@ -96,7 +100,6 @@ function insertDefaultRuleset(creatureId, baseId, userId, slot) {
insertPropertyFromLibraryNode.call({
nodeIds: [ruleset._id],
parentRef: { id: baseId, collection: 'creatureProperties' },
order: 0.5,
});
}
}

View File

@@ -26,7 +26,7 @@ let ExperienceSchema = new SimpleSchema({
min: 0,
index: 1,
},
// The real-world date that it occured, usually sorted by date
// The real-world date that it occurred, usually sorted by date
date: {
type: Date,
autoValue: function () {
@@ -93,7 +93,7 @@ const insertExperience = new ValidatedMethod({
let insertedIds = [];
creatureIds.forEach(creatureId => {
assertEditPermission(creatureId, userId);
let id = insertExperienceForCreature({ experience, creatureId, userId });
let id = insertExperienceForCreature({ experience, creatureId });
insertedIds.push(id);
});
return insertedIds;

View File

@@ -77,7 +77,7 @@ export default {
},
doc() {
const doc = Docs.findOne(this.path);
return doc && doc.text;
return doc && doc.description;
},
},
watch: {