export declare enum NetworkMessageType {
    Initial = "initial",
    RequestOpened = "request-opened",
    HeadersReceived = "headers-received",
    Progress = "progress",
    Error = "error",
    Done = "done"
}
export type BaseNetworkMessage = {
    type: NetworkMessageType;
};
export type InitialMessage = BaseNetworkMessage & {
    type: NetworkMessageType.Initial;
};
export type RequestOpenedMessage = BaseNetworkMessage & {
    type: NetworkMessageType.RequestOpened;
    openedTimestamp: number;
};
export declare function isRequestOpenedMessage(message: NetworkMessage): message is RequestOpenedMessage;
export type HeadersReceivedMessage = BaseNetworkMessage & {
    type: NetworkMessageType.HeadersReceived;
    headersReceivedTimestamp: number;
    contentLength: number;
};
export declare function isHeadersReceivedMessage(message: NetworkMessage): message is HeadersReceivedMessage;
export type ProgressMessage = BaseNetworkMessage & {
    type: NetworkMessageType.Progress;
    progressTimestamp: number;
    chunk: Uint8Array;
    loadedBytes: number;
    elapsedTime: number;
};
export declare function isProgressMessage(message: NetworkMessage): message is ProgressMessage;
export type ErrorMessage = BaseNetworkMessage & {
    type: NetworkMessageType.Error;
    error: Error;
};
export declare function isErrorMessage(message: NetworkMessage): message is ErrorMessage;
export type DoneMessage = BaseNetworkMessage & {
    type: NetworkMessageType.Done;
    doneTimestamp: number;
};
export declare function isDoneMessage(message: NetworkMessage): message is DoneMessage;
export type NetworkMessage = InitialMessage | RequestOpenedMessage | HeadersReceivedMessage | ProgressMessage | ErrorMessage | DoneMessage;
