Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add typescript types #37

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export default class Kareem {
vkarpov15 marked this conversation as resolved.
Show resolved Hide resolved
static skipWrappedFunction(): SkipWrappedFunction;
static overwriteMiddlewareResult(): OverwriteMiddlewareResult;

pre(name: string | RegExp, fn: Function): this;
pre(name: string | RegExp, options: Record<string, any>, fn: Function, error?: any, unshift?: boolean): this;
post(name: string | RegExp, fn: Function): this;
post(name: string | RegExp, options: Record<string, any>, fn: Function, unshift?: boolean): this;

clone(): this;
vkarpov15 marked this conversation as resolved.
Show resolved Hide resolved
merge(other: Kareem, clone?: boolean): Kareem;
vkarpov15 marked this conversation as resolved.
Show resolved Hide resolved

createWrapper(name: string, fn: Function, context?: any, options?: any): Function;
createWrapperSync(name: string, fn: Function): Function;
hasHooks(name: string): boolean;
filter(fn: Function): Kareem;
vkarpov15 marked this conversation as resolved.
Show resolved Hide resolved

wrap(name: string, fn: Function, context: any, args: any[], options?: any): Function;
vkarpov15 marked this conversation as resolved.
Show resolved Hide resolved

execPostSync(name: string, context: any, args: any[]): any;
execPost(name: string, context: any, args: any[], options?: any, callback?: Function): void;
execPreSync(name: string, context: any, args: any[]): any;
execPre(name: string, context: any, args: any[], callback?: Function): void;
}

class SkipWrappedFunction {}
class OverwriteMiddlewareResult {}

Loading