From 1e3ae56298b5498d3569eb219238291e0d1bafb5 Mon Sep 17 00:00:00 2001 From: mst-mkt Date: Thu, 7 Aug 2025 16:01:11 +0900 Subject: [PATCH] fix: use generics type for env argument in callback type --- types/config.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/types/config.ts b/types/config.ts index 9300e9a..83c39a6 100644 --- a/types/config.ts +++ b/types/config.ts @@ -1,3 +1,5 @@ +import type { Env } from '../worker/src' + export type PageConfig = { title?: string links?: PageConfigLink[] @@ -39,12 +41,12 @@ export type MonitorTarget = { checkProxyFallback?: boolean } -export type WorkerConfig = { +export type WorkerConfig = { kvWriteCooldownMinutes: number passwordProtection?: string monitors: MonitorTarget[] notification?: Notification - callbacks?: Callbacks + callbacks?: Callbacks } export type Notification = { @@ -55,9 +57,9 @@ export type Notification = { skipNotificationIds?: string[] } -export type Callbacks = { +export type Callbacks = { onStatusChange?: ( - env: any, + env: TEnv, monitor: MonitorTarget, isUp: boolean, timeIncidentStart: number, @@ -65,7 +67,7 @@ export type Callbacks = { reason: string ) => Promise | any onIncident?: ( - env: any, + env: TEnv, monitor: MonitorTarget, timeIncidentStart: number, timeNow: number,