refactor(types/compat): improve the types for $set and $delete (#8719)

This commit is contained in:
远方os 2024-05-30 18:27:38 +08:00 committed by GitHub
parent 3a0b463a2c
commit 70f2f283ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 2 deletions

View File

@ -43,8 +43,15 @@ export type LegacyPublicInstance = ComponentPublicInstance &
LegacyPublicProperties
export interface LegacyPublicProperties {
$set(target: object, key: string, value: any): void
$delete(target: object, key: string): void
$set<T extends Record<keyof any, any>, K extends keyof T>(
target: T,
key: K,
value: T[K]
): void
$delete<T extends Record<keyof any, any>, K extends keyof T>(
target: T,
key: K
): void
$mount(el?: string | Element): this
$destroy(): void
$scopedSlots: Slots