feat(types/reactivity): use DeepReadonly type for readonly return type (#1462)
close #1452
This commit is contained in:
9
test-dts/reactivity.test-d.ts
Normal file
9
test-dts/reactivity.test-d.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { readonly, describe, expectError } from './index'
|
||||
|
||||
describe('should support DeepReadonly', () => {
|
||||
const r = readonly({ obj: { k: 'v' } })
|
||||
// @ts-expect-error
|
||||
expectError((r.obj = {}))
|
||||
// @ts-expect-error
|
||||
expectError((r.obj.k = 'x'))
|
||||
})
|
||||
Reference in New Issue
Block a user