mirror of
https://github.com/type-challenges/type-challenges.git
synced 2025-12-08 19:06:13 +00:00
19 lines
377 B
TypeScript
19 lines
377 B
TypeScript
import { Equal, Expect } from '@type-challenges/utils'
|
|
|
|
type cases = [
|
|
Expect<Equal<'title', GetReadonlyKeys<Todo1>>>,
|
|
Expect<Equal<'title' | 'description', GetReadonlyKeys<Todo2>>>,
|
|
]
|
|
|
|
interface Todo1 {
|
|
readonly title: string
|
|
description: string
|
|
completed: boolean
|
|
}
|
|
|
|
interface Todo2 {
|
|
readonly title: string
|
|
readonly description: string
|
|
completed?: boolean
|
|
}
|