import type { Attachment, CompleteAttachment } from "../../types/attachment.js";
import type { Unsubscribe } from "../../types/unsubscribe.js";
import type { SubscribableWithState } from "../../subscribable/subscribable.js";
import type { ComposerRuntimeCoreBinding } from "./bindings.js";
import type { AttachmentRuntimePath } from "./paths.js";
type MessageAttachmentState = CompleteAttachment & {
    readonly source: "message";
};
type ThreadComposerAttachmentState = Attachment & {
    readonly source: "thread-composer";
};
type EditComposerAttachmentState = Attachment & {
    readonly source: "edit-composer";
};
export type AttachmentState = ThreadComposerAttachmentState | EditComposerAttachmentState | MessageAttachmentState;
type AttachmentSnapshotBinding<Source extends AttachmentRuntimeSource> = SubscribableWithState<AttachmentState & {
    source: Source;
}, AttachmentRuntimePath & {
    attachmentSource: Source;
}>;
type AttachmentRuntimeSource = AttachmentState["source"];
export type AttachmentRuntime<TSource extends AttachmentRuntimeSource = AttachmentRuntimeSource> = {
    readonly path: AttachmentRuntimePath & {
        attachmentSource: TSource;
    };
    readonly source: TSource;
    getState(): AttachmentState & {
        source: TSource;
    };
    remove(): Promise<void>;
    subscribe(callback: () => void): Unsubscribe;
};
export declare abstract class AttachmentRuntimeImpl<Source extends AttachmentRuntimeSource = AttachmentRuntimeSource> implements AttachmentRuntime {
    private _core;
    get path(): AttachmentRuntimePath & {
        attachmentSource: Source;
    };
    abstract get source(): Source;
    constructor(_core: AttachmentSnapshotBinding<Source>);
    protected __internal_bindMethods(): void;
    getState(): AttachmentState & {
        source: Source;
    };
    abstract remove(): Promise<void>;
    subscribe(callback: () => void): Unsubscribe;
}
declare abstract class ComposerAttachmentRuntime<Source extends "thread-composer" | "edit-composer"> extends AttachmentRuntimeImpl<Source> {
    private _composerApi;
    constructor(core: AttachmentSnapshotBinding<Source>, _composerApi: ComposerRuntimeCoreBinding);
    remove(): Promise<void>;
}
export declare class ThreadComposerAttachmentRuntimeImpl extends ComposerAttachmentRuntime<"thread-composer"> {
    get source(): "thread-composer";
}
export declare class EditComposerAttachmentRuntimeImpl extends ComposerAttachmentRuntime<"edit-composer"> {
    get source(): "edit-composer";
}
export declare class MessageAttachmentRuntimeImpl extends AttachmentRuntimeImpl<"message"> {
    get source(): "message";
    remove(): never;
}
export {};
//# sourceMappingURL=attachment-runtime.d.ts.map