1
1
// Definitions by: Taylor Schley <https://github.com/shadowgate15>
2
2
3
3
import { EventEmitter } from 'node:events' ;
4
- import { WorkerOptions , Worker } from 'node:worker_threads' ;
5
- import { Timeout , Interval } from 'safe-timers' ;
4
+ import type { WorkerOptions , Worker } from 'node:worker_threads' ;
5
+ import type { Timeout , Interval } from 'safe-timers' ;
6
6
7
7
export = Bree ;
8
8
@@ -68,7 +68,7 @@ declare class Bree extends EventEmitter {
68
68
}
69
69
70
70
declare namespace Bree {
71
- interface Job {
71
+ type Job = {
72
72
name : string ;
73
73
path : string | ( ( ) => void ) ;
74
74
timeout : number | string | boolean ;
@@ -81,11 +81,11 @@ declare namespace Bree {
81
81
worker ?: Partial < WorkerOptions > ;
82
82
outputWorkerMetadata ?: boolean ;
83
83
timezone ?: string ;
84
- }
84
+ } ;
85
85
86
86
type JobOptions = Required < Pick < Job , 'name' > > & Partial < Omit < Job , 'name' > > ;
87
87
88
- interface BreeConfigs {
88
+ type BreeConfigs = {
89
89
logger : BreeLogger | boolean ;
90
90
root : string | boolean ;
91
91
silenceRootCheckError : boolean ;
@@ -105,7 +105,7 @@ declare namespace Bree {
105
105
errorHandler ?: ( error : any , workerMetadata : any ) => void ;
106
106
workerMessageHandler ?: ( message : any , workerMetadata : any ) => void ;
107
107
outputWorkerMetadata : boolean ;
108
- }
108
+ } ;
109
109
110
110
type BreeOptions = Partial < Omit < BreeConfigs , 'jobs' > > & {
111
111
jobs ?: Array < string | ( ( ) => void ) | JobOptions > ;
@@ -115,9 +115,9 @@ declare namespace Bree {
115
115
116
116
function extend < T = unknown > ( plugin : PluginFunc < T > , options ?: T ) : Bree ;
117
117
118
- interface BreeLogger {
118
+ type BreeLogger = {
119
119
info : ( ...args : any [ ] ) => any ;
120
120
warn : ( ...args : any [ ] ) => any ;
121
121
error : ( ...args : any [ ] ) => any ;
122
- }
122
+ } ;
123
123
}
0 commit comments