type myKey = 'line' | 'abzac' | 'text'
type myKey = 'line' | 'abzac' | 'text'
type IEX = {
[key: string]: string
}
type antiKey = Exclude<IEX, myKey>;
let znac: antiKey = {
anystring: 'stroka',
line: 'online',
text: 'abcdef'
}
type Keys = 'line' | 'abzac' | 'text'
type IEX = Record<string, string>
type AntiKey = IEX & Partial<Record<Keys, never>>
// or
type AntiKey = IEX & { [Key in Keys]?: never }
// валидное значение
let znac: AntiKey = {
oneline: 'anytext',
otherline: 'othertext'
}
// невалидное
let er: AntiKey = {
text: 'no',
other: 'txt'
}