mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Update index.d.ts
from the docs: ``` A hook function can be a normal or async function or arrow function that takes the hook context as the parameter and can return a context object return nothing (undefined) return feathers.SKIP to skip all further hooks throw an error for asynchronous operations return a Promise that resolves with a context object resolves with undefined rejects with an error ```
This commit is contained in:
+4
-1
@@ -14,6 +14,7 @@ declare const feathers: (() => Application<object>) & typeof self;
|
||||
export default feathers;
|
||||
|
||||
export const version: string;
|
||||
export const SKIP: SkipSymbol;
|
||||
|
||||
export type Id = number | string;
|
||||
export type NullableId = Id | null;
|
||||
@@ -45,7 +46,9 @@ export interface Paginated<T> {
|
||||
}
|
||||
|
||||
// tslint:disable-next-line void-return
|
||||
export type Hook = (hook: HookContext) => (Promise<HookContext> | void);
|
||||
export type Hook = (hook: HookContext) => (Promise<HookContext | SkipSymbol | void> | HookContext | SkipSymbol | void);
|
||||
|
||||
export type SkipSymbol = Symbol | '__feathersSkipHooks';
|
||||
|
||||
export interface HookContext<T = any> {
|
||||
app?: Application;
|
||||
|
||||
Reference in New Issue
Block a user