import { A } from "free-types-core"; import { HeadLength, Next, RestElement } from "../../utils.js"; import { $Accessor, $Iterator } from "./types.js"; export { $Tuple, $GetValue, $Done }; interface $Tuple extends $Iterator { value: $GetValue; path: $GetPath; done: $Done; } interface $GetValue extends $Accessor { type: A extends HeadLength ? RestElement : T[A]; } interface $GetPath extends $Accessor { type: A extends HeadLength ? [number] : [A]; } interface $Done extends $Accessor { type: A extends Length ? true : false; } type Length = number extends T['length'] ? Next> : T['length'];