From 71f4e83c07d6b42319ba5555906b29aed6248cb1 Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Mon, 25 Jun 2018 11:38:31 +0200 Subject: [PATCH] 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 ``` --- types/feathersjs__feathers/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index b3a0f60667..0aaa146f1d 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -14,6 +14,7 @@ declare const feathers: (() => Application) & 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 { } // tslint:disable-next-line void-return -export type Hook = (hook: HookContext) => (Promise | void); +export type Hook = (hook: HookContext) => (Promise | HookContext | SkipSymbol | void); + +export type SkipSymbol = Symbol | '__feathersSkipHooks'; export interface HookContext { app?: Application;