All files / player-ui/src events.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

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                                                                   
import type { BeMusicPlayOptions as PlayOptions } from '@be-music/player-skin-sdk';
 
export type BeMusicPlayOptionChange = {
  [K in keyof PlayOptions]: { key: K; value: PlayOptions[K] };
}[keyof PlayOptions];
 
/** Semantic requests carry data, never engine instances or callback functions. */
export interface BeMusicUIEventMap {
  'pause-request': undefined;
  'retry-request': undefined;
  'quit-request': undefined;
  'continue-request': undefined;
  'cancel-request': undefined;
  'back-request': undefined;
  'readme-request': undefined;
  /** `<be-music-readme-dialog>`: the player asked to close it (its close button, Escape or the backdrop). */
  'readme-close': undefined;
  /** `<be-music-readme-dialog>`: the player chose the text file at `index` of its tabs. */
  'readme-tab': { index: number };
  'gesture-request': undefined;
  'play-request': { autoPlay: boolean };
  'auto-play-change': { autoPlay: boolean };
  'selection-change': { index: number };
  'activate-request': { index: number };
  'search-change': { value: string };
  'play-option-change': BeMusicPlayOptionChange;
  'seek-request': { seconds: number };
  'volume-change': { volume: number; muted: boolean };
  'fullscreen-request': undefined;
  /** `<be-music-chart-score>`: the bars selected (`first`..`last`), the bar pressed, and whether it extended the run. */
  'bar-selection-change': { first: number; last: number; bar: number; extend: boolean };
}
export type BeMusicUIEvent<K extends keyof BeMusicUIEventMap> = CustomEvent<BeMusicUIEventMap[K]>;