import type { IfExtends } from "hry-types/src/Any/IfExtends"; import type { IsPureObject } from "hry-types/src/Any/IsPureObject"; import type { NoInfer } from "hry-types/src/Generic/NoInfer"; import type { EmptyObject } from "hry-types/src/Misc/EmptyObject"; type getFirstKeys = T extends `${infer F}.${string}` ? F : never; type getLastKeys = T extends `${string}.${infer L}` ? L : never; type AddFieldsOfObject extends true ? `${k & string}.${(keyof TWatchData[k]) & string}` | `${k & string}.**` : never; }[_WatchKeys]> = { [k in secondKeys]?: (newValue: IfExtends, "**", Exclude], null>, NonNullable<(Exclude], null>)[getLastKeys]>>, oldValue: IfExtends, "**", TWatchData[getFirstKeys], (Exclude], null>)[getLastKeys]>) => void | Promise; }; export type WatchOption = { watch?: IfExtends<{}, TWatchData, EmptyObject, NoInfer<{ [k in _WatchKeys]?: (newValue: TWatchData[k], oldValue: TWatchData[k]) => void | Promise; } & { [k in _WatchKeys as never]: unknown; } & AddFieldsOfObject>>; }; export {};