Closed
Description
node
version - 13.14.0celebrate
version - 13.0.4joi
version (vianpm ls --depth=0 | grep joi
) - 17.3.0express
version - 4.17.1@types/express
version - 4.17.6
My joi
schema looks like this:
not applicable
The issue I am having with celebrate
is:
I am getting this Typescript compilation error as soon as I import celebrate:
node_modules/celebrate/lib/index.d.ts(26,77): error TS2344: Type 'P' does not satisfy the constraint 'Params'.
Type 'P' is not assignable to type 'ParamsArray'.
node_modules/celebrate/lib/index.d.ts(40,23): error TS2344: Type 'P' does not satisfy the constraint 'Params'.
Type 'P' is not assignable to type 'ParamsArray'.
node_modules/celebrate/lib/index.d.ts(84,196): error TS2344: Type 'P' does not satisfy the constraint 'Params'.
Type 'P' is not assignable to type 'ParamsArray'.
node_modules/celebrate/lib/index.d.ts(94,146): error TS2344: Type 'P' does not satisfy the constraint 'Params'.
Type 'P' is not assignable to type 'ParamsArray'.
Not sure how exactly to fix this yet, but:
- Here is the TS declaration in
celebrate/lib/index.d.ts:84
:
export declare function celebrate<P=ParamsDictionary, ResBody=any, ReqBody=any, ReqQuery=Query>(
requestRules: SchemaOptions, joiOpts?: ValidationOptions, opts?: CelebrateOptions
): RequestHandler<P, ResBody, ReqBody, ReqQuery>;
^
- These generic declarations were introduced in PR Add generic celebrate function declaration #200 about a month ago.
Metadata
Metadata
Assignees
Labels
No labels