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:
Jan Lohage
2018-06-25 11:38:31 +02:00
committed by GitHub
parent 8cfe3b2c5a
commit 71f4e83c07
+4 -1
View File
@@ -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;