Skip to content

Commit 1276218

Browse files
committed
refactor(engine): add return type to run()
1 parent 235cf0a commit 1276218

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/engine.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {Almanac} from './almanac'
55
import { EventEmitter } from 'events'
66
import { SuccessEventFact } from './engine-facts'
77
import {defaultOperators} from './engine-default-operators'
8+
import {Action} from './action.interface'
89

910
let debug = require('debug')('json-rules-engine')
1011

@@ -244,7 +245,7 @@ export class Engine extends EventEmitter {
244245
* @param {Object} runOptions - run options
245246
* @return {Promise} resolves when the engine has completed running
246247
*/
247-
run (runtimeFacts = {}) {
248+
run (runtimeFacts = {}): Promise<Action[]> {
248249
debug(`engine::run started`)
249250
debug(`engine::run runtimeFacts:`, runtimeFacts)
250251
runtimeFacts['success-events'] = new Fact('success-events', SuccessEventFact(), { cache: false })

0 commit comments

Comments
 (0)