Currently, I am utilizing the dburles:collection-helpers
in my Meteor 2.12 project that is integrated with TypeScript. The package was included through
meteor add dburles:collection-helpers
, and the types were added using meteor yarn add @types/meteor-dburles-collection-helpers
.
Within my TypeScript file:
import { Mongo } from "meteor/mongo";
import SimpleSchema from 'simpl-schema';
...
interface IBackupJobs {
status: "queued" |
"in_progress" |
"restarting" |
"finished_ok" |
"finished_error"
...
}
const BackupJobsSchema = new SimpleSchema({
status: {
type: String,
allowedValues: [
"queued",
"in_progress",
"restarting",
"finished_ok",
"finished_error"
]
},
...
});
const BackupJobs = new Mongo.Collection<IBackupJobs>("backup_jobs");
BackupJobs.attachSchema(BackupJobsSchema);
BackupJobs.helpers({
isRunning() {
return (
this.status === "queued" ||
this.status === "in_progress" ||
this.status === "restarting"
);
}
});
However, I have encountered an error in my IDE pointing to BackupJobs.helpers
: Property 'helpers' does not exist on type Collection<Document, Document>
I attempted to place the types files from
meteor-dburles-collection-helpers
within my custom typings-custom
project folder, but the error persisted.
Does anyone have any suggestions?