Skip to content

Commit

Permalink
Fix typescript build (#305)
Browse files Browse the repository at this point in the history
* Fix typescript build

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup

Signed-off-by: Matteo Collina <hello@matteocollina.com>

---------

Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Sep 10, 2024
1 parent 917cc72 commit 07bdf6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 13 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { type FastifyJWTOptions, type VerifyPayloadType } from '@fastify/jwt'
import { type FastifyPluginCallback, type FastifyReply, type FastifyRequest } from 'fastify'
import { type GetJwksOptions } from 'get-jwks'
import { Agent } from 'http'
import { type URL, type UrlObject } from 'url'

// Copied over to avoid TypeScript compilation errors
// https://github.com/nearform/get-jwks/issues/309
type GetJwksOptions = {
max?: number
ttl?: number
issuersWhitelist?: string[]
providerDiscovery?: boolean
jwksPath?: string
agent?: Agent
timeout?: number
}

export interface JWTOptions extends FastifyJWTOptions {
namespace?: string
jwks?: boolean | GetJwksOptions
Expand Down
1 change: 0 additions & 1 deletion test/types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ app.register(async (instance) => {
expectType<CreateWebhookSessionDecorator>(request.createWebhookSession)
})
})

0 comments on commit 07bdf6d

Please sign in to comment.