型アノテーションをつけない SingleTextEditorParams
(仮に RawSingleTextEditorParamsUntypedSingleTextEditorParams
とします) を先に作り、
SingleTextEditorParamKeys
は keyof typeof RawSingleTextEditorParamsUntypedSingleTextEditorParams
とするのはいかがですか。
const RawSingleTextEditorParamsUntypedSingleTextEditorParams = {
a: ...,
b: ...,
c: ...,
d: ...,
};
type SingleTextEditorParamKeys =
keyof typeof RawSingleTextEditorParamsUntypedSingleTextEditorParams;
const SingleTextEditorParams
: Record<SingleTextEditorParamKeys, SingleTextEditorParamList>
= RawSingleTextEditorParamsUntypedSingleTextEditorParams;