Skip to content

Commit 4e5624d

Browse files
authored
Merge pull request #37 from mongoosejs/vkarpov15/typescript
add typescript types
2 parents 6883699 + 20bb652 commit 4e5624d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

index.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
declare module "kareem" {
2+
export default class Kareem {
3+
static skipWrappedFunction(): SkipWrappedFunction;
4+
static overwriteMiddlewareResult(): OverwriteMiddlewareResult;
5+
6+
pre(name: string | RegExp, fn: Function): this;
7+
pre(name: string | RegExp, options: Record<string, any>, fn: Function, error?: any, unshift?: boolean): this;
8+
post(name: string | RegExp, fn: Function): this;
9+
post(name: string | RegExp, options: Record<string, any>, fn: Function, unshift?: boolean): this;
10+
11+
clone(): Kareem;
12+
merge(other: Kareem, clone?: boolean): this;
13+
14+
createWrapper(name: string, fn: Function, context?: any, options?: Record<string, any>): Function;
15+
createWrapperSync(name: string, fn: Function): Function;
16+
hasHooks(name: string): boolean;
17+
filter(fn: Function): Kareem;
18+
19+
wrap(name: string, fn: Function, context: any, args: any[], options?: Record<string, any>): Function;
20+
21+
execPostSync(name: string, context: any, args: any[]): any;
22+
execPost(name: string, context: any, args: any[], options?: Record<string, any>, callback?: Function): void;
23+
execPreSync(name: string, context: any, args: any[]): any;
24+
execPre(name: string, context: any, args: any[], callback?: Function): void;
25+
}
26+
27+
class SkipWrappedFunction {}
28+
class OverwriteMiddlewareResult {}
29+
}

0 commit comments

Comments
 (0)