All files / jianpu-renderer/utils Constants.ts

0% Statements 0/46
0% Branches 0/1
0% Functions 0/1
0% Lines 0/46

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47                                                                                             
/**
 * 常量定义
 */

export const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';

/**
 * VexFlow兼容的CSS类名
 */
export const VEXFLOW_CSS_CLASSES = {
  NOTE: 'vf-note',
  NUMBERED_NOTE_HEAD: 'vf-numbered-note-head',
  LYRIC: 'vf-lyric',
  BEAM: 'vf-beam',
  CUSTOM_BG: 'vf-custom-bg',
  BARLINE: 'vf-barline',
  DURATION_LINE: 'vf-duration-line',
  REST: 'vf-rest',
  STEM: 'vf-stem',
} as const;

/**
 * 音高映射(简谱数字到音名)
 */
export const PITCH_MAP: { [key: number]: string } = {
  1: 'C',
  2: 'D',
  3: 'E',
  4: 'F',
  5: 'G',
  6: 'A',
  7: 'B',
};

/**
 * 音名到简谱数字映射
 */
export const NOTE_NAME_TO_PITCH: { [key: string]: number } = {
  'C': 1,
  'D': 2,
  'E': 3,
  'F': 4,
  'G': 5,
  'A': 6,
  'B': 7,
};