import { Attempt, float, int, Observer, Option, Subscription } from "@opendaw/lib-std";
import { ppqn } from "@opendaw/lib-dsp";
import { Field, PointerField } from "@opendaw/lib-box";
import { Pointers } from "@opendaw/studio-enums";
import { AudioClipBox, AudioRegionBox, AudioUnitBox, NoteClipBox, NoteEventBox, NoteEventCollectionBox, NoteRegionBox, TrackBox, ValueClipBox } from "@opendaw/studio-boxes";
import { AnyRegionBox, AnyRegionBoxAdapter, AudioClipBoxAdapter, AudioRegionBoxAdapter, AudioUnitBoxAdapter, EffectPointerType, IndexedAdapterCollectionListener, InstrumentBox, InstrumentFactory, InstrumentOptions, InstrumentProduct, NoteEventCollectionBoxAdapter } from "@opendaw/studio-adapters";
import { Project } from "./Project";
import { EffectFactory } from "../EffectFactory";
import { EffectBox } from "../EffectBox";
import { AudioContentFactory } from "./audio";
export type ClipRegionOptions = {
    name?: string;
    hue?: number;
};
export type NoteEventParams = {
    owner: {
        events: PointerField<Pointers.NoteEventCollection>;
    };
    position: ppqn;
    duration: ppqn;
    pitch: int;
    cent?: number;
    velocity?: float;
    chance?: int;
};
export type NoteRegionParams = {
    trackBox: TrackBox;
    position: ppqn;
    duration: ppqn;
    loopOffset?: ppqn;
    loopDuration?: ppqn;
    eventOffset?: ppqn;
    eventCollection?: NoteEventCollectionBox;
    mute?: boolean;
    name?: string;
    hue?: number;
};
export type QuantiseNotesOptions = {
    positionQuantisation?: ppqn;
    durationQuantisation?: ppqn;
    offset?: ppqn;
};
export declare class ProjectApi {
    #private;
    constructor(project: Project);
    setBpm(value: number): void;
    catchupAndSubscribeBpm(observer: Observer<number>): Subscription;
    catchupAndSubscribeAudioUnits(listener: IndexedAdapterCollectionListener<AudioUnitBoxAdapter>): Subscription;
    createInstrument<A, INST extends InstrumentBox>({ create, defaultIcon, defaultName, trackType }: InstrumentFactory<A, INST>, options?: InstrumentOptions<A>): InstrumentProduct<INST>;
    createAnyInstrument(factory: InstrumentFactory<any, any>): InstrumentProduct<InstrumentBox>;
    replaceMIDIInstrument<A>(target: InstrumentBox, fromFactory: InstrumentFactory<A>, attachment?: A): Attempt<InstrumentBox, string>;
    insertEffect(field: Field<EffectPointerType>, factory: EffectFactory, insertIndex?: int): EffectBox;
    createNoteTrack(audioUnitBox: AudioUnitBox, insertIndex?: int): TrackBox;
    createAudioTrack(audioUnitBox: AudioUnitBox, insertIndex?: int): TrackBox;
    createAutomationTrack(audioUnitBox: AudioUnitBox, target: Field<Pointers.Automation>, insertIndex?: int): TrackBox;
    createTimeStretchedClip(props: AudioContentFactory.TimeStretchedProps & AudioContentFactory.Clip): AudioClipBox;
    createTimeStretchedRegion(props: AudioContentFactory.TimeStretchedProps & AudioContentFactory.Region): AudioRegionBox;
    createPitchStretchedClip(props: AudioContentFactory.PitchStretchedProps & AudioContentFactory.Clip): AudioClipBox;
    createPitchStretchedRegion(props: AudioContentFactory.PitchStretchedProps & AudioContentFactory.Region): AudioRegionBox;
    createNotStretchedClip(props: AudioContentFactory.NotStretchedProps & AudioContentFactory.Clip): AudioClipBox;
    createNotStretchedRegion(props: AudioContentFactory.NotStretchedProps & AudioContentFactory.Region): AudioRegionBox;
    createNoteClip(trackBox: TrackBox, clipIndex: int, { name, hue }?: ClipRegionOptions): NoteClipBox;
    duplicateRegion<R extends AnyRegionBoxAdapter>(region: R, options?: {
        findFreeSpace?: boolean;
    }): Option<R>;
    exportMIDI(collection: NoteEventCollectionBoxAdapter, suggestedName?: string): Promise<import("@opendaw/lib-runtime").Promises.RejectedResult | import("@opendaw/lib-runtime").Promises.ResolveResult<string>>;
    exportAudio(owner: AudioRegionBoxAdapter | AudioClipBoxAdapter, suggestedName?: string): Promise<import("@opendaw/lib-runtime").Promises.RejectedResult | import("@opendaw/lib-runtime").Promises.ResolveResult<string>>;
    quantiseNotes(notes: NoteEventCollectionBox | ReadonlyArray<NoteEventBox>, { positionQuantisation, durationQuantisation, offset }: QuantiseNotesOptions): void;
    createValueClip(trackBox: TrackBox, clipIndex: int, { name, hue }?: ClipRegionOptions): ValueClipBox;
    createNoteRegion({ trackBox, position, duration, loopOffset, loopDuration, eventOffset, eventCollection, mute, name, hue }: NoteRegionParams): NoteRegionBox;
    createTrackRegion(trackBox: TrackBox, position: ppqn, duration: ppqn, { name, hue }?: ClipRegionOptions): Option<AnyRegionBox>;
    createNoteEvent({ owner, position, duration, velocity, pitch, chance, cent }: NoteEventParams): NoteEventBox;
    deleteAudioUnit(audioUnitBox: AudioUnitBox): void;
}
//# sourceMappingURL=ProjectApi.d.ts.map