mirror of https://github.com/espruino/BangleApps
exstats.d.ts: permit optional notify input, but non-optional on `ex.state.notify`
parent
23a53f0284
commit
3ef013d002
|
@ -10,17 +10,25 @@ declare module ExStats {
|
|||
|
||||
type Options<Ids> = {
|
||||
paceLength?: number,
|
||||
notify?: Notify<Ids>,
|
||||
notify?: NotifyInput<Ids>,
|
||||
};
|
||||
|
||||
type Notify<Ids> = {
|
||||
[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<Ids> = {
|
||||
[K in keyof Notify<Ids>]?:
|
||||
Omit<
|
||||
Notify<Ids>[K], "next"
|
||||
> & {
|
||||
next?: number,
|
||||
};
|
||||
};
|
||||
|
||||
type StatsInst<Ids extends StatsId> = {
|
||||
stats: Stats<Ids>,
|
||||
state: State<Ids>,
|
||||
|
|
Loading…
Reference in New Issue