UNPKG

kshoot-tools

Version:

A collection of tools related to KSH and KSON chart files of K-Shoot Mania

36 lines (35 loc) 1.35 kB
import { type Canvas, type CanvasRenderingContext2D } from 'canvas'; import * as kshoot from 'kshoot'; export interface Params { max_columns: number; pulses_per_column: kshoot.Pulse; start: kshoot.Pulse; } export declare class Column { readonly width: number; height: number; readonly chart: kshoot.Chart; readonly timing: kshoot.Timing; range: kshoot.PulseRange; readonly layers: [canvas: Canvas, ctx: CanvasRenderingContext2D][]; constructor(renderer: Renderer, range?: kshoot.PulseRange); reset(new_range: kshoot.PulseRange): void; drawLane(): void; drawMeasures(column_index: number): void; drawButtonNote(pulse: kshoot.Pulse, button: kshoot.ButtonObject): void; drawButtonNotes(): void; drawLaserNote(pulse: kshoot.Pulse, laser: kshoot.LaserObject): void; drawLaserNotes(): void; render(column_index: number, target: CanvasRenderingContext2D, x: number, y: number): void; } export declare class Renderer { readonly chart: kshoot.Chart; readonly timing: kshoot.Timing; constructor(args: { chart: kshoot.Chart; timing?: kshoot.Timing; }); chooseStart(columns: number, pulses_per_column: kshoot.Pulse): kshoot.Pulse; renderButton(ctx: CanvasRenderingContext2D, length: number): void; render(params: Partial<Params>): Promise<Buffer>; }