diff options
Diffstat (limited to 'packages/server/src/types')
-rw-r--r-- | packages/server/src/types/fastify.d.ts | 11 | ||||
-rw-r--r-- | packages/server/src/types/index.d.ts | 10 |
2 files changed, 19 insertions, 2 deletions
diff --git a/packages/server/src/types/fastify.d.ts b/packages/server/src/types/fastify.d.ts index ebaaac2..7c2341d 100644 --- a/packages/server/src/types/fastify.d.ts +++ b/packages/server/src/types/fastify.d.ts @@ -1,5 +1,7 @@ import { FastifyRequest, RequestGenericInterface } from "fastify"; import { ReplyGenericInterface } from "fastify/types/reply"; +import { Settings } from "."; +import { ServerCache } from "../cache"; export interface Request extends RequestGenericInterface { Params: Record<string, string>, @@ -8,4 +10,11 @@ export interface Request extends RequestGenericInterface { export interface Route extends Request, ReplyGenericInterface {} -export type CoolFastifyRequest = FastifyRequest<Route>;
\ No newline at end of file +export type CoolFastifyRequest = FastifyRequest<Route>; + +export type FastifyPluginOptions = { + config: { + settings: Settings, + cache: ServerCache | null + } +}
\ No newline at end of file diff --git a/packages/server/src/types/index.d.ts b/packages/server/src/types/index.d.ts index 8f592f9..ca0743d 100644 --- a/packages/server/src/types/index.d.ts +++ b/packages/server/src/types/index.d.ts @@ -1,10 +1,18 @@ +export type CacheConfig = { + enabled: boolean, + ttl?: number, + max?: number, + refreshThreshold?: number +} + export type Settings = { host: string, port: number, title: string, about: string, git_dir: string, - dev: { + cache?: CacheConfig, + dev?: { port: number } }
\ No newline at end of file |