Skip to content

[Issue] Argument of run method type, is wrong #56

@gtrabanco

Description

@gtrabanco

run: (store: Cron) => any | Promise<any>

As you can see that line, the type is not the same as in:

elysia-cron/src/index.ts

Lines 46 to 55 in 68e716c

return {
...store,
cron: {
...prevCron,
[name]: new Cron(pattern, options, () =>
// @ts-expect-error private property
run(app.singleton.store as any)
)
} as Record<Name, Cron>
}

I think it should be something like:

run: (store: Singleton['store'] & Record<"cron", Record<string, Cron>>) => any | Promise<any>

But not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions