import * as TSU from "@panyam/tsutils";
import { Marker, Line, Atom, Role } from "./";
import { CycleIterator } from "./cycle";
import { WindowIterator } from "./iterators";
import { LayoutParams } from "./layouts";
import { GridModel, GridCell, ColAlign, GridLayoutGroup } from "./grids";
import { Block, BlockItem } from "./notation";
type Fraction = TSU.Num.Fraction;
export declare class Beat {
    readonly index: number;
    readonly role: Role;
    readonly offset: Fraction;
    readonly duration: Fraction;
    readonly barIndex: number;
    readonly beatIndex: number;
    readonly instance: number;
    readonly prevBeat: null | Beat;
    nextBeat: null | Beat;
    private static idCounter;
    readonly uuid: number;
    atom: Atom;
    protected atomIsPlaceholder: boolean;
    constructor(index: number, role: Role, offset: Fraction, duration: Fraction, barIndex: number, beatIndex: number, instance: number, prevBeat: null | Beat, nextBeat: null | Beat);
    debugValue(): any;
    get endOffset(): Fraction;
    get filled(): boolean;
    get remaining(): Fraction;
    add(atom: Atom): boolean;
    get preMarkers(): Marker[];
    get postMarkers(): Marker[];
}
export declare class BeatsBuilder {
    readonly role: Role;
    readonly layoutParams: LayoutParams;
    readonly startOffset: Fraction;
    readonly beats: Beat[];
    readonly startIndex: number;
    readonly beatOffset: Fraction;
    cycleIter: CycleIterator;
    windowIter: WindowIterator;
    onAtomAdded: (atom: Atom, beat: Beat) => void;
    onBeatAdded: (beat: Beat) => void;
    onBeatFilled: (beat: Beat) => void;
    constructor(role: Role, layoutParams: LayoutParams, startOffset?: Fraction, ...atoms: Atom[]);
    addAtoms(...atoms: Atom[]): void;
    protected addBeat(): Beat;
}
export declare class BeatColumn extends ColAlign {
    readonly offset: Fraction;
    readonly endOffset: Fraction;
    readonly markerType: number;
    atomSpacing: number;
    readonly key: string;
    constructor(offset: Fraction, endOffset: Fraction, markerType: number);
    static keyFor(offset: Fraction, endOffset: Fraction, markerType?: number): string;
}
export declare class BeatColDAG {
    readonly layoutGroup: GridLayoutGroup;
    beatColumns: Map<string, BeatColumn>;
    constructor(layoutGroup: GridLayoutGroup);
    getBeatColumn(offset: Fraction, endOffset: Fraction, markerType?: number): BeatColumn;
    protected ensureBeatColumn(offset: Fraction, endOffset: Fraction, markerType?: number): [BeatColumn, boolean];
}
type LineId = number;
type LPID = number;
export declare class GlobalBeatLayout {
    gridModelsForLine: Map<number, GridModel>;
    roleBeatsForLine: Map<number, Beat[][]>;
    beatColDAGsByLP: Map<number, BeatColDAG>;
    readonly gridLayoutGroup: GridLayoutGroup;
    constructor(sharedGridLayoutGroup?: GridLayoutGroup);
    getGridModelForLine(lineid: LineId): GridModel;
    protected beatColDAGForLP(lpid: LPID): BeatColDAG;
    addLine(line: Line): void;
    processBlock(block: Block): void;
    protected processBlockItem(item: BlockItem): void;
    protected lineToRoleBeats(line: Line, gridModel: GridModel): Beat[][];
    protected addBeat(beat: Beat, gridModel: GridModel): GridCell;
}
export {};
