Skip to content

any way to typeset names of events for app.on() and app.service().on() ? #3293

Answered by daffl
noor-tg asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to add the interface with the events in your .class.ts file:

export declare interface MessageService {
  on(event: 'created', listener: (message: Message) => void): this
  on(event: string, listener: Function): this
}

// By default calls the standard Knex adapter service methods but can be customized with your own functionality.
export class MessageService<ServiceParams extends Params = MessageParams> extends KnexService<
  Message,
  MessageData,
  MessageParams,
  MessagePatch
> {}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@noor-tg
Comment options

Answer selected by noor-tg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants