Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/windmill/node_modules/before-after-hook/index.d.ts>HookCollection

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
interface HookCollection
import { type HookCollection } from "https://deno.land/x/windmill@v1.367.2/node_modules/before-after-hook/index.d.ts";

Type Parameters

optional
HooksType extends Record<string, TypeStore> = Record<string, { Options: any; Result: any; Error: any; }>
optional
HookName extends keyof HooksType = keyof HooksType

Call Signatures

<Name extends HookName>(
name: Name | Name[],
hookMethod: HookMethod<GetType<HooksType[Name], "Options", "O">, GetType<HooksType[Name], "Result", "R">>,
options?: GetType<HooksType[Name], "Options", "O">,
): Promise<GetType<HooksType[Name], "Result", "R">>

Invoke before and after hooks

Properties

api: Pick<HookCollection<HooksType>,
| "before"
| "error"
| "after"
| "wrap"
| "remove"
>

Public API

Methods

before<Name extends HookName>(name: Name, beforeHook: BeforeHook<GetType<HooksType[Name], "Options", "O">>): void

Add before hook for given name

error<Name extends HookName>(name: Name, errorHook: ErrorHook<GetType<HooksType[Name], "Options", "O">, GetType<HooksType[Name], "Error", "E">>): void

Add error hook for given name

after<Name extends HookName>(name: Name, afterHook: AfterHook<GetType<HooksType[Name], "Options", "O">, GetType<HooksType[Name], "Result", "R">>): void

Add after hook for given name

wrap<Name extends HookName>(name: Name, wrapHook: WrapHook<GetType<HooksType[Name], "Options", "O">, GetType<HooksType[Name], "Result", "R">>): void

Add wrap hook for given name

remove<Name extends HookName>(name: Name, hook: AnyHook<GetType<HooksType[Name], "Options", "O">, GetType<HooksType[Name], "Result", "R">, GetType<HooksType[Name], "Error", "E">>): void

Remove added hook for given name