NotMatchTypeKeys
NotMatchTypeKeys<T
, U
>: keyof Omit
<T
, MatchTypeKeys
<T
, U
>>
Tのプロパティのうち、Uで指定した型を持たないプロパティのキーを取り出す
Example
type Post = {
title: string
body: string
revision?: number
createdAt: Date
updatedAt?: Date
}
// Keys => "title" | "body"
type Keys = NotMatchTypeKeys<Post, Date | undefined>
// Props => { title: string; body: string }
type Props = Pick<Post, Keys>
Type parameters
Name |
---|
T |
U |