diff --git a/src/constants/languages.ts b/src/constants/languages.ts new file mode 100644 index 00000000..c8dca0da --- /dev/null +++ b/src/constants/languages.ts @@ -0,0 +1,4 @@ +export const CODE_SAMPLE_LANGUAGES = { + JSON: 'json', + XML: 'xml', +} as const; diff --git a/src/services/RedocNormalizedOptions.ts b/src/services/RedocNormalizedOptions.ts index 17204f6e..45e10660 100644 --- a/src/services/RedocNormalizedOptions.ts +++ b/src/services/RedocNormalizedOptions.ts @@ -5,8 +5,9 @@ import { isArray, isNumeric, mergeObjects } from '../utils/helpers'; import { setRedocLabels } from './Labels'; import { SideNavStyleEnum } from './types'; import type { LabelsConfigRaw, MDXComponentMeta } from './types'; +import { CODE_SAMPLE_LANGUAGES } from '../constants/languages'; -export type CodeSamplesLanguage = 'json' | 'xml'; +export type CodeSamplesLanguage = typeof CODE_SAMPLE_LANGUAGES[keyof typeof CODE_SAMPLE_LANGUAGES]; export interface RedocRawOptions { theme?: ThemeInterface;