mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #32275 from dieseldjango/master
@types/hapi: ServerMethod does not have to return a Promise
This commit is contained in:
Vendored
+1
-1
@@ -2704,7 +2704,7 @@ export interface ServerInjectResponse extends Shot.ResponseObject {
|
||||
* * * ttl - 0 if result is valid but cannot be cached. Defaults to cache policy.
|
||||
* For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodname-method-options)
|
||||
*/
|
||||
export type ServerMethod = (...args: any[]) => Promise<any>;
|
||||
export type ServerMethod = (...args: any[]) => any;
|
||||
|
||||
/**
|
||||
* The same cache configuration used in server.cache().
|
||||
|
||||
@@ -6,7 +6,7 @@ const server = new Server({
|
||||
});
|
||||
server.start();
|
||||
|
||||
const add = (a: any, b: any) => {
|
||||
const add = (a: any, b: any): number => {
|
||||
return a + b;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user