fix(lib/patcher): correct types in hookers to fix autocomplete
This commit is contained in:
parent
b3b41e260b
commit
64801214e4
3 changed files with 6 additions and 18 deletions
|
|
@ -34,12 +34,8 @@ function unpatchAfter<T extends UnknownFunction>(
|
|||
|
||||
export function after<
|
||||
Parent extends Record<Key, UnknownFunction>,
|
||||
Key extends PropertyKey,
|
||||
>(
|
||||
parent: Parent,
|
||||
key: FiniteDomain<Key>,
|
||||
hook: AfterHook<Parent[Key]>,
|
||||
): () => void
|
||||
Key extends keyof Parent,
|
||||
>(parent: Parent, key: Key, hook: AfterHook<Parent[Key]>): () => void
|
||||
export function after<Key extends PropertyKey, Value extends UnknownFunction>(
|
||||
parent: Record<Key, Value>,
|
||||
key: FiniteDomain<Key>,
|
||||
|
|
|
|||
|
|
@ -34,12 +34,8 @@ function unpatchBefore<T extends UnknownFunction>(
|
|||
|
||||
export function before<
|
||||
Parent extends Record<Key, UnknownFunction>,
|
||||
Key extends PropertyKey,
|
||||
>(
|
||||
parent: Parent,
|
||||
key: FiniteDomain<Key>,
|
||||
hook: BeforeHook<Parent[Key]>,
|
||||
): () => void
|
||||
Key extends keyof Parent,
|
||||
>(parent: Parent, key: Key, hook: BeforeHook<Parent[Key]>): () => void
|
||||
export function before<Key extends PropertyKey, Value extends UnknownFunction>(
|
||||
parent: Record<Key, Value>,
|
||||
key: FiniteDomain<Key>,
|
||||
|
|
|
|||
|
|
@ -72,12 +72,8 @@ function unpatchInstead<T extends UnknownFunction>(
|
|||
|
||||
export function instead<
|
||||
Parent extends Record<Key, UnknownFunction>,
|
||||
Key extends PropertyKey,
|
||||
>(
|
||||
parent: Parent,
|
||||
key: FiniteDomain<Key>,
|
||||
hook: InsteadHook<Parent[Key]>,
|
||||
): () => void
|
||||
Key extends keyof Parent,
|
||||
>(parent: Parent, key: Key, hook: InsteadHook<Parent[Key]>): () => void
|
||||
export function instead<Key extends PropertyKey, Value extends UnknownFunction>(
|
||||
parent: Record<Key, Value>,
|
||||
key: FiniteDomain<Key>,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue