Skip to content

Commit

Permalink
fix: properly inherit the types from podium/podlet
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Sep 23, 2024
1 parent 0ebec8e commit fd73e5e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion types/podium.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
import { HttpIncoming } from '@podium/utils';

declare module 'fastify' {
interface PodiumLocals {} // this is declared in @podium/podlet, we just hook onto it here


interface PodiumHttpIncomingParameters {
[key: string]: unknown;
}

// @podium/podlet declares what's on the context. We use the same interface names here to inherit them.

interface PodiumHttpIncomingContext {
[key: string]: unknown;
}

interface PodiumHttpIncomingViewParameters {
[key: string]: unknown;
}

interface PodiumLocals {
podium: HttpIncoming<PodiumHttpIncomingParameters, PodiumHttpIncomingContext, PodiumHttpIncomingViewParameters>;
}

interface FastifyReply {
app: PodiumLocals;
Expand Down

0 comments on commit fd73e5e

Please sign in to comment.