export function update<Layout>(message: Message, state: API.State<Layout>): Update<Layout>;
export function init<Layout>(writer: API.BlockWriter, metadata: UnixFS.Metadata, config: API.EncoderSettings): API.State<Layout>;
export function write<Layout>(state: API.State<Layout>, bytes: Uint8Array): Update<Layout>;
export function link<Layout>(state: API.State<Layout>, { id, link, block }: API.EncodedFile): Update<Layout>;
export function close<Layout>(state: API.State<Layout>): Update<Layout>;
export function encodeBranch<Layout>(config: API.EncoderSettings<Layout>, { id, links }: Queue.LinkedNode, metadata?: Layout.Metadata | undefined): Task.Task<API.EncodedFile>;
export function writeBlock(writer: API.BlockWriter, block: UnixFS.Block): Task.Task<void, never>;
export type Open<Layout> = {
    readonly status: 'open';
    readonly metadata: UnixFS.Metadata;
    readonly config: API.EncoderSettings<Layout>;
    readonly writer: API.BlockWriter;
    chunker: Chunker.Chunker;
    layout: Layout;
    nodeQueue: Queue.Queue;
};
export type Closed<Layout> = {
    readonly status: 'closed';
    readonly metadata: UnixFS.Metadata;
    readonly config: API.EncoderSettings<Layout>;
    readonly writer: API.BlockWriter;
    readonly rootID: Layout.NodeID;
    readonly end?: Task.Fork<void, never>;
    chunker?: null;
    layout?: null;
    nodeQueue: Queue.Queue;
};
export type Linked<Layout> = {
    readonly status: 'linked';
    readonly metadata: UnixFS.Metadata;
    readonly config: API.EncoderSettings<Layout>;
    readonly writer: API.BlockWriter;
    readonly link: Layout.Link;
    chunker?: null;
    layout?: null;
    nodeQueue: Queue.Queue;
};
export type State<Layout> = Open<Layout> | Closed<Layout> | Linked<Layout>;
export type Update<Layout extends object> = {
    state: State<Layout>;
    effect: Task.Effect<Message>;
};
export type Message = never | {
    type: "write";
    bytes: Uint8Array;
} | {
    type: "link";
    link: API.EncodedFile;
} | {
    type: "block";
} | {
    type: "close";
} | {
    type: "end";
};
import * as API from "./api.js";
import * as UnixFS from "../codec.js";
import * as Queue from "./layout/queue.js";
import * as Layout from "./layout/api.js";
import * as Task from "actor";
import * as Chunker from "./chunker.js";
//# sourceMappingURL=writer.d.ts.map