From 3ef013d002ccad4a2ebae9b2c51d59552d55ca15 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 10 Oct 2024 18:01:12 +0100 Subject: [PATCH] exstats.d.ts: permit optional notify input, but non-optional on `ex.state.notify` --- typescript/types/exstats.d.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/typescript/types/exstats.d.ts b/typescript/types/exstats.d.ts index 7c68b6d59..7e980882d 100644 --- a/typescript/types/exstats.d.ts +++ b/typescript/types/exstats.d.ts @@ -10,17 +10,25 @@ declare module ExStats { type Options = { paceLength?: number, - notify?: Notify, + notify?: NotifyInput, }; type Notify = { - [key in Ids & ("dist" | "step" | "time")]?: { - // optional when passed in ^ - increment?: number, - next?: number, + [key in Ids & ("dist" | "step" | "time")]: { + increment: number, + next: number, } }; + type NotifyInput = { + [K in keyof Notify]?: + Omit< + Notify[K], "next" + > & { + next?: number, + }; + }; + type StatsInst = { stats: Stats, state: State,