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> = {
|
type Options<Ids> = {
|
||||||
paceLength?: number,
|
paceLength?: number,
|
||||||
notify?: Notify<Ids>,
|
notify?: NotifyInput<Ids>,
|
||||||
};
|
};
|
||||||
|
|
||||||
type Notify<Ids> = {
|
type Notify<Ids> = {
|
||||||
[key in Ids & ("dist" | "step" | "time")]?: {
|
[key in Ids & ("dist" | "step" | "time")]: {
|
||||||
// optional when passed in ^
|
increment: number,
|
||||||
increment?: number,
|
next: number,
|
||||||
next?: number,
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type NotifyInput<Ids> = {
|
||||||
|
[K in keyof Notify<Ids>]?:
|
||||||
|
Omit<
|
||||||
|
Notify<Ids>[K], "next"
|
||||||
|
> & {
|
||||||
|
next?: number,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
type StatsInst<Ids extends StatsId> = {
|
type StatsInst<Ids extends StatsId> = {
|
||||||
stats: Stats<Ids>,
|
stats: Stats<Ids>,
|
||||||
state: State<Ids>,
|
state: State<Ids>,
|
||||||
|
|
Loading…
Reference in New Issue