{
"encoding_status": {
"B000402089": {
"ocr_update": {
"event": "ocr_update",
"status": "success",
"mcode": "B000402089",
"text": "안녕하세요",
"headline": "금융",
"language": "ko"
}
}
}
}
B000402089와 같이 동적으로 변하는 키를 타입으로 변환하기
type OcrUpdate = {
event: string;
status: string;
mcode: string;
text: string;
headline: string;
language: string;
};
type EncodingStatus = {
[key: string]: {
ocr_update: OcrUpdate;
};
};
EncodingStatus 타입은 문자열 타입의 모든 키를 허용