MK
text: string | {
test: {
[key: string]: string;
};
};
когда пытаюсь присвоить переменной этого типа какую-либо строку, получаю ошибку
type 'string | { test: {[key: string]: string; }; }' is not assignable to type 'string'.
Size: a a a
MK
text: string | {
test: {
[key: string]: string;
};
};
type 'string | { test: {[key: string]: string; }; }' is not assignable to type 'string'.
AK
text: string | {
test: {
[key: string]: string;
};
};
type 'string | { test: {[key: string]: string; }; }' is not assignable to type 'string'.
AK
Д
ЗП
KL
V
Д
G
V
ED
ЗП
ED
ЗП
ED
ЗП
ЗП
S
S
NF
type T = { isDenied: true } | { isApproved: true }
function f(x: T) {
if (x.isDenied) {
// x is { isDenied: true }
}
}