diff --git a/src/flash.ts b/src/flash.ts index 0fec638..ed1f0f4 100644 --- a/src/flash.ts +++ b/src/flash.ts @@ -1,13 +1,13 @@ import { format } from 'node:util' import type { FastifyRequest, FastifyReply } from 'fastify' +import type { SessionData } from '@fastify/secure-session' declare module '@fastify/secure-session' { interface SessionData { flash: { [k: string]: string[] } } } - -type FlashData = { [k: string]: string[] } +type FlashData = SessionData['flash'] export type ReplyReturn = FlashData | string[] export function flashFactory () { diff --git a/src/index.ts b/src/index.ts index e7047c0..9d5ddf8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ import fp = require('fastify-plugin') import { flashFactory } from './flash' -import '@fastify/secure-session' declare module 'fastify' { export interface FastifyRequest {