import * as TSU from "@panyam/tsutils";
import { Entity, TimedEntity } from "./entity";
import { LayoutParams } from "./layouts";
type Fraction = TSU.Num.Fraction;
export declare const ZERO: TSU.Num.Fraction;
export declare const ONE: TSU.Num.Fraction;
export declare enum AtomType {
    NOTE = "Note",
    LITERAL = "Literal",
    SYLLABLE = "Syllable",
    SPACE = "Space",
    GROUP = "Group",
    LABEL = "Label",
    REST = "Rest",
    MARKER = "Marker"
}
export declare abstract class Atom extends TimedEntity {
    readonly TYPE: string;
    protected _duration: Fraction;
    markersBefore: Marker[];
    markersAfter: Marker[];
    nextSibling: TSU.Nullable<Atom>;
    prevSibling: TSU.Nullable<Atom>;
    parentGroup: TSU.Nullable<Group>;
    isContinuation: boolean;
    constructor(duration?: TSU.Num.Fraction);
    abstract splitAt(requiredDuration: Fraction): TSU.Nullable<Atom>;
    debugValue(): any;
    copyTo(another: this): void;
    get duration(): Fraction;
    set duration(d: Fraction);
}
export declare abstract class LeafAtom extends Atom {
    readonly TYPE: string;
    beforeRest: boolean;
    splitAt(duration: Fraction): TSU.Nullable<Atom>;
    protected createSpilloverSpace(duration: Fraction): Space;
    debugValue(): any;
}
export declare class Marker extends Entity {
    text: string;
    isBefore: boolean;
    readonly TYPE = "Marker";
    constructor(text: string, isBefore?: boolean);
    debugValue(): any;
    toString(): string;
}
export declare class Rest extends LeafAtom {
    readonly TYPE = "Rest";
    constructor();
}
export declare class Space extends LeafAtom {
    readonly TYPE = "Space";
    isSilent: boolean;
    constructor(duration?: TSU.Num.Fraction, isSilent?: boolean);
    debugValue(): any;
    toString(): string;
    copyTo(another: this): void;
    equals(another: this): boolean;
    protected createSpilloverSpace(duration: Fraction): Space;
}
export declare class Literal extends LeafAtom {
    value: string;
    readonly TYPE: string;
    embelishments: any[];
    constructor(value: string, duration?: TSU.Num.Fraction);
    debugValue(): any;
    toString(): string;
    equals(another: this): boolean;
    copyTo(another: this): void;
}
export declare class Syllable extends Literal {
    readonly TYPE = "Syllable";
    static fromLit(lit: Literal): Syllable;
    toString(): string;
}
export declare class Note extends Literal {
    readonly TYPE = "Note";
    octave: number;
    shift: number | boolean;
    constructor(value: string, duration?: TSU.Num.Fraction, octave?: number, shift?: number);
    static fromLit(lit: Literal): Note;
    debugValue(): any;
    toString(): string;
    equals(another: this): boolean;
    copyTo(another: this): void;
}
export declare class Group extends Atom {
    readonly TYPE = "Group";
    durationIsMultiplier: boolean;
    readonly atoms: TSU.Lists.ValueList<Atom>;
    constructor(...atoms: Atom[]);
    equals(another: this, expect?: boolean): boolean;
    copyTo(another: this): void;
    get duration(): Fraction;
    setDurationAsMultiplier(asMultiplier?: boolean): this;
    setDuration(d: Fraction, asMultiplier?: boolean): this;
    debugValue(): any;
    splitAt(requiredDuration: Fraction): TSU.Nullable<Group>;
    get totalChildDuration(): Fraction;
    insertAtomsAt(beforeAtom: TSU.Nullable<Atom>, adjustDuration?: boolean, ...atoms: Atom[]): this;
    addAtoms(adjustDuration?: boolean, ...atoms: Atom[]): this;
    removeAtoms(adjustDuration?: boolean, ...atoms: Atom[]): this;
}
export declare class Line extends Entity {
    readonly TYPE: string;
    offset: Fraction;
    roles: Role[];
    marginText: string;
    layoutParams: LayoutParams;
    indexOfRole(name: string): number;
    get isEmpty(): boolean;
    debugValue(): any;
    copyTo(another: this): void;
    addAtoms(roleName: string, defaultToNotes: boolean, ...atoms: Atom[]): this;
    ensureRole(roleName: string, defaultToNotes: boolean): Role;
    get duration(): Fraction;
}
export declare class Role extends Entity {
    readonly line: Line;
    readonly name: string;
    readonly TYPE = "Role";
    defaultToNotes: boolean;
    atoms: Atom[];
    constructor(line: Line, name: string);
    get isEmpty(): boolean;
    debugValue(): any;
    addAtoms(...atoms: Atom[]): void;
    copyTo(another: Role): void;
    get duration(): Fraction;
}
export {};
