diff --git a/index.d.ts b/index.d.ts index fd28de2..9b04f4f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -65,7 +65,7 @@ declare namespace avvio { } interface Use> { - (fn: avvio.Plugin, options?: O): C; + (fn: avvio.Plugin, options?: O | ((server: C) => O)): C; } interface Ready> { diff --git a/test/types/index.ts b/test/types/index.ts index a64b2e7..8b80d62 100644 --- a/test/types/index.ts +++ b/test/types/index.ts @@ -35,6 +35,18 @@ import * as avvio from "../../"; server.close; }); + app.use(async (server, options) => {}, + (server) => { + server.use; + server.after; + server.ready; + server.on; + server.start; + server.override; + server.onClose; + server.close; + }); + app.after(err => { if (err) throw err; }); @@ -156,6 +168,18 @@ import * as avvio from "../../"; server.close; }); + app.use(async (server, options) => {}, + (server) => { + server.use; + server.after; + server.ready; + server.on; + server.start; + server.override; + server.onClose; + server.close; + }); + app.after(err => { if (err) throw err; }); @@ -270,6 +294,14 @@ import * as avvio from "../../"; server.typescriptIs; }); + app.use(async (server, options) => {}, + ((server) => { + server.use; + server.after; + server.ready; + server.typescriptIs; + })); + app.after(err => { if (err) throw err; });