/**
 * Copied from @lexical/code/LexicalCode.dev.js 0.8.0
 */
const CODE_LANGUAGE_FRIENDLY_NAME_MAP = {
  c: 'C',
  clike: 'C-like',
  css: 'CSS',
  html: 'HTML',
  js: 'JavaScript',
  markdown: 'Markdown',
  objc: 'Objective-C',
  plain: 'Plain Text',
  py: 'Python',
  rust: 'Rust',
  sql: 'SQL',
  swift: 'Swift',
  typescript: 'TypeScript',
  xml: 'XML',
} as const;
const CODE_LANGUAGE_MAP = {
  javascript: 'js',
  md: 'markdown',
  plaintext: 'plain',
  python: 'py',
  text: 'plain',
  ts: 'typescript',
} as const;
const CODE_ALL_NAME_OPTIONS = {
  ...CODE_LANGUAGE_FRIENDLY_NAME_MAP,
  ...CODE_LANGUAGE_MAP,
} as const;

export type CrystallizeRichTextCodeNodes = {
  type: 'code';
  kind: 'inline' | 'block';
  metadata?: Record<string, unknown> & {
    language?: keyof typeof CODE_ALL_NAME_OPTIONS;
  };
};
