Skip to content

Commit 1f2a37c

Browse files
authored
Merge pull request #118 from fastify/fix-v3
Fix types for v3
2 parents 8047a7a + bde3174 commit 1f2a37c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FastifyPlugin, FastifyReply, FastifyRequest, RawServerBase } from 'fastify';
1+
import { FastifyPlugin, FastifyReply, FastifyRequest, RawServerBase, RequestGenericInterface } from 'fastify';
22
import { Input, InputObject } from 'into-stream';
33
import { Stream } from 'stream';
44
import { BrotliOptions, ZlibOptions } from 'zlib';
@@ -19,12 +19,12 @@ export interface FastifyCompressOptions {
1919
brotliOptions?: BrotliOptions
2020
zlibOptions?: ZlibOptions
2121
inflateIfDeflated?: boolean
22-
onUnsupportedEncoding?: (encoding: string, request: FastifyRequest<RawServerBase>, reply: FastifyReply<RawServerBase>) => string | Buffer | Stream
22+
onUnsupportedEncoding?: (encoding: string, request: FastifyRequest<RequestGenericInterface, RawServerBase>, reply: FastifyReply<RawServerBase>) => string | Buffer | Stream
2323
encodings?: Array<EncodingToken>
2424
requestEncodings?: Array<EncodingToken>
2525
forceRequestEncoding?: EncodingToken
26-
  onUnsupportedRequestEncoding?: (encoding: string, request: FastifyRequest<RawServerBase>, reply: FastifyReply<RawServerBase>) => Error | undefined | null
27-
onInvalidRequestPayload?: (encoding: string, request: FastifyRequest<RawServerBase>, error: Error) => Error | undefined | null
26+
  onUnsupportedRequestEncoding?: (encoding: string, request: FastifyRequest<RequestGenericInterface, RawServerBase>, reply: FastifyReply<RawServerBase>) => Error | undefined | null
27+
onInvalidRequestPayload?: (encoding: string, request: FastifyRequest<RequestGenericInterface, RawServerBase>, error: Error) => Error | undefined | null
2828
}
2929

3030
declare const fastifyCompress: FastifyPlugin<FastifyCompressOptions>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@types/node": "^14.0.1",
2424
"@typescript-eslint/parser": "^3.0.0",
2525
"eslint-plugin-typescript": "^0.14.0",
26-
"fastify": "^3.0.0-rc.4",
26+
"fastify": "^3.0.0",
2727
"jsonstream": "^1.0.3",
2828
"pre-commit": "^1.2.2",
2929
"standard": "^14.3.1",

0 commit comments

Comments
 (0)