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

Commit

Permalink
fix: refactor to save an export
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 26, 2018
1 parent c3d5a74 commit 00a8333
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ const context: Context = {

export interface Plugins {[k: string]: [object, any, any, any, any]}

export interface It<I> {
(expectation: string, cb?: (context: I) => any): void
(cb?: (context: I) => any): void
}

export type Fancy<I extends Context, T extends Plugins> = {
it: It<I>
end: It<I>
it: {
(expectation: string, cb?: (context: I) => any): void
(cb?: (context: I) => any): void
}
end: {
(expectation: string, cb?: (context: I) => any): void
(cb?: (context: I) => any): void
}
add<K extends string, O>(key: K, cb: (context: I) => Promise<O> | O): Fancy<I & {[P in K]: O}, T>
do(cb: (context: I) => any): Fancy<I, T>
register<K extends string, O, A1, A2, A3, A4>(key: K, plugin: (arg1?: A1, arg2?: A2, arg3?: A3, arg4?: A4) => Plugin<O & I>): Fancy<I, T & {[P in K]: [O, A1, A2, A3, A4]}>
Expand Down

0 comments on commit 00a8333

Please sign in to comment.