van-hmr/van.x.types.d.ts.old

9 lines
384 B
TypeScript
Raw Normal View History

2025-02-06 12:38:10 -05:00
declare namespace VanX
{
type StateOf<T> = { readonly [K in keyof T]: Van.State<T[K]> }
type ValueType<T> = T extends (infer V)[] ? V : T[keyof T]
type KeyType<T> = T extends unknown[] ? number : string
type ReplacementFunc<T> =
T extends (infer V)[] ? (items: V[]) => readonly V[] :
(items: [string, T[keyof T]][]) => readonly [string, T[keyof T]][]
}