mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Add hook normalization & finally hook (#34897)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
03b4f06ce7
commit
ab61661da8
@@ -21,5 +21,15 @@ app.service('users').hooks({
|
||||
context.statusCode = 200;
|
||||
context.dispatch = { test: 'true' };
|
||||
}
|
||||
},
|
||||
after: [
|
||||
(context: HookContext) => {
|
||||
context.statusCode = 200;
|
||||
context.dispatch = { test: 'true' };
|
||||
}
|
||||
],
|
||||
finally: (context: HookContext) => {
|
||||
context.statusCode = 200;
|
||||
context.dispatch = { test: 'true' };
|
||||
}
|
||||
});
|
||||
|
||||
+4
-3
@@ -137,9 +137,10 @@ declare namespace feathers {
|
||||
}
|
||||
|
||||
interface HooksObject {
|
||||
before: Partial<HookMap>;
|
||||
after: Partial<HookMap>;
|
||||
error: Partial<HookMap>;
|
||||
before: Partial<HookMap> | Hook | Hook[];
|
||||
after: Partial<HookMap> | Hook | Hook[];
|
||||
error: Partial<HookMap> | Hook | Hook[];
|
||||
finally: Partial<HookMap> | Hook | Hook[];
|
||||
}
|
||||
|
||||
// todo: figure out what to do: These methods don't actually need to be implemented, so they can be undefined at runtime. Yet making them optional gets cumbersome in strict mode.
|
||||
|
||||
Reference in New Issue
Block a user