Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: added hook options
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 19, 2018
1 parent aea61cc commit 5dfdca6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {IConfig} from './config'
import {IPJSON} from './pjson'
import {IPluginModule} from './plugin'

export interface IHooks {
init: {}
export interface Hooks {
init: {id: string}
update: {}
'plugins:parse': {
module: IPluginModule
Expand All @@ -16,4 +16,8 @@ export interface IHooks {
}
}

export type Hook<T extends {}> = (options: T & {config: IConfig}) => Promise<void>
export interface IHookReturn {
exit?: number
}

export type IHook<T extends {}> = (options: T & {config: IConfig}) => Promise<IHookReturn | void>
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './command'
export * from './config'
export * from './topic'
export * from './plugin'
export * from './engine'
export * from './hooks'
export * from './plugin'
export * from './topic'
export {IPJSON} from './pjson'

0 comments on commit 5dfdca6

Please sign in to comment.