@foodsy-app/fastify-typebox
Advanced tools
Comparing version 4.0.1 to 5.0.0
@@ -24,2 +24,20 @@ /// <reference types="node" /> | ||
} | ||
interface TypeboxRouteShorthandMethod<RawServer extends RawServerBase = RawServerDefault, RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>, RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>> { | ||
<T extends Schema, RequestGeneric extends { | ||
Body?: Static<T["body"]>; | ||
Querystring?: Static<T["querystring"]>; | ||
Params?: Static<T["params"]>; | ||
Headers?: Static<T["headers"]>; | ||
}, ContextConfig = ContextConfigDefault>(path: string, handler: RouteHandlerMethod<RawServer, RawRequest, RawReply, RequestGeneric, ContextConfig>): FastifyInstance<RawServer, RawRequest, RawReply>; | ||
} | ||
interface TypeboxRouteShorthandMethod<RawServer extends RawServerBase = RawServerDefault, RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>, RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>> { | ||
<T extends Schema, RequestGeneric extends { | ||
Body?: Static<T["body"]>; | ||
Querystring?: Static<T["querystring"]>; | ||
Params?: Static<T["params"]>; | ||
Headers?: Static<T["headers"]>; | ||
}, ContextConfig = ContextConfigDefault>(path: string, opts: Omit<RouteShorthandOptions<RawServer, RawRequest, RawReply, RequestGeneric, ContextConfig>, "schema"> & { | ||
schema?: Partial<T>; | ||
}): FastifyInstance<RawServer, RawRequest, RawReply>; | ||
} | ||
declare module "fastify" { | ||
@@ -26,0 +44,0 @@ interface FastifyInstance<RawServer extends RawServerBase = RawServerDefault, RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>, RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>, Logger = FastifyLoggerInstance> { |
42
index.ts
@@ -51,2 +51,44 @@ import { Static, TSchema } from "@sinclair/typebox"; | ||
interface TypeboxRouteShorthandMethod< | ||
RawServer extends RawServerBase = RawServerDefault, | ||
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>, | ||
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer> | ||
> { | ||
< | ||
T extends Schema, | ||
RequestGeneric extends { | ||
Body?: Static<T["body"]>; | ||
Querystring?: Static<T["querystring"]>; | ||
Params?: Static<T["params"]>; | ||
Headers?: Static<T["headers"]>; | ||
}, | ||
ContextConfig = ContextConfigDefault | ||
>( | ||
path: string, | ||
handler: RouteHandlerMethod<RawServer, RawRequest, RawReply, RequestGeneric, ContextConfig> | ||
): FastifyInstance<RawServer, RawRequest, RawReply>; | ||
} | ||
interface TypeboxRouteShorthandMethod< | ||
RawServer extends RawServerBase = RawServerDefault, | ||
RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>, | ||
RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer> | ||
> { | ||
< | ||
T extends Schema, | ||
RequestGeneric extends { | ||
Body?: Static<T["body"]>; | ||
Querystring?: Static<T["querystring"]>; | ||
Params?: Static<T["params"]>; | ||
Headers?: Static<T["headers"]>; | ||
}, | ||
ContextConfig = ContextConfigDefault | ||
>( | ||
path: string, | ||
opts: Omit<RouteShorthandOptions<RawServer, RawRequest, RawReply, RequestGeneric, ContextConfig>, "schema"> & { | ||
schema?: Partial<T>; | ||
} | ||
): FastifyInstance<RawServer, RawRequest, RawReply>; | ||
} | ||
declare module "fastify" { | ||
@@ -53,0 +95,0 @@ interface FastifyInstance< |
{ | ||
"name": "@foodsy-app/fastify-typebox", | ||
"version": "4.0.1", | ||
"version": "5.0.0", | ||
"description": "Plugin for Fastify to prevent having to write duplicate type definitions for schemas", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26663
247