Skip to content

Commit 8aeda7f

Browse files
committed
feat(orap): add types to event fn
1 parent 9512e8b commit 8aeda7f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/orap/orap.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { Providers } from '@ora-io/reku'
22
import { RekuProviderManager } from '@ora-io/reku'
3-
import type { Logger } from '@ora-io/utils'
3+
import type { Fn, Logger } from '@ora-io/utils'
44
import { logger } from '@ora-io/utils'
5+
import type { EventSignalCallback, EventSignalRegisterParams } from './signal/event'
56
import { EventSignal } from './signal/event'
67

78
export interface ListenOptions {
@@ -22,7 +23,7 @@ export class Orap {
2223
}
2324
}
2425

25-
event(options: any, fn: any) {
26+
event(options: EventSignalRegisterParams, fn: EventSignalCallback) {
2627
const es = new EventSignal(options, fn, this.logger)
2728
this.routes.event.push(es)
2829
return es
@@ -36,7 +37,7 @@ export class Orap {
3637
this.routes.event.forEach(es => es.listen(wsProvider as Providers, httpProvider as Providers))
3738
}
3839

39-
listen(options: ListenOptions, onListen: any = () => { }) {
40+
listen(options: ListenOptions, onListen: Fn) {
4041
this._listenChain(options.wsProvider, options.httpProvider)
4142
onListen()
4243
return this

0 commit comments

Comments
 (0)