-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expose the Fastify options type #591
Copy link
Copy link
Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
Currently, we have to write type for AppOptions, while it is Fastify options. And why we can't improve by importing the Fastify options type? It should be easier to code if we can do it. For example, I don't know what is logger type looks like.
export type AppOptions = {
// Place your custom options for app below here.
logger: <???>
trustProxy: true,
maxParamLength: number,
connectionTimeout: number,
requestTimeout: number,
bodyLimit: number,
exposeHeadRoutes: boolean,
rewriteUrl: (req: FastifyRequest) => any, // I have to use <any> for this ...
ajv: {
customOptions: {
removeAdditional: boolean,
useDefaults: boolean,
coerceTypes: string
allErrors: boolean,
allowUnionTypes: boolean,
},
plugins: any[]
}
} & Partial<AutoloadPluginOptions>;Motivation
Improve the plugin. Take advantage of Typescript type.
Example
export type AppOptions = FastifyOptions & Partial<AutoloadPluginOptions>;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels