fix(lib/patcher): correct types in hookers to fix autocomplete

This commit is contained in:
PalmDevs 2025-06-10 11:05:28 +07:00
parent b3b41e260b
commit 64801214e4
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
3 changed files with 6 additions and 18 deletions

View file

@ -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>,

View file

@ -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>,

View file

@ -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>,