import * as axios from 'axios';
import { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
import { ZodError, z } from 'zod';
import { Chunk as Chunk$1, ChunkedFile, ChunkAddress } from '@fairdatasociety/bmt-js';
export { makeChunkedFile } from '@fairdatasociety/bmt-js';
import { FFmpeg } from '@ffmpeg/ffmpeg';
import * as _noble_secp256k1 from '@noble/secp256k1';
import { Message } from 'js-sha3';

type HexString<Length = number> = string & {
    readonly length: Length;
};
interface Bytes$1<Length extends number> extends Uint8Array {
    readonly length: Length;
}

type EthAddress = `0x${string}`;
type EnsAddress = `${string}.eth`;

type BeeChain = {
    name: "custom" | "gnosis" | "sepolia" | "goerli";
    blockTime: number;
};
declare const CHAIN_BLOCK_TIME: {
    readonly custom: 2;
    readonly gnosis: 5;
    readonly sepolia: 2;
    readonly goerli: 15;
};
/**
 * Add redundancy to the data being uploaded so that downloaders can download it with better UX.
 * 0 value is default and does not add any redundancy to the file.
 */
declare const RedundancyLevels: {
    readonly OFF: 0;
    readonly MEDIUM: 1;
    readonly STRONG: 2;
    readonly INSANE: 3;
    readonly PARANOID: 4;
};
/**
 * Specify the retrieve strategy on redundant data.
 * The possible values are NONE, DATA, PROX and RACE.
 * Strategy NONE means no prefetching takes place.
 * Strategy DATA means only data chunks are prefetched.
 * Strategy PROX means only chunks that are close to the node are prefetched.
 * Strategy RACE means all chunks are prefetched: n data chunks and k parity chunks. The first n chunks to arrive are used to reconstruct the file.
 * Multiple strategies can be used in a fallback cascade if the swarm redundancy fallback mode is set to true.
 * The default strategy is NONE, DATA, falling back to PROX, falling back to RACE
 */
declare const RedundancyStrategies: {
    readonly NONE: 0;
    readonly DATA: 1;
    readonly PROX: 2;
    readonly RACE: 3;
};
declare const ETHERNA_MAX_BATCH_DEPTH = 22;
declare const ETHERNA_WELCOME_BATCH_DEPTH = 20;
declare const ETHERNA_WELCOME_POSTAGE_LABEL: "default";
declare const EmptyAddress: EthAddress;
declare const EmptyReference: Reference;
declare const ZeroHashReference: BytesReference;
declare const MantarayRootPath = "/";
declare const MantarayWebsiteIndexDocumentPathKey = "website-index-document";
declare const MantarayWebsiteErrorDocumentPathKey = "website-error-document";
declare const MantarayEntryMetadataContentTypeKey = "Content-Type";
declare const MantarayEntryMetadataFilenameKey = "Filename";
declare const MantarayEntryMetadataFeedOwnerKey = "swarm-feed-owner";
declare const MantarayEntryMetadataFeedTopicKey = "swarm-feed-topic";
declare const MantarayEntryMetadataFeedTypeKey = "swarm-feed-type";
declare const MANIFEST_PREVIEW_PATH = "preview";
declare const MANIFEST_DETAILS_PATH = "details";
declare const SPAN_SIZE = 8;
declare const MAX_SPAN_LENGTH: number;
declare const SECTION_SIZE = 32;
declare const BRANCHES = 128;
declare const CHUNK_SIZE: number;
declare const MAX_CHUNK_PAYLOAD_SIZE = 4096;
declare const SEGMENT_SIZE = 32;
declare const SEGMENT_PAIR_SIZE: number;
declare const HASH_SIZE = 32;
declare const MIN_PAYLOAD_SIZE = 1;
declare const MAX_PAYLOAD_SIZE = 4096;
declare const CAC_SPAN_OFFSET = 0;
declare const CAC_PAYLOAD_OFFSET: number;
declare const IDENTIFIER_SIZE = 32;
declare const SIGNATURE_SIZE = 65;
declare const SOC_IDENTIFIER_OFFSET = 0;
declare const SOC_SIGNATURE_OFFSET: number;
declare const SOC_SPAN_OFFSET: number;
declare const SOC_PAYLOAD_OFFSET: number;
declare const ADDRESS_HEX_LENGTH = 64;
declare const PSS_TARGET_HEX_LENGTH_MAX = 6;
declare const PUBKEY_HEX_LENGTH = 66;
declare const BATCH_ID_HEX_LENGTH = 64;
declare const REFERENCE_HEX_LENGTH = 64;
declare const ENCRYPTED_REFERENCE_HEX_LENGTH = 128;
declare const REFERENCE_BYTES_LENGTH = 32;
declare const ENCRYPTED_REFERENCE_BYTES_LENGTH = 64;
declare const BUCKET_DEPTH = 16;
declare const STAMPS_DEPTH_MIN = 17;
declare const STAMPS_DEPTH_MAX = 41;
declare const TAGS_LIMIT_MIN = 1;
declare const TAGS_LIMIT_MAX = 1000;
declare const FEED_INDEX_HEX_LENGTH = 16;

type Index = number | Uint8Array | string;
type BatchId = HexString<typeof BATCH_ID_HEX_LENGTH>;
type BucketId = number;
type PostageBatchBucketsData = {
    depth: number;
    bucketDepth: number;
    bucketUpperBound: number;
    buckets: PostageBatchBucket[];
};
type PostageBatchBucket = {
    bucketID: number;
    collisions: number;
};
type Reference = HexString<typeof REFERENCE_HEX_LENGTH>;
type BeeAddress = Reference | `${Reference}/${string}`;
type BytesReference = Bytes$1<32 | 64>;
type PostageBatch = {
    batchID: BatchId;
    utilization: number;
    usable: boolean;
    label: string;
    depth: number;
    amount: string;
    bucketDepth: number;
    blockNumber: number;
    immutableFlag: boolean;
    /**
     * The time (in seconds) remaining until the batch expires;
     * -1 signals that the batch never expires;
     * 0 signals that the batch has already expired.
     */
    batchTTL: number;
    exists: boolean;
};
type Tag = {
    uid: number;
    startedAt: string;
    split: number;
    seen: number;
    stored: number;
    sent: number;
    synced: number;
};
type FeedUpdateHeaders = {
    /**
     * The current feed's index
     */
    feedIndex: string;
    /**
     * The feed's index for next update.
     * Only set for the latest update. If update is fetched using previous index, then this is an empty string.
     */
    feedIndexNext: string;
};

type BucketCollisions = Map<BucketId, number>;
declare class StampCalculator {
    bucketCollisions: Map<number, number>;
    dirtyCollisions: Map<number, number>;
    maxBucketCount: number;
    /** Whether the bucket calculator has been seeded with collisions */
    private _isFresh;
    constructor(collisionsMap?: Record<BucketId, number> | PostageBatchBucket[]);
    get minDepth(): number;
    get isFresh(): boolean;
    static getBucketId(reference: Reference): BucketId;
    /**
     * Merges two bucket calculators collisions
     *
     * @param bucket1 First bucket calculator
     * @param bucket2 Second bucket calculator
     * @returns A new bucket calculator with the merged collisions
     */
    static merge(bucket1: StampCalculator, bucket2: StampCalculator): StampCalculator;
    /**
     * Seeds the bucket with existing bucket collisions
     *
     * @param collisionsMap
     */
    seed(collisionsMap: Record<BucketId, number> | Map<number, number> | PostageBatchBucket[]): void;
    /**
     * Merges the current stamp calculator with another one
     *
     * @param collisionsMap
     */
    merge(calculator: StampCalculator): void;
    add(reference: Reference): void;
    remove(reference: Reference): void;
}

declare const ErrorCodes: readonly ["NOT_FOUND", "SERVER_ERROR", "BAD_REQUEST", "UNAUTHORIZED", "PERMISSION_DENIED", "DUPLICATE", "JWT_MISSING_OR_EXPIRED", "MISSING_FUNDS", "MISSING_BATCH_ID", "MISSING_REFERENCE", "MISSING_SIGNER", "MISSING_WALLET", "OUTDATED_WALLET", "LOCKED_WALLET", "BUCKET_FILLED", "ABORTED_BY_USER", "INVALID_ARGUMENT", "INVALID_API_KEY", "NOT_IMPLEMENTED", "UNSUPPORTED_OPERATION", "TIMEOUT", "VALIDATION_ERROR", "ENCODING_ERROR", "ENCRYPTION_ERROR", "DECRYPTION_ERROR"];
type ErrorCode = (typeof ErrorCodes)[number];
declare class EthernaSdkError extends Error {
    code: ErrorCode;
    error?: Error;
    axiosError?: AxiosError;
    zodError?: ZodError;
    constructor(code: ErrorCode, message: string, error?: Error | AxiosError | ZodError);
}
declare function getSdkError(err: unknown): EthernaSdkError;
declare function throwSdkError(err: unknown): never;

interface RequestOptions {
    timeout?: number;
    signal?: AbortSignal;
    headers?: Record<string, string>;
}

interface BaseClientOptions {
    apiPath?: string;
    accessToken?: string;
    accessTokenExpiresAt?: number;
    disableAccessTokenTimeout?: boolean;
}
declare class BaseClient {
    baseUrl: string;
    request: AxiosInstance;
    apiRequest: AxiosInstance;
    accessToken?: string;
    disableAccessTokenTimeout?: boolean;
    private _apiPath?;
    private accessTokenExpiresAt?;
    private pendingResolvers;
    /**
     * @param options Client options
     */
    constructor(baseUrl: string, options?: BaseClientOptions);
    get apiPath(): string | undefined;
    set apiPath(apiPath: string | undefined);
    get apiUrl(): string;
    updateAccessToken(accessToken: string | undefined, expiresAt?: number): void;
    prepareAxiosConfig(opts?: RequestOptions): AxiosRequestConfig;
    prepareFetchConfig(opts?: RequestOptions): RequestInit;
    fetchSwaggerUrls(): Promise<{
        url: string;
        name: string;
    }[] | null>;
    fetchApiPath(): Promise<string>;
    autoLoadApiPath(): Promise<void> | undefined;
    awaitAccessToken(): Promise<unknown>;
}

type FeedType = "sequence" | "epoch";
interface FeedInfo {
    topic: string;
    owner: string;
    type: FeedType;
}
interface ContentAddressedChunk {
    readonly data: Uint8Array;
    /** span bytes (8) */
    span(): Uint8Array;
    /** payload bytes (1-4096) */
    payload(): Uint8Array;
    address(): Uint8Array;
}
interface SingleOwnerChunk extends ContentAddressedChunk {
    identifier(): Uint8Array;
    signature(): Uint8Array;
    owner(): Uint8Array;
}
interface Data extends Uint8Array {
    /**
     * Converts the binary data using UTF-8 decoding into string.
     */
    text(): string;
    /**
     * Converts the binary data into hex-string.
     */
    hex(): HexString;
    /**
     * Converts the binary data into string which is then parsed into JSON.
     */
    json<T extends Record<string, unknown> | unknown[]>(): T;
}
type RedundancyStrategy = (typeof RedundancyStrategies)[keyof typeof RedundancyStrategies];
type RedundancyLevel = (typeof RedundancyLevels)[keyof typeof RedundancyLevels];
interface RequestUploadOptions extends RequestOptions {
    batchId: BatchId;
    /**
     * If set to true, an ACT will be created for the uploaded data.
     */
    act?: boolean;
    actHistoryAddress?: Reference | string;
    /**
     * Will pin the data locally in the Bee node as well.
     *
     * Locally pinned data is possible to reupload to network if it disappear.
     *
     * @see [Bee docs - Pinning](https://docs.ethswarm.org/docs/develop/access-the-swarm/pinning)
     * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
     */
    pin?: boolean;
    /**
     * Will encrypt the uploaded data and return longer hash which also includes the decryption key.
     *
     * @see [Bee docs - Store with Encryption](https://docs.ethswarm.org/docs/develop/access-the-swarm/store-with-encryption)
     * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
     * @see Reference
     */
    encrypt?: boolean;
    /**
     * Tags keep track of syncing the data with network. This option allows attach existing Tag UUID to the uploaded data.
     *
     * @see [Bee API reference - `POST /bzz`](https://docs.ethswarm.org/api/#tag/BZZ/paths/~1bzz/post)
     * @see [Bee docs - Syncing / Tags](https://docs.ethswarm.org/docs/develop/access-the-swarm/syncing)
     * @link Tag
     */
    tag?: number;
    /**
     * Determines if the uploaded data should be sent to the network immediately (eq. deferred=false) or in a deferred fashion (eq. deferred=true).
     *
     * With deferred style client uploads all the data to Bee node first and only then Bee node starts push the data to network itself. The progress of this upload can be tracked with tags.
     * With non-deferred style client uploads the data to Bee which immediately starts pushing the data to network. The request is only finished once all the data was pushed through the Bee node to the network.
     *
     * In future there will be move to the non-deferred style and even the support for deferred upload will be removed from Bee itself.
     *
     * @default true
     */
    deferred?: boolean;
    /** Upload progress, ranging 0 to 100 */
    onUploadProgress?(completion: number): void;
}
interface RequestDownloadOptions extends RequestOptions {
    /**
     * Specify the retrieve strategy on redundant data.
     */
    redundancyStrategy?: RedundancyStrategy;
    /**
     * Specify if the retrieve strategies (chunk prefetching on redundant data) are used in a fallback cascade. The default is true.
     */
    fallback?: boolean;
    /**
     * Specify the timeout for chunk retrieval. The default is 30 seconds.
     */
    timeoutMs?: number;
    actHistoryAddress?: Reference | string;
    actTimestamp?: string | number;
    gasLimit?: number;
    gasPrice?: number;
    /** Download progress, ranging 0 to 100 */
    onDownloadProgress?(completion: number): void;
}
interface FileUploadOptions extends RequestUploadOptions {
    size?: number;
    contentType?: string;
    filename?: string;
}
interface FileDownloadOptions extends RequestDownloadOptions {
    maxResponseSize?: number;
}
interface FeedUpdateOptions extends RequestOptions {
    index?: string;
    at?: Date;
}
interface FeedUploadOptions extends RequestUploadOptions {
    index?: string;
    at?: Date;
}
interface AuthenticationOptions extends RequestOptions {
    role?: "maintainer" | "creator" | "auditor" | "consumer";
    expiry?: number;
}
interface ReferenceResponse {
    reference: Reference;
}
interface EthernaGatewayCurrentUser {
    etherAddress: string;
    etherPreviousAddresses: string[];
    username: string;
}
interface EthernaGatewayCredit {
    isUnlimited: boolean;
    balance: number;
}
interface EthernaGatewayBatchPreview {
    batchId: BatchId;
    ownerNodeId: string;
}
interface EthernaGatewayBatch extends Omit<PostageBatch, "batchID"> {
    id: BatchId;
    amountPaid: number;
    normalisedBalance: number;
}
interface EthernaGatewayChainState {
    block: number;
    currentPrice: number;
    sourceNodeId: string;
    timeStamp: string;
    totalAmount: number;
}
interface EthernaGatewayPin {
    freePinningEndOfLife: string;
    isPinned: boolean;
    isPinningInProgress: boolean;
    isPinningRequired: boolean;
}
interface EthernaGatewayWelcomeStatus {
    isFreePostageBatchConsumed: boolean;
}

declare class Auth {
    private instance;
    private tokenExpiration;
    constructor(instance: BeeClient);
    get isAuthenticated(): boolean;
    /**
     * Authenticate with the Bee node
     *
     * @param username Bee node admin username (by default empty)
     * @param password Bee node admin password
     */
    authenticate(username: string, password: string, options?: AuthenticationOptions): Promise<string>;
    refreshToken(token: string, options?: AuthenticationOptions): Promise<string | null>;
}

declare class Bytes {
    private instance;
    constructor(instance: BeeClient);
    url(reference: string): string;
    download(hash: string, options?: RequestDownloadOptions): Promise<Data>;
    upload(data: Uint8Array, options: RequestUploadOptions): Promise<{
        reference: Reference;
        tagUid: any;
    }>;
}

declare class Bzz {
    private instance;
    constructor(instance: BeeClient);
    url(reference: string, path?: string): string;
    download(hash: string, options?: FileDownloadOptions): Promise<{
        data: Data;
        name: string | null;
        tagUid: number | undefined;
        contentType: string | undefined;
    }>;
    downloadPath(hash: string, path?: string, options?: FileDownloadOptions): Promise<{
        data: Data;
        name: string | null;
        tagUid: number | undefined;
        contentType: string | undefined;
    }>;
    upload(data: Uint8Array | File | string, options: FileUploadOptions): Promise<{
        reference: Reference;
        tagUid: any;
    }>;
    head(path: string, options?: FileDownloadOptions): Promise<{
        size: string | undefined;
        contentType: string | undefined;
    }>;
}

declare class ChainState {
    private instance;
    private lateBytePrice;
    constructor(instance: BeeClient);
    getCurrentPrice(options?: RequestOptions): Promise<string>;
}

declare class Chunk {
    private instance;
    constructor(instance: BeeClient);
    download(hash: string, options?: RequestOptions): Promise<Data>;
    upload(data: Uint8Array, options: RequestUploadOptions): Promise<{
        reference: Reference;
    }>;
    /**
     * Uploads multiple chunks in a single bulk request.
     *
     * The payload format for each chunk is:
     * [chunk_size (2 bytes, little-endian ushort)][chunk_data (span + payload)][chunk_hash (32 bytes)]
     *
     * The API returns a single reference in the response.
     * This is typically a root reference when uploading chunks that are part
     * of a larger structure (e.g., a chunked file).
     *
     * @param chunks Array of chunk data (each chunk should include span + payload)
     * @param options Upload options including required batchId
     * @returns Object containing the reference returned by the API
     */
    bulkUpload(chunks: Chunk$1[], options: RequestUploadOptions): Promise<{
        reference: Reference;
    }>;
}

declare class Feed {
    private instance;
    constructor(instance: BeeClient);
    makeFeed(topicName: string, owner: EthAddress, type?: FeedType): FeedInfo;
    makeFeedFromHex(topicHex: string, owner: EthAddress, type?: FeedType): FeedInfo;
    makeReader(feed: FeedInfo): {
        download(options?: FeedUpdateOptions): Promise<{
            reference: Reference;
        }>;
        topic: string;
        owner: string;
        type: FeedType;
    };
    makeWriter(feed: FeedInfo): {
        upload: (reference: string, options: FeedUploadOptions) => Promise<{
            reference: Reference;
            index: string;
        }>;
    };
    createRootManifest(feed: FeedInfo, options: FeedUploadOptions): Promise<Reference>;
    makeRootManifest(feed: FeedInfo): Promise<{
        reference: Reference;
        save: (options: RequestUploadOptions) => Promise<void>;
    }>;
    parseFeedFromRootManifest(reference: Reference, opts?: RequestOptions): Promise<FeedInfo>;
    fetchLatestFeedUpdate(feed: FeedInfo): Promise<{
        feedIndex: string;
        feedIndexNext: string;
        reference: Reference;
    }>;
    findNextIndex(feed: FeedInfo): Promise<string>;
    private readFeedUpdateHeaders;
    private makeFeedIdentifier;
    private hashFeedIdentifier;
    private makeSequentialFeedIdentifier;
    private makeFeedIndexBytes;
}

declare class Offers {
    private instance;
    constructor(instance: BeeClient);
    /**
     * Get all resource offers
     *
     * @param reference Hash of the resource
     * @param opts Request options
     * @returns Addresses of users that are offering the resource
     */
    downloadOffers(reference: Reference, opts?: RequestOptions): Promise<`0x${string}`[]>;
    /**
     * Get current user's offered resources
     *
     * @returns Reference list of offered resources
     */
    downloadOfferedResources(opts?: RequestOptions): Promise<Reference[]>;
    /**
     * Check if multiple resources are offered
     *
     * @param references Hashes of the resources
     * @param opts Request options
     * @returns Addresses of users that are offering the resource
     */
    batchAreOffered(references: Reference[], opts?: RequestOptions): Promise<Record<Reference, boolean>>;
    /**
     * Offer a resource
     *
     * @param reference Hash of the resource
     * @param opts Request options
     * @returns True if successfull
     */
    offer(reference: Reference, opts?: RequestOptions): Promise<boolean>;
    /**
     * Cancel a resource offer
     *
     * @param reference Hash of the resource
     * @param opts Request options
     * @returns True if successfull
     */
    cancelOffer(reference: Reference, opts?: RequestOptions): Promise<boolean>;
}

declare class Pins {
    private instance;
    constructor(instance: BeeClient);
    isPinned(reference: string, options?: RequestOptions): Promise<boolean>;
    download(options?: RequestOptions): Promise<{
        references: Reference[];
    }>;
    pin(reference: string, options?: RequestOptions): Promise<axios.AxiosResponse<any, any, {}>>;
    unpin(reference: string, options?: RequestOptions): Promise<axios.AxiosResponse<any, any, {}>>;
    /**
     * Check if pinning is enabled on the current host
     *
     * @returns True if pinning is enabled
     */
    pinEnabled(): Promise<boolean>;
}

declare class Soc {
    private instance;
    constructor(instance: BeeClient);
    download(identifier: Uint8Array, ownerAddress: EthAddress, options?: RequestOptions): Promise<SingleOwnerChunk>;
    upload(identifier: Uint8Array, data: Uint8Array, options: RequestUploadOptions): Promise<{
        reference: Reference;
    }>;
    /**
     * Creates a single owner chunk object
     *
     * @param chunk       A chunk object used for the span and payload
     * @param identifier  The identifier of the chunk
     */
    makeSingleOwnerChunk(chunk: ContentAddressedChunk, identifier: Uint8Array): Promise<SingleOwnerChunk>;
    private makeSOCAddress;
    private makeSingleOwnerChunkFromData;
    private recoverChunkOwner;
}

interface CreatePostageBatchOptions extends RequestOptions {
    label?: string;
    useWelcomeIfPossible?: boolean;
    onStatusChange?: <T extends "pending-creation" | "created">(status: T, data: T extends "pending-creation" ? {
        postageBatchRef: string | null;
    } : T extends "created" ? {
        batchId: BatchId;
    } : never) => void;
}
interface DownloadPostageBatchOptions extends RequestOptions {
    waitUntilUsable?: boolean;
    waitUntil?: (batch: PostageBatch) => boolean;
}
interface FetchBestBatchIdOptions extends RequestOptions {
    labelQuery?: string;
    minDepth?: number;
    collisions?: BucketCollisions;
}
interface TopupBatchOptions extends RequestOptions {
    by: {
        type: "amount";
        amount: bigint | string;
    } | {
        type: "time";
        seconds: number;
    };
    initialAmount?: bigint | string;
    waitUntilUpdated?: boolean;
}
interface DiluteBatchOptions extends RequestOptions {
    depth: number;
    waitUntilUpdated?: boolean;
}
interface ExpandBatchOptions extends DiluteBatchOptions {
    ttl?: number;
}
declare class Stamps {
    private instance;
    constructor(instance: BeeClient);
    create(depth: number, amount: bigint | string, options?: CreatePostageBatchOptions): Promise<PostageBatch>;
    create(depth: number, ttl: number, options?: CreatePostageBatchOptions): Promise<PostageBatch>;
    download(batchId: BatchId, options?: DownloadPostageBatchOptions): Promise<PostageBatch>;
    downloadAll(labelQuery?: string, options?: RequestOptions): Promise<(PostageBatch | EthernaGatewayBatchPreview)[]>;
    downloadBuckets(batchId: BatchId, options?: RequestOptions): Promise<PostageBatchBucketsData>;
    /**
     * Find best usable batch to use.
     * Use the option:
     * - `minDepth` to filter batches with a minimum depth
     * - `labelQuery` to filter batches by label
     * - `stampCalculator` to provide the bucket collision to upload (best to find the batch with most buckets available)
     *
     * @param options
     * @returns The best batch to use or null if no batch is found
     */
    fetchBestBatch(options?: FetchBestBatchIdOptions): Promise<(PostageBatch & {
        collisions?: BucketCollisions;
    }) | null>;
    /**
     * Find best usable batchId to use.
     * Use the option:
     * - `minDepth` to filter batches with a minimum depth
     * - `labelQuery` to filter batches by label
     * - `stampCalculator` to provide the bucket collision to upload (best to find the batch with most buckets available)
     *
     * @param options
     * @returns The best batchId to use or null if no batch is found
     */
    fetchBestBatchId(options?: FetchBestBatchIdOptions): Promise<(BatchId & {
        collisions?: BucketCollisions;
    }) | null>;
    /**
     * Topup batch (increase TTL)
     *
     * @param batchId Id of the swarm batch
     * @param byAmount Amount to add to the batch
     */
    topup(batchId: BatchId, options: TopupBatchOptions): Promise<PostageBatch>;
    /**
     * Dillute batch (increase size)
     *
     * @param batchId Id of the swarm batch
     * @param options Dilute options
     */
    dilute(batchId: BatchId, options: DiluteBatchOptions): Promise<PostageBatch>;
    /**
     * (unofficial api) - Dilute a batch + Auto topup to keep the same TTL
     *
     * @param batchId Id of batch to extend
     * @param options Dilute options
     */
    expand(batchId: BatchId, options: ExpandBatchOptions): Promise<PostageBatch>;
    isWelcomeConsumed(opts?: RequestOptions): Promise<boolean>;
    private createWelcomeBatch;
    private waitBatchValid;
    private fetchIsFillableBatch;
}

declare class System {
    private instance;
    constructor(instance: BeeClient);
    /**
     * Get the current byte price
     *
     * @param opts Request options
     * @returns Dollar price per single byte
     */
    fetchCurrentBytePrice(opts?: RequestOptions): Promise<string>;
    /**
     * Fetch creation batch id
     *
     * @param referenceId Reference id of the batch
     * @returns The created batch id if completed
     */
    fetchPostageBatchRef(referenceId: string, opts?: RequestOptions): Promise<BatchId | null>;
}

declare class Tags {
    private instance;
    constructor(instance: BeeClient);
    downloadAll(offset?: number, limit?: number, options?: RequestOptions): Promise<{
        tags: Tag[];
    }>;
    download(uid: number, options?: RequestOptions): Promise<Tag>;
    create(address: string, options?: RequestOptions): Promise<Tag>;
    delete(uid: number, options?: RequestOptions): Promise<axios.AxiosResponse<any, any, {}>>;
}

declare class User {
    private instance;
    constructor(instance: BeeClient);
    /**
     * Get the current logged user's info
     * @returns Gateway current user
     */
    downloadCurrentUser(opts?: RequestOptions): Promise<EthernaGatewayCurrentUser>;
}

type SyncSigner = (digest: string | Uint8Array) => string;
type AsyncSigner = (digest: string | Uint8Array) => Promise<string>;
type Signer = {
    sign: SyncSigner | AsyncSigner;
    address: EthAddress;
};

interface BeeClientOptions extends BaseClientOptions {
    type?: "bee" | "etherna";
    signer?: Signer | string;
    chain?: BeeChain;
}
declare class BeeClient extends BaseClient {
    url: string;
    signer?: Signer;
    type: "bee" | "etherna";
    chain: BeeChain;
    auth: Auth;
    bytes: Bytes;
    bzz: Bzz;
    chainstate: ChainState;
    chunk: Chunk;
    feed: Feed;
    pins: Pins;
    soc: Soc;
    stamps: Stamps;
    tags: Tags;
    offers: Offers;
    user: User;
    system: System;
    constructor(url: string, opts?: BeeClientOptions);
    updateSigner(signer: Signer | EthAddress | string | undefined): void;
}

interface CreditLog {
    amount: number;
    author: string;
    creationDateTime: string;
    isApplied: boolean | null;
    operationName: string;
    reason: string | null;
    userAddress: EthAddress;
}
interface CreditBalance {
    balance: number;
    isUnlimited: boolean;
}

declare class CreditUser {
    private instance;
    constructor(instance: EthernaCreditClient);
    /**
     * Get current credit balance
     */
    fetchBalance(opts?: RequestOptions): Promise<CreditBalance>;
    /**
     * Get current user logs
     */
    fetchLogs(page?: number, take?: number, opts?: RequestOptions): Promise<CreditLog[]>;
}

interface CreditClientOptions extends BaseClientOptions {
}
declare class EthernaCreditClient extends BaseClient {
    user: CreditUser;
    /**
     * Init a credit client
     * @param options Client options
     */
    constructor(baseUrl: string, options?: CreditClientOptions);
}

declare const ImageSizeSchema: z.ZodCustom<`${number}w`, `${number}w`>;
declare const ImageTypeSchema: z.ZodDefault<z.ZodEnum<{
    jpeg: "jpeg";
    png: "png";
    webp: "webp";
    avif: "avif";
    "jpeg-xl": "jpeg-xl";
}>>;
declare const ImageLegacySourcesSchema: z.ZodPipe<z.ZodRecord<z.ZodCustom<`${number}w`, `${number}w`>, z.ZodString>, z.ZodTransform<({
    width: number;
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
    path?: string | undefined;
    reference?: Reference | undefined;
} & {
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
})[], Record<`${number}w`, string>>>;
declare const ImageSourceBaseSchema: z.ZodObject<{
    width: z.ZodNumber;
    type: z.ZodNullable<z.ZodDefault<z.ZodEnum<{
        jpeg: "jpeg";
        png: "png";
        webp: "webp";
        avif: "avif";
        "jpeg-xl": "jpeg-xl";
    }>>>;
    path: z.ZodOptional<z.ZodString>;
    reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
}, z.core.$strip>;
declare const ImageSourceSchema: z.ZodPipe<z.ZodObject<{
    width: z.ZodNumber;
    type: z.ZodNullable<z.ZodDefault<z.ZodEnum<{
        jpeg: "jpeg";
        png: "png";
        webp: "webp";
        avif: "avif";
        "jpeg-xl": "jpeg-xl";
    }>>>;
    path: z.ZodOptional<z.ZodString>;
    reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
}, z.core.$strip>, z.ZodTransform<{
    width: number;
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
    path?: string | undefined;
    reference?: Reference | undefined;
} & {
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
}, {
    width: number;
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
    path?: string | undefined;
    reference?: Reference | undefined;
}>>;
declare const ImageSourcesSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
    width: z.ZodNumber;
    type: z.ZodNullable<z.ZodDefault<z.ZodEnum<{
        jpeg: "jpeg";
        png: "png";
        webp: "webp";
        avif: "avif";
        "jpeg-xl": "jpeg-xl";
    }>>>;
    path: z.ZodOptional<z.ZodString>;
    reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
}, z.core.$strip>, z.ZodTransform<{
    width: number;
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
    path?: string | undefined;
    reference?: Reference | undefined;
} & {
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
}, {
    width: number;
    type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
    path?: string | undefined;
    reference?: Reference | undefined;
}>>>;
declare const ImageSchema: z.ZodObject<{
    aspectRatio: z.ZodNumber;
    blurhash: z.ZodString;
    sources: z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodObject<{
        width: z.ZodNumber;
        type: z.ZodNullable<z.ZodDefault<z.ZodEnum<{
            jpeg: "jpeg";
            png: "png";
            webp: "webp";
            avif: "avif";
            "jpeg-xl": "jpeg-xl";
        }>>>;
        path: z.ZodOptional<z.ZodString>;
        reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
    }, z.core.$strip>, z.ZodTransform<{
        width: number;
        type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
        path?: string | undefined;
        reference?: Reference | undefined;
    } & {
        type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
    }, {
        width: number;
        type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
        path?: string | undefined;
        reference?: Reference | undefined;
    }>>>, z.ZodPipe<z.ZodRecord<z.ZodCustom<`${number}w`, `${number}w`>, z.ZodString>, z.ZodTransform<({
        width: number;
        type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
        path?: string | undefined;
        reference?: Reference | undefined;
    } & {
        type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
    })[], Record<`${number}w`, string>>>]>;
}, z.core.$strip>;
type ImageSize = z.infer<typeof ImageSizeSchema>;
type ImageType = z.infer<typeof ImageTypeSchema>;
type ImageSource = z.infer<typeof ImageSourceSchema>;
type ImageLegacySources = z.infer<typeof ImageLegacySourcesSchema>;
type ImageSources = z.infer<typeof ImageSourcesSchema>;
type Image = z.infer<typeof ImageSchema>;

declare const MantarayNodeSchema: z.ZodSchema<ReadableMantarayNode>;
declare const MantarayForkSchema: z.ZodObject<{
    prefix: z.ZodString;
    node: z.ZodType<ReadableMantarayNode, unknown, z.core.$ZodTypeInternals<ReadableMantarayNode, unknown>>;
}, z.core.$strip>;
type ReadableMantarayNode = {
    type?: number;
    entry?: string;
    contentAddress?: string;
    metadata?: Record<string, string>;
    forks: Record<string, MantarayNodeFork>;
};
type MantarayNodeFork = z.infer<typeof MantarayForkSchema>;

declare const PlaylistTypeEncryptedSchema: z.ZodEnum<{
    private: "private";
    protected: "protected";
}>;
declare const PlaylistTypeVisibleSchema: z.ZodLiteral<"public">;
declare const PlaylistTypeSchema: z.ZodUnion<readonly [z.ZodEnum<{
    private: "private";
    protected: "protected";
}>, z.ZodLiteral<"public">]>;
declare const PlaylistThumbSchema: z.ZodObject<{
    blurhash: z.ZodString;
    path: z.ZodString;
}, z.core.$strip>;
declare const PlaylistVideoSchema: z.ZodObject<{
    r: z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>;
    t: z.ZodString;
    a: z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
    p: z.ZodOptional<z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>;
}, z.core.$strip>;
declare const PlaylistPreviewSchema: z.ZodObject<{
    id: z.ZodString;
    type: z.ZodUnion<readonly [z.ZodEnum<{
        private: "private";
        protected: "protected";
    }>, z.ZodLiteral<"public">]>;
    passwordHint: z.ZodOptional<z.ZodString>;
    name: z.ZodString;
    owner: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
    thumb: z.ZodNullable<z.ZodObject<{
        blurhash: z.ZodString;
        path: z.ZodString;
    }, z.core.$strip>>;
    createdAt: z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
    updatedAt: z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
}, z.core.$strip>;
declare const PlaylistDetailsSchema: z.ZodObject<{
    name: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodString>;
    videos: z.ZodArray<z.ZodObject<{
        r: z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>;
        t: z.ZodString;
        a: z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
        p: z.ZodOptional<z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type PlaylistType = z.infer<typeof PlaylistTypeSchema>;
type PlaylistThumb = z.infer<typeof PlaylistThumbSchema>;
type PlaylistVideo = z.infer<typeof PlaylistVideoSchema>;
type PlaylistPreview = z.infer<typeof PlaylistPreviewSchema>;
type PlaylistDetails = z.infer<typeof PlaylistDetailsSchema>;

declare const UserPlaylistsSchema: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
type UserPlaylists = z.infer<typeof UserPlaylistsSchema>;

/**
 * / --> preview
 * /preview
 * /details
 * /avatar/
 *   /480-png
 *   /1280-png
 *   /480-avif
 *   /1280-avif
 * /cover/
 *   /480-png
 *   /1280-png
 *   /480-avif
 *   /1280-avif
 */
declare const ProfilePreviewSchema: z.ZodObject<{
    address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
    name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
    avatar: z.ZodNullable<z.ZodObject<{
        aspectRatio: z.ZodNumber;
        blurhash: z.ZodString;
        sources: z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodObject<{
            width: z.ZodNumber;
            type: z.ZodNullable<z.ZodDefault<z.ZodEnum<{
                jpeg: "jpeg";
                png: "png";
                webp: "webp";
                avif: "avif";
                "jpeg-xl": "jpeg-xl";
            }>>>;
            path: z.ZodOptional<z.ZodString>;
            reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
        }, z.core.$strip>, z.ZodTransform<{
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        }, {
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        }>>>, z.ZodPipe<z.ZodRecord<z.ZodCustom<`${number}w`, `${number}w`>, z.ZodString>, z.ZodTransform<({
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        })[], Record<`${number}w`, string>>>]>;
    }, z.core.$strip>>;
}, z.core.$strip>;
declare const ProfileDetailsSchema: z.ZodObject<{
    description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    cover: z.ZodNullable<z.ZodObject<{
        aspectRatio: z.ZodNumber;
        blurhash: z.ZodString;
        sources: z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodObject<{
            width: z.ZodNumber;
            type: z.ZodNullable<z.ZodDefault<z.ZodEnum<{
                jpeg: "jpeg";
                png: "png";
                webp: "webp";
                avif: "avif";
                "jpeg-xl": "jpeg-xl";
            }>>>;
            path: z.ZodOptional<z.ZodString>;
            reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
        }, z.core.$strip>, z.ZodTransform<{
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        }, {
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        }>>>, z.ZodPipe<z.ZodRecord<z.ZodCustom<`${number}w`, `${number}w`>, z.ZodString>, z.ZodTransform<({
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        })[], Record<`${number}w`, string>>>]>;
    }, z.core.$strip>>;
    location: z.ZodOptional<z.ZodString>;
    website: z.ZodOptional<z.ZodString>;
    birthday: z.ZodOptional<z.ZodString>;
    playlists: z.ZodCatch<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>>;
}, z.core.$strip>;
type ProfilePreview = z.infer<typeof ProfilePreviewSchema>;
type ProfileDetails = z.infer<typeof ProfileDetailsSchema>;

declare const quality: z.ZodCustom<`${number}p`, `${number}p`>;
/**
 * / --> preview
 * /preview
 * /details
 * /thumb/
 *   /480-png
 *   /1280-png
 *   /480-avif
 *   /1280-avif
 * /sources/
 *   /720p
 *   /1080p
 *   /dash/
 *     /manifest.mpd
 *     /...
 */
declare const VideoSourceSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
    type: z.ZodOptional<z.ZodLiteral<"mp4">>;
    quality: z.ZodCustom<`${number}p`, `${number}p`>;
    path: z.ZodOptional<z.ZodString>;
    reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
    size: z.ZodNumber;
    bitrate: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>, z.ZodObject<{
    type: z.ZodEnum<{
        dash: "dash";
        hls: "hls";
    }>;
    path: z.ZodString;
    size: z.ZodNumber;
}, z.core.$strip>]>, z.ZodTransform<{
    quality: `${number}p`;
    size: number;
    type?: "mp4" | undefined;
    path?: string | undefined;
    reference?: Reference | undefined;
    bitrate?: number | undefined;
} | {
    type: "dash" | "hls";
    path: string;
    size: number;
}, {
    quality: `${number}p`;
    size: number;
    type?: "mp4" | undefined;
    path?: string | undefined;
    reference?: Reference | undefined;
    bitrate?: number | undefined;
} | {
    type: "dash" | "hls";
    path: string;
    size: number;
}>>;
declare const VideoPreviewSchema: z.ZodObject<{
    v: z.ZodOptional<z.ZodEnum<{
        "1.0": "1.0";
        1.1: "1.1";
        1.2: "1.2";
        "2.0": "2.0";
        2.1: "2.1";
    }>>;
    title: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
    createdAt: z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
    updatedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>>;
    ownerAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
    duration: z.ZodNumber;
    thumbnail: z.ZodNullable<z.ZodObject<{
        aspectRatio: z.ZodNumber;
        blurhash: z.ZodString;
        sources: z.ZodUnion<[z.ZodArray<z.ZodPipe<z.ZodObject<{
            width: z.ZodNumber;
            type: z.ZodNullable<z.ZodDefault<z.ZodEnum<{
                jpeg: "jpeg";
                png: "png";
                webp: "webp";
                avif: "avif";
                "jpeg-xl": "jpeg-xl";
            }>>>;
            path: z.ZodOptional<z.ZodString>;
            reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
        }, z.core.$strip>, z.ZodTransform<{
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        }, {
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        }>>>, z.ZodPipe<z.ZodRecord<z.ZodCustom<`${number}w`, `${number}w`>, z.ZodString>, z.ZodTransform<({
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        })[], Record<`${number}w`, string>>>]>;
    }, z.core.$strip>>;
}, z.core.$strip>;
declare const VideoCaptionSchema: z.ZodObject<{
    label: z.ZodString;
    lang: z.ZodString;
    path: z.ZodString;
}, z.core.$strip>;
declare const VideoDetailsSchema: z.ZodObject<{
    description: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
    aspectRatio: z.ZodNumber;
    sources: z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
        type: z.ZodOptional<z.ZodLiteral<"mp4">>;
        quality: z.ZodCustom<`${number}p`, `${number}p`>;
        path: z.ZodOptional<z.ZodString>;
        reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>;
        size: z.ZodNumber;
        bitrate: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>, z.ZodObject<{
        type: z.ZodEnum<{
            dash: "dash";
            hls: "hls";
        }>;
        path: z.ZodString;
        size: z.ZodNumber;
    }, z.core.$strip>]>, z.ZodTransform<{
        quality: `${number}p`;
        size: number;
        type?: "mp4" | undefined;
        path?: string | undefined;
        reference?: Reference | undefined;
        bitrate?: number | undefined;
    } | {
        type: "dash" | "hls";
        path: string;
        size: number;
    }, {
        quality: `${number}p`;
        size: number;
        type?: "mp4" | undefined;
        path?: string | undefined;
        reference?: Reference | undefined;
        bitrate?: number | undefined;
    } | {
        type: "dash" | "hls";
        path: string;
        size: number;
    }>>>;
    captions: z.ZodDefault<z.ZodArray<z.ZodObject<{
        label: z.ZodString;
        lang: z.ZodString;
        path: z.ZodString;
    }, z.core.$strip>>>;
    batchId: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>>>;
    personalData: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type VideoQuality = z.infer<typeof quality>;
type VideoSource = z.infer<typeof VideoSourceSchema>;
type VideoPreview = z.infer<typeof VideoPreviewSchema>;
type VideoDetails = z.infer<typeof VideoDetailsSchema>;
type VideoCaption = z.infer<typeof VideoCaptionSchema>;

declare const SchemaVersionSchema: z.ZodLiteral<`${string}.${string}`>;
declare const BirthdaySchema: z.ZodString;
declare const SlicedStringSchema: (max: number, min?: number) => z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
declare const EthAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
declare const EnsAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}.eth`, string>>;
declare const EthSafeAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
declare const BeeReferenceSchema: z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>;
declare const BeeSafeReferenceSchema: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<Reference, string | null>>;
declare const BeeAddressSchema: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Reference, string>>, z.ZodTemplateLiteral<`${string}/${string}`>]>;
declare const BatchIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<BatchId, string>>;
declare const NonEmptyRecordSchema: <Keys extends z.core.$ZodRecordKey, Values extends z.core.$ZodType>(key: Keys, value: Values) => z.ZodRecord<Keys, Values>;
declare const TimestampSchema: z.ZodUnion<[z.ZodPipe<z.ZodNumber, z.ZodTransform<number, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
type SchemaVersion = z.infer<typeof SchemaVersionSchema>;

interface PaginatedResult<T> {
    elements: T[];
    currentPage: number;
    maxPage: number;
    pageSize: number;
    totalElements: number;
}
interface IndexUser {
    address: EthAddress;
    creationDateTime: string;
    identityManifest: string;
}
interface IndexCurrentUser {
    address: EthAddress;
    isSuperModerator: boolean;
}
interface IndexUserVideos extends IndexUser {
    videos: IndexVideo[];
}
interface IndexVideo {
    id: string;
    creationDateTime: string;
    ownerAddress: EthAddress;
    lastValidManifest: IndexVideoManifest | null;
    currentVoteValue: VoteValue | null;
    totDownvotes: number;
    totUpvotes: number;
}
interface IndexVideoPreview {
    id: string;
    title: string;
    hash: Reference;
    duration: number;
    ownerAddress: EthAddress;
    thumbnail: Image | null;
    createdAt: number;
    updatedAt: number;
    indexUrl: string;
}
interface IndexVideoManifest extends Omit<IndexVideoPreview, "id"> {
    batchId: BatchId | null;
    aspectRatio: number | null;
    hash: Reference;
    description: string | null;
    originalQuality: VideoQuality | null;
    personalData: string | null;
    sources: VideoSource[];
    captions?: VideoCaption[];
}
interface IndexVideoCreation {
    id: string;
    creationDateTime: string;
    encryptionKey: string | null;
    encryptionType: IndexEncryptionType;
    manifestHash: string;
}
interface IndexVideoValidation {
    errorDetails: Array<{
        errorMessage: string;
        errorNumber: string | number;
    }>;
    hash: string;
    isValid: boolean | null;
    validationTime: string;
    videoId: string | null;
}
interface IndexVideoComment {
    id: string;
    isFrozen: boolean;
    isEditable: boolean;
    ownerAddress: EthAddress;
    textHistory: Record<string, string>;
    videoId: string;
}
type VoteValue = "Up" | "Down" | "Neutral";
type IndexEncryptionType = "AES256" | "Plain";
interface IndexParameters {
    commentMaxLength: number;
    videoDescriptionMaxLength: number;
    videoTitleMaxLength: number;
}

interface IIndexCommentsInterface {
    editComment(id: string, newText: string, opts?: RequestOptions): Promise<IndexVideoComment>;
    deleteComment(id: string, opts?: RequestOptions): Promise<boolean>;
}
declare class IndexComments implements IIndexCommentsInterface {
    private instance;
    constructor(instance: EthernaIndexClient);
    /**
     * Edit own comment
     * @param id Id of the comment
     * @param newText New text of the comment
     * @param opts Request options
     */
    editComment(id: string, newText: string, opts?: RequestOptions): Promise<IndexVideoComment>;
    /**
     * Delete own comment
     * @param id Id of the comment
     * @param opts Request options
     */
    deleteComment(id: string, opts?: RequestOptions): Promise<boolean>;
}

interface IIndexModerationInterface {
    deleteComment(id: string, opts?: RequestOptions): Promise<boolean>;
    deleteVideo(id: string, opts?: RequestOptions): Promise<boolean>;
}
declare class IndexModeration implements IIndexModerationInterface {
    private instance;
    constructor(instance: EthernaIndexClient);
    /**
     * Delete any comment
     * @param id Id of the comment
     * @param opts Request options
     */
    deleteComment(id: string, opts?: RequestOptions): Promise<boolean>;
    /**
     * Delete any video
     * @param id Id of the video
     * @param opts Request options
     */
    deleteVideo(id: string, opts?: RequestOptions): Promise<boolean>;
}

interface IIndexSearchInterface {
    fetchVideos(query: string, page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideoPreview>>;
}
declare class IndexSearch implements IIndexSearchInterface {
    private instance;
    constructor(instance: EthernaIndexClient);
    /**
     * Search videos
     * @param query Search query
     * @param page Page offset (default = 0)
     * @param take Count of users to get (default = 25)
     * @param opts Request options
     */
    fetchVideos(query: string, page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideoPreview>>;
}

interface IIndexSystemInterface {
    fetchParameters(opts?: RequestOptions): Promise<IndexParameters>;
}
declare class IndexSystem implements IIndexSystemInterface {
    private instance;
    constructor(instance: EthernaIndexClient);
    /**
     * Get a list of parameters and max charater lenghts
     * @param opts Request options
     */
    fetchParameters(opts?: RequestOptions): Promise<IndexParameters>;
}

interface IIndexUsersInterface {
    fetchUsers(page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexUser>>;
    fetchUser(address: string, opts?: RequestOptions): Promise<IndexUser>;
    fetchVideos(address: string, page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideo>>;
    fetchCurrentUser(opts?: RequestOptions): Promise<IndexCurrentUser>;
}
declare class IndexUsers implements IIndexUsersInterface {
    private instance;
    constructor(instance: EthernaIndexClient);
    /**
     * Get a list of recent users
     * @param page Page offset (default = 0)
     * @param take Count of users to get (default = 25)
     * @param opts Request options
     */
    fetchUsers(page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexUser>>;
    /**
     * Get a user info
     * @param address User's address
     * @param opts Request options
     */
    fetchUser(address: string, opts?: RequestOptions): Promise<IndexUser>;
    /**
     * Fetch user's videos
     * @param address User's address
     * @param page Page offset (default = 0)
     * @param take Count of users to get (default = 25)
     * @param opts Request options
     */
    fetchVideos(address: string, page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideo>>;
    /**
     * Get the current logged user's info
     * @param opts Request options
     */
    fetchCurrentUser(opts?: RequestOptions): Promise<IndexCurrentUser>;
}

interface IIndexVideosInterface {
    createVideo(hash: string, opts?: RequestOptions & {
        encryptionKey?: string;
    }): Promise<string>;
    fetchVideoFromId(id: string, opts?: RequestOptions): Promise<IndexVideo>;
    fetchVideoFromHash(hash: string, opts?: RequestOptions): Promise<IndexVideo>;
    fetchLatestVideos(page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideoPreview>>;
    fetchValidations(id: string, opts?: RequestOptions): Promise<IndexVideoValidation[]>;
    fetchHashValidation(hash: string, opts?: RequestOptions): Promise<IndexVideoValidation>;
    fetchBulkValidationById(ids: string[], opts?: RequestOptions): Promise<IndexVideoValidation[]>;
    fetchBulkValidationByHash(hashes: string[], opts?: RequestOptions): Promise<IndexVideoValidation[]>;
    updateVideo(id: string, newHash: string, opts?: RequestOptions): Promise<IndexVideoManifest>;
    deleteVideo(id: string, opts?: RequestOptions): Promise<boolean>;
    fetchComments(id: string, page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideoComment>>;
    postComment(id: string, message: string, opts?: RequestOptions): Promise<IndexVideoComment>;
    vote(id: string, vote: VoteValue, opts?: RequestOptions): Promise<IndexVideoComment>;
    reportVideo(id: string, manifestReference: string, code: string, opts?: RequestOptions): Promise<void>;
}
declare class IndexVideos implements IIndexVideosInterface {
    private instance;
    abortController?: AbortController;
    constructor(instance: EthernaIndexClient);
    /**
     * Create a new video on the index
     *
     * @param hash Hash of the manifest/feed with the video metadata
     * @param encryptionKey Encryption key
     * @param opts Request options
     * @returns Video id
     */
    createVideo(hash: string, opts?: RequestOptions & {
        encryptionKey?: string;
    }): Promise<string>;
    /**
     * Get video information by id
     *
     * @param id Video id on Index
     * @param opts Request options
     * @returns The video object
     */
    fetchVideoFromId(id: string, opts?: RequestOptions): Promise<IndexVideo>;
    /**
     * Get video information
     *
     * @param hash Video hash on Swarm
     * @param opts Request options
     * @returns Video information
     */
    fetchVideoFromHash(hash: string, opts?: RequestOptions): Promise<IndexVideo>;
    /**
     * Get a list of recent videos uploaded on the platform
     *
     * @param page Page offset (default = 0)
     * @param take Number of videos to fetch (default = 25)
     * @param opts Request options
     * @returns The list of videos
     */
    fetchLatestVideos(page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideoPreview>>;
    /**
     * Get video validations list
     *
     * @param id Video id on Index
     * @param opts Request options
     * @returns List of validations
     */
    fetchValidations(id: string, opts?: RequestOptions): Promise<IndexVideoValidation[]>;
    /**
     * Get video hash validation status
     *
     * @param hash Video hash on Swarm
     * @param opts Request options
     * @returns Validation status
     */
    fetchHashValidation(hash: string, opts?: RequestOptions): Promise<IndexVideoValidation>;
    /**
     * Get videos validation status
     *
     * @param hashes Video hash on Swarm
     * @param opts Request options
     * @returns Validation status
     */
    fetchBulkValidationByHash(hashes: string[], opts?: RequestOptions): Promise<IndexVideoValidation[]>;
    /**
     * Get videos validation status
     *
     * @param ids Video id on Index
     * @param opts Request options
     * @returns Validation status
     */
    fetchBulkValidationById(ids: string[], opts?: RequestOptions): Promise<IndexVideoValidation[]>;
    /**
     * Update a video information
     *
     * @param id Id of the video on Index
     * @param newHash New manifest hash with video metadata
     * @param opts Request options
     * @returns Video id
     */
    updateVideo(id: string, newHash: string, opts?: RequestOptions): Promise<IndexVideoManifest>;
    /**
     * Delete a video from the index
     *
     * @param id Id of the video
     * @param opts Request options
     * @returns Success state
     */
    deleteVideo(id: string, opts?: RequestOptions): Promise<boolean>;
    /**
     * Fetch the video comments
     *
     * @param id Id of the video
     * @param page Page offset (default = 0)
     * @param take Number of comments to fetch (default = 25)
     * @param opts Request options
     * @returns The list of comments
     */
    fetchComments(id: string, page?: number, take?: number, opts?: RequestOptions): Promise<PaginatedResult<IndexVideoComment>>;
    /**
     * Post a new comment to a video
     *
     * @param id Id of the video
     * @param message Message string with markdown
     * @param opts Request options
     * @returns The comment object
     */
    postComment(id: string, message: string, opts?: RequestOptions): Promise<IndexVideoComment>;
    /**
     * Give a up/down vote to the video
     *
     * @param id Id of the video
     * @param vote Up / Down / Neutral vote
     * @param opts Request options
     */
    vote(id: string, vote: VoteValue, opts?: RequestOptions): Promise<IndexVideoComment>;
    /**
     * Report a video
     *
     * @param id Id of the video
     * @param manifestReference Reference of the manifest to report
     * @param description Report description
     * @param opts Request options
     */
    reportVideo(id: string, manifestReference: string, description: string, opts?: RequestOptions): Promise<any>;
}

interface IndexClientOptions extends BaseClientOptions {
}
interface IIndexClientInterface {
    comments: IIndexCommentsInterface;
    moderation: IIndexModerationInterface;
    search: IIndexSearchInterface;
    system: IIndexSystemInterface;
    videos: IIndexVideosInterface;
    users: IIndexUsersInterface;
}
declare class EthernaIndexClient extends BaseClient implements IIndexClientInterface {
    comments: IndexComments;
    moderation: IndexModeration;
    search: IndexSearch;
    system: IndexSystem;
    videos: IndexVideos;
    users: IndexUsers;
    /**
     * Init an index client
     * @param options Client options
     */
    constructor(baseUrl: string, options?: IndexClientOptions);
}

interface IndexAggregatorRequestOptions extends RequestOptions {
    indexUrl?: string;
}
interface AggregatedPaginatedResult<T> extends PaginatedResult<T> {
    shouldContinue: boolean;
}

declare class IndexAggregatorComments implements IIndexCommentsInterface {
    private instance;
    constructor(instance: EthernaIndexAggregatorClient);
    /**
     * Edit own comment
     * @param id Id of the comment
     * @param newText New text of the comment
     * @param opts Request options
     */
    editComment(id: string, newText: string, opts: IndexAggregatorRequestOptions): Promise<IndexVideoComment>;
    /**
     * Delete own comment
     * @param id Id of the comment
     * @param opts Request options
     */
    deleteComment(id: string, opts: IndexAggregatorRequestOptions): Promise<boolean>;
}

declare class IndexAggregatorModeration implements IIndexModerationInterface {
    private instance;
    constructor(instance: EthernaIndexAggregatorClient);
    /**
     * Delete any comment
     * @param id Id of the comment
     * @param opts Request options
     */
    deleteComment(id: string, opts: IndexAggregatorRequestOptions): Promise<boolean>;
    /**
     * Delete any video
     * @param id Id of the video
     * @param opts Request options
     */
    deleteVideo(id: string, opts: IndexAggregatorRequestOptions): Promise<boolean>;
}

declare class IndexAggregatorSearch implements IIndexSearchInterface {
    private instance;
    constructor(instance: EthernaIndexAggregatorClient);
    /**
     * Search videos
     * @param query Search query
     * @param page Page offset (default = 0)
     * @param take Count of users to get (default = 25)
     * @param opts Request options
     */
    fetchVideos(query: string, page?: number, take?: number, opts?: IndexAggregatorRequestOptions): Promise<AggregatedPaginatedResult<IndexVideoPreview>>;
}

declare class IndexAggregatorSystem implements IIndexSystemInterface {
    private instance;
    constructor(instance: EthernaIndexAggregatorClient);
    /**
     * Get a list of parameters and max charater lenghts
     * @param opts Request options
     */
    fetchParameters(opts: IndexAggregatorRequestOptions): Promise<IndexParameters>;
}

declare class IndexAggregatorUsers implements IIndexUsersInterface {
    private instance;
    constructor(instance: EthernaIndexAggregatorClient);
    /**
     * Get a list of recent users
     * @param page Page offset (default = 0)
     * @param take Count of users to get (default = 25)
     * @param opts Request options
     */
    fetchUsers(page?: number, take?: number, opts?: IndexAggregatorRequestOptions): Promise<AggregatedPaginatedResult<IndexUser>>;
    /**
     * Get a user info
     * @param address User's address
     * @param opts Request options
     */
    fetchUser(address: string, opts: IndexAggregatorRequestOptions): Promise<IndexUser>;
    /**
     * Fetch user's videos
     * @param address User's address
     * @param page Page offset (default = 0)
     * @param take Count of users to get (default = 25)
     * @param opts Request options
     */
    fetchVideos(address: string, page?: number, take?: number, opts?: IndexAggregatorRequestOptions): Promise<AggregatedPaginatedResult<{
        indexUrl: string;
        id: string;
        creationDateTime: string;
        ownerAddress: EthAddress;
        lastValidManifest: IndexVideoManifest | null;
        currentVoteValue: VoteValue | null;
        totDownvotes: number;
        totUpvotes: number;
    }>>;
    /**
     * Get the current logged user's info
     * @param opts Request options
     */
    fetchCurrentUser(opts: IndexAggregatorRequestOptions): Promise<IndexCurrentUser>;
}

declare class IndexAggregatorVideos implements IIndexVideosInterface {
    private instance;
    abortController?: AbortController;
    constructor(instance: EthernaIndexAggregatorClient);
    /**
     * Create a new video on the index
     *
     * @param hash Hash of the manifest/feed with the video metadata
     * @param encryptionKey Encryption key
     * @param opts Request options
     * @returns Video id
     */
    createVideo(hash: string, opts: IndexAggregatorRequestOptions & {
        encryptionKey?: string;
    }): Promise<string>;
    /**
     * Get video information by id
     *
     * @param id Video id on Index
     * @param opts Request options
     * @returns The video object
     */
    fetchVideoFromId(id: string, opts: IndexAggregatorRequestOptions): Promise<IndexVideo>;
    /**
     * Get video information
     *
     * @param hash Video hash on Swarm
     * @param opts Request options
     * @returns Video information
     */
    fetchVideoFromHash(hash: string, opts?: IndexAggregatorRequestOptions): Promise<{
        id: string;
        creationDateTime: string;
        ownerAddress: `0x${string}`;
        lastValidManifest: IndexVideoManifest | null;
        currentVoteValue: VoteValue | null;
        totDownvotes: number;
        totUpvotes: number;
        aggregatedResult: ({
            indexUrl: string;
            id: string;
            creationDateTime: string;
            ownerAddress: EthAddress;
            lastValidManifest: IndexVideoManifest | null;
            currentVoteValue: VoteValue | null;
            totDownvotes: number;
            totUpvotes: number;
        } | {
            indexUrl: string | null;
            code: "NOT_FOUND" | "SERVER_ERROR" | "BAD_REQUEST" | "UNAUTHORIZED" | "PERMISSION_DENIED" | "DUPLICATE" | "JWT_MISSING_OR_EXPIRED" | "MISSING_FUNDS" | "MISSING_BATCH_ID" | "MISSING_REFERENCE" | "MISSING_SIGNER" | "MISSING_WALLET" | "OUTDATED_WALLET" | "LOCKED_WALLET" | "BUCKET_FILLED" | "ABORTED_BY_USER" | "INVALID_ARGUMENT" | "INVALID_API_KEY" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "TIMEOUT" | "VALIDATION_ERROR" | "ENCODING_ERROR" | "ENCRYPTION_ERROR" | "DECRYPTION_ERROR" | null;
            message: string;
            zodError: ZodError<unknown> | null | undefined;
        })[];
    }>;
    /**
     * Get a list of recent videos uploaded on the platform
     *
     * @param page Page offset (default = 0)
     * @param take Number of videos to fetch (default = 25)
     * @param opts Request options
     * @returns The list of videos
     */
    fetchLatestVideos(page?: number, take?: number, opts?: IndexAggregatorRequestOptions): Promise<AggregatedPaginatedResult<{
        indexUrl: string;
        id: string;
        title: string;
        hash: Reference;
        duration: number;
        ownerAddress: EthAddress;
        thumbnail: Image | null;
        createdAt: number;
        updatedAt: number;
    }>>;
    /**
     * Get video validations list
     *
     * @param id Video id on Index
     * @param opts Request options
     * @returns List of validations
     */
    fetchValidations(id: string, opts: IndexAggregatorRequestOptions): Promise<IndexVideoValidation[]>;
    /**
     * Get video hash validation status
     *
     * @param hash Video hash on Swarm
     * @param opts Request options
     * @returns Validation status
     */
    fetchHashValidation(hash: string, opts: IndexAggregatorRequestOptions): Promise<IndexVideoValidation>;
    /**
     * Get videos validation status
     *
     * @param hashes Video hash on Swarm
     * @param opts Request options
     * @returns Validation status
     */
    fetchBulkValidationByHash(hashes: string[], opts: IndexAggregatorRequestOptions): Promise<IndexVideoValidation[]>;
    /**
     * Get videos validation status
     *
     * @param ids Video id on Index
     * @param opts Request options
     * @returns Validation status
     */
    fetchBulkValidationById(ids: string[], opts: IndexAggregatorRequestOptions): Promise<IndexVideoValidation[]>;
    /**
     * Update a video information
     *
     * @param id Id of the video on Index
     * @param newHash New manifest hash with video metadata
     * @param opts Request options
     * @returns Video id
     */
    updateVideo(id: string, newHash: string, opts: IndexAggregatorRequestOptions): Promise<IndexVideoManifest>;
    /**
     * Delete a video from the index
     *
     * @param id Id of the video
     * @param opts Request options
     * @returns Success state
     */
    deleteVideo(id: string, opts: IndexAggregatorRequestOptions): Promise<boolean>;
    /**
     * Fetch the video comments
     *
     * @param id Id of the video
     * @param page Page offset (default = 0)
     * @param take Number of comments to fetch (default = 25)
     * @param opts Request options
     * @returns The list of comments
     */
    fetchComments(id: string, page: number | undefined, take: number | undefined, opts: IndexAggregatorRequestOptions): Promise<PaginatedResult<IndexVideoComment>>;
    /**
     * Post a new comment to a video
     *
     * @param id Id of the video
     * @param message Message string with markdown
     * @param opts Request options
     * @returns The comment object
     */
    postComment(id: string, message: string, opts: IndexAggregatorRequestOptions): Promise<IndexVideoComment>;
    /**
     * Give a up/down vote to the video
     *
     * @param id Id of the video
     * @param vote Up / Down / Neutral vote
     * @param opts Request options
     */
    vote(id: string, vote: VoteValue, opts: IndexAggregatorRequestOptions): Promise<IndexVideoComment>;
    /**
     * Report a video
     *
     * @param id Id of the video
     * @param manifestReference Reference of the manifest to report
     * @param description Report description
     * @param opts Request options
     */
    reportVideo(id: string, manifestReference: string, description: string, opts: IndexAggregatorRequestOptions): Promise<any>;
}

interface IndexAggregatorClientOptions {
    indexes: {
        url: string;
        apiPath: string;
    }[];
    accessToken?: string;
}
declare class EthernaIndexAggregatorClient implements IIndexClientInterface {
    indexClients: EthernaIndexClient[];
    comments: IndexAggregatorComments;
    moderation: IndexAggregatorModeration;
    search: IndexAggregatorSearch;
    system: IndexAggregatorSystem;
    videos: IndexAggregatorVideos;
    users: IndexAggregatorUsers;
    /**
     * Init an index client
     * @param options Client options
     */
    constructor(options: IndexAggregatorClientOptions);
    getIndexClientByRequest(opts: IndexAggregatorRequestOptions): EthernaIndexClient;
    fetchAggregatedPaginatedData: <T>(page: number, take: number, fetcher: (client: EthernaIndexClient, relativeTake: number) => Promise<PaginatedResult<T>>, opts?: IndexAggregatorRequestOptions) => Promise<AggregatedPaginatedResult<T>>;
}

declare class SSOAuth {
    private instance;
    constructor(instance: EthernaSSOClient);
    /**
     * Get access token from api key
     */
    signin(apiKey: string): Promise<{
        accessToken: string;
        expiresAt: number;
    }>;
}

interface SSOIdentity$1 {
    accountType: "web2" | "web3";
    email: string | null;
    etherAddress: EthAddress;
    etherManagedPrivateKey: string | null;
    etherPreviousAddresses: string[];
    etherLoginAddress: string | null;
    phoneNumber: string | null;
    username: string;
}

declare class SSOIdentity {
    private instance;
    constructor(instance: EthernaSSOClient);
    /**
     * Get current SSO user
     */
    fetchCurrentIdentity(): Promise<SSOIdentity$1>;
}

interface SSOClientOptions extends BaseClientOptions {
}
declare class EthernaSSOClient extends BaseClient {
    auth: SSOAuth;
    identity: SSOIdentity;
    /**
     * Init an SSO client
     * @param options Client options
     */
    constructor(baseUrl: string, options?: SSOClientOptions);
}

interface ChunksUploaderOptions {
    beeClient: BeeClient;
    concurrentChunks?: number;
}
interface ChunksUploadOptions extends RequestUploadOptions {
    deferred?: boolean;
}
interface ChunkWithKey extends Chunk$1 {
    key: string;
}
declare class ChunksUploader {
    private chunks;
    private chunksCount;
    private beeClient;
    private concurrentChunks;
    private tagReference?;
    private tag?;
    private activeTasks;
    private uploadOptions?;
    private stop;
    private drainPromiseResolver?;
    private drainPromiseRejecter?;
    private progressListeners;
    private errorListeners;
    private doneListeners;
    constructor(options: ChunksUploaderOptions);
    on(event: "progress", listener: (progress: number) => void): this;
    on(event: "error", listener: (error: EthernaSdkError) => void): this;
    on(event: "done", listener: () => void): this;
    off(event: "progress", listener: (progress: number) => void): this;
    off(event: "error", listener: (error: EthernaSdkError) => void): this;
    off(event: "done", listener: () => void): this;
    append(chunkedFile: ChunkedFile<4096, 8>, key?: string): Reference;
    append(data: Uint8Array, key?: string): Reference;
    pop(key: string): ChunkWithKey[];
    resume(options: ChunksUploadOptions): void;
    private _internal_resume;
    drain(): Promise<void>;
}

declare class EpochIndex {
    static readonly maxLevel = 32n;
    static readonly minLevel = 0n;
    static readonly maxStart: bigint;
    static readonly maxUnixTimeStamp: bigint;
    static readonly minUnixTimeStamp = 0n;
    /** Epoch start in seconds */
    start: bigint;
    /** Epoch level (32 to 0) */
    level: number;
    constructor(start: bigint, level: number | bigint);
    get isLeft(): boolean;
    get isRight(): boolean;
    get length(): bigint;
    get marshalBinary(): Uint8Array;
    get left(): EpochIndex;
    get right(): EpochIndex;
    static fromString(epochString: string): EpochIndex;
    containsTime(at: Date): boolean;
    getChildAt(at: Date): EpochIndex;
    getNext(at: Date): EpochIndex;
    getParent(): EpochIndex;
    isEqual(other: EpochIndex): boolean;
    /**
     * Calculates the lowest common ancestor epoch given two unix times
     * @param t0
     * @param t1
     * @returns  Lowest common ancestor epoch index
     */
    static lowestCommonAncestor(t0: bigint, t1: bigint): EpochIndex;
    toString(): string;
}

declare global {
    interface Uint8Array {
        toUnixTimestamp(): bigint;
        toUnixDate(): Date;
    }
    interface Date {
        toUnixTimestamp(): bigint;
        toBytes(): Uint8Array;
    }
    interface BigInt {
        toDate(): Date;
        normalized(): bigint;
    }
}
declare class EpochFeedChunk {
    index: EpochIndex;
    payload: Uint8Array;
    reference: Reference;
    static readonly AccountBytesLength = 20;
    static readonly IdentifierBytesLength = 32;
    static readonly IndexBytesLength = 32;
    static readonly MaxPayloadBytesSize = 3991;
    static readonly ReferenceHashRegex: RegExp;
    static readonly TimeStampByteSize = 8;
    static readonly TopicBytesLength = 32;
    static readonly MinPayloadByteSize = 8;
    static readonly MaxContentPayloadBytesSize: number;
    timestamp: Date | null;
    constructor(index: EpochIndex, payload: Uint8Array, reference: Reference);
    isEqual(chunk: EpochFeedChunk): boolean;
    getContentPayload(): Uint8Array<ArrayBuffer>;
    static buildChunkPayload(contentPayload: Uint8Array, at?: Date): Uint8Array;
    static buildIdentifier(topic: Uint8Array, index: EpochIndex): Uint8Array;
    static buildReferenceHash(account: string, identifier: Uint8Array, index?: EpochIndex): Reference;
}

declare class EpochFeed {
    beeClient: BeeClient;
    constructor(beeClient: BeeClient);
    createNextEpochFeedChunk(account: string, topic: Uint8Array, contentPayload: Uint8Array, knownNearEpochIndex?: EpochIndex): Promise<EpochFeedChunk>;
    tryFindEpochFeed(account: string, topic: Uint8Array, at: Date, knownNearEpochIndex?: EpochIndex): Promise<EpochFeedChunk | null>;
    tryGetFeedChunk(account: string, topic: Uint8Array, index: EpochIndex): Promise<EpochFeedChunk | null>;
    tryGetFeedChunk(chunkReferenceHash: Reference, index: EpochIndex): Promise<EpochFeedChunk | null>;
    private findLastEpochChunkBeforeDate;
    /**
     * Implement phase 1 of epoch chunk look up.
     * @param knownNearEpoch An optional epoch index with known existing chunk
     * @param at The searched date
     * @returns A starting epoch index
     */
    private findStartingEpochOffline;
    private tryFindStartingEpochChunkOnline;
}

declare class MantarayFork {
    prefix: Uint8Array;
    node: MantarayNode;
    /**
     * @param prefix the non-branching part of the subpath
     * @param node in memory structure that represents the Node
     */
    constructor(prefix: Uint8Array, node: MantarayNode);
    static nodeForkSizes: {
        readonly nodeType: 1;
        readonly prefixLength: 1;
        /** Bytes length before `reference` */
        readonly preReference: 32;
        readonly metadata: 2;
        readonly header: () => number;
        readonly prefixMaxSize: () => number;
    };
    static nodeHeaderSizes: {
        readonly obfuscationKey: 32;
        readonly versionHash: 31;
        /** Its value represents how long is the `entry` in bytes */
        readonly refBytes: 1;
        readonly full: () => number;
    };
    private createMetadataPadding;
    serialize(): Uint8Array;
    static deserialize(data: Uint8Array, obfuscationKey: Bytes$1<32>, options?: {
        withMetadata?: {
            refBytesSize: number;
            metadataByteSize: number;
        };
    }): MantarayFork;
}

type MetadataMapping = Record<string, string>;
type ForkMapping = {
    [key: number]: MantarayFork;
};
type MarshalVersion = (typeof marshalVersionValues)[number];
type StorageLoader = (reference: BytesReference) => Promise<Uint8Array>;
type StorageSaver = (data: Uint8Array, options?: {
    ecrypt?: boolean;
}) => Promise<BytesReference>;
interface StorageHandler {
    load: StorageLoader;
    save: StorageSaver;
}
interface RecursiveSaveReturnType {
    reference: BytesReference;
    changed: boolean;
}
declare const marshalVersionValues: readonly ["0.1", "0.2"];
declare class MantarayNode {
    /** Used with NodeType type */
    private _type?;
    private _obfuscationKey?;
    /** reference of a loaded manifest node. if undefined, the node can be handled as `dirty` */
    private _contentAddress?;
    /** reference of an content that the manifest refers to */
    private _entry?;
    private _metadata?;
    /** Forks of the manifest. Has to be initialized with `{}` on load even if there were no forks */
    forks?: ForkMapping;
    get contentAddress(): BytesReference | undefined;
    set contentAddress(contentAddress: BytesReference);
    get entry(): BytesReference | undefined;
    set entry(entry: BytesReference);
    get type(): number;
    set type(type: number);
    get obfuscationKey(): Bytes$1<32> | undefined;
    set obfuscationKey(obfuscationKey: Bytes$1<32>);
    get metadata(): MetadataMapping | undefined;
    set metadata(metadata: MetadataMapping);
    get readable(): ReadableMantarayNode;
    static fromReadable(readable: ReadableMantarayNode): MantarayNode;
    isValueType(): boolean;
    isEdgeType(): boolean;
    isWithPathSeparatorType(): boolean;
    IsWithMetadataType(): boolean;
    private makeValue;
    private makeEdge;
    private makeWithPathSeparator;
    private makeWithMetadata;
    private makeNotWithPathSeparator;
    private updateWithPathSeparator;
    /**
     *
     * @param path path sting represented in bytes. can be 0 length, then `entry` will be the current node's entry
     * @param entry
     * @param metadata
     * @param storage
     */
    addFork(path: Uint8Array, entry: BytesReference, metadata?: MetadataMapping): void;
    /**
     * Gives back a MantarayFork under the given path
     *
     * @param path valid path within the MantarayNode
     * @returns MantarayFork with the last unique prefix and its node
     * @throws error if there is no node under the given path
     */
    getForkAtPath(path: Uint8Array): MantarayFork;
    /**
     * Check if node exists under the given path
     *
     * @param path valid path within the MantarayNode
     * @returns True if exists, false otherwise
     */
    hasForkAtPath(path: Uint8Array): boolean;
    /**
     * Get all forks with a path prefix
     * @param prefix path prefix
     * @returns List of forks
     */
    getNodesWithPrefix(prefix: Uint8Array): MantarayNode[];
    /**
     * Removes a path from the node
     *
     * @param path Uint8Array of the path of the node intended to remove
     */
    removePath(path: Uint8Array): void;
    load(storageLoader: StorageLoader, reference: BytesReference): Promise<void>;
    /**
     * Saves dirty flagged ManifestNodes and its forks recursively
     * @returns Reference of the top manifest node.
     */
    save(storageSaver: StorageSaver): Promise<BytesReference>;
    isDirty(): boolean;
    makeDirty(): void;
    serialize(): Uint8Array;
    deserialize(data: Uint8Array): void;
    private recursiveLoad;
    private recursiveSave;
}

interface QueueOptions {
    /**
     * The maximum number of tasks that can be run concurrently.
     * Default: Infinity
     */
    maxConcurrentTasks?: number;
    /**
     * The mode in which the queue should drain.
     * - `background` (default): The queue will drain in the background, allowing new tasks to be enqueued while draining.
     * - `manual`: The queue will not allow new tasks to be run until manually started.
     */
    drainMode?: "background" | "manual";
}
declare class Queue {
    tasks: {
        key?: string;
        task: () => Promise<void>;
    }[];
    activeTasks: number;
    maxConcurrentTasks: number;
    drainMode: "background" | "manual";
    private drainPromiseResolver?;
    constructor(options?: QueueOptions);
    enqueue(task: () => Promise<void>, key?: string): void;
    dequeue(key: string): void;
    drain(key?: string): Promise<void>;
    private runTasks;
}

interface FolderBuilderConfig {
    beeClient: BeeClient;
    batchId: BatchId;
    concurrentTasks?: number;
    indexDocument?: string;
    errorDocument?: string;
}
declare class FolderBuilder {
    protected config: FolderBuilderConfig;
    protected node: MantarayNode;
    protected queue: Queue;
    protected bytesTotal: number;
    protected bytesProgress: number;
    protected abortController: AbortController;
    protected errored: boolean;
    onProgress?: (percent: number) => void;
    onEnqueueData?: (data: Uint8Array, queue: Queue) => BytesReference;
    constructor(config: FolderBuilderConfig);
    addFile(data: Uint8Array, filename: string, path: string, contentType: string | null): void;
    save(): Promise<Reference>;
    private enqueueData;
    private kill;
}

interface FolderExplorerOptions {
    beeClient: BeeClient;
}
interface FolderEntryFile {
    type: "file";
    metadata: Record<string, string>;
    name: string;
}
interface FolderEntryDirectory {
    type: "directory";
    children: FolderExplorerEntry[];
    name: string;
}
type FolderExplorerEntry = FolderEntryFile | FolderEntryDirectory;
declare class FolderExplorer {
    private reference;
    private mantaray;
    private entries;
    private beeClient;
    constructor(reference: Reference, options: FolderExplorerOptions);
    constructor(node: MantarayNode, options: FolderExplorerOptions);
    loadFolder(): Promise<void>;
    entriesAtPath(path: string): FolderExplorerEntry[] | undefined;
    fileAtPath(path: string): FolderEntryFile | undefined;
    private loadEntries;
}

declare class MantarayIndexBytes {
    private bytes;
    constructor();
    get getBytes(): Bytes$1<32>;
    set setBytes(bytes: Bytes$1<32>);
    /**
     *
     * @param byte is number max 255
     */
    setByte(byte: number): void;
    /**
     * checks the given byte is mapped in the Bytes<32> index
     *
     * @param byte is number max 255
     */
    checkBytePresent(byte: number): boolean;
    /** Iterates through on the indexed byte values */
    forEach(hook: (byte: number) => void): void;
}

interface BaseProcessorUploadOptions extends Omit<RequestUploadOptions, "batchId"> {
    beeClient: BeeClient;
    batchId: BatchId;
    deferred?: boolean;
    concurrentChunks?: number;
}
interface ProcessorOutput {
    path: string;
    entryAddress: Reference;
    metadata: {
        filename: string;
        contentType: string;
    };
}
declare class BaseProcessor {
    input: File | Blob | ArrayBuffer | Uint8Array;
    protected _processorOutputs: ProcessorOutput[];
    protected _isProcessed: boolean;
    protected _stampCalculator: StampCalculator;
    protected _chunkedFiles: ChunkedFile<4096, 8>[];
    constructor(input: File | Blob | ArrayBuffer | Uint8Array);
    get processorOutputs(): ProcessorOutput[];
    get isProcessed(): boolean;
    get stampCalculator(): StampCalculator;
    get chunkedFiles(): ChunkedFile<4096, 8>[];
    process(_options?: unknown): Promise<ProcessorOutput[]>;
    protected appendChunkedFile(chunkedFile: ChunkedFile<4096, 8>): void;
}

interface ImageProcessorOptions {
    sizes: number[] | "avatar" | "cover" | "thumbnail";
    /**
     * The path format for the image
     *
     * - `$size` will be replaced by the image size
     * - `$type` will be replaced by the image type
     *
     * Example: `avatar/$size.$type`
     */
    pathFormat?: string;
}
declare const AVATAR_SIZES: number[];
declare const COVER_SIZES: number[];
declare const THUMBNAIL_SIZES: number[];
declare const AVATAR_PATH_FORMAT = "avatar/$size.$type";
declare const COVER_PATH_FORMAT = "cover/$size.$type";
declare const THUMBNAIL_PATH_FORMAT = "thumb/$size.$type";
declare class ImageProcessor extends BaseProcessor {
    private _image;
    previewDataURL: string | null;
    constructor(input: File | Blob | ArrayBuffer | Uint8Array);
    get image(): {
        aspectRatio: number;
        blurhash: string;
        sources: ({
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        })[];
    } | null;
    process(options: ImageProcessorOptions): Promise<ProcessorOutput[]>;
}

interface VideoProcessorOutputOptions {
    ffmpeg: FFmpeg;
    /**
     * - Default: `"sources/hls"`
     */
    basePath?: string;
}
interface VideoProcessorOptions extends VideoProcessorOutputOptions {
    resolutions?: number[];
    signal?: AbortSignal;
    progressCallback?: (progress: number) => void;
}
interface VideoProcessedOutput {
    duration: number;
    aspectRatio: number;
    sources: VideoSource[];
}
declare class VideoProcessor extends BaseProcessor {
    private _video;
    private _cachedMetadata;
    get video(): VideoProcessedOutput | null;
    process(options: VideoProcessorOptions): Promise<ProcessorOutput[]>;
    loadFromDirectory(directory: FileSystemDirectoryHandle | string, opts?: VideoProcessorOutputOptions): Promise<void>;
    createThumbnailProcessor(frameTimestamp: number, opts?: VideoProcessorOutputOptions): Promise<ImageProcessor>;
    private processOutput;
    private getVideoMeta;
    private getBrowserVideoMeta;
    private getFFmpeg;
    private getNodeVideoMeta;
    private writeInputFileIfNeeded;
    private generateThumbnail;
}

interface BaseManifestOptions {
    beeClient: BeeClient;
    uploadConcurrentChunks?: number;
}
interface BaseManifestDownloadOptions extends RequestDownloadOptions {
    signal?: AbortSignal;
}
interface BaseMantarayManifestDownloadOptions extends BaseManifestDownloadOptions {
    mode: "preview" | "details" | "full";
}
interface BaseManifestUploadOptions extends Omit<RequestUploadOptions, "batchId"> {
    batchId?: BatchId;
    batchLabelQuery?: string;
}
declare class BaseManifest {
    protected _reference: Reference;
    protected _batchId?: BatchId;
    protected _isDirty: boolean;
    protected beeClient: BeeClient;
    protected batchIdCollision?: BucketCollisions;
    manifestBucketCalculator: StampCalculator;
    constructor(init: unknown, options: BaseManifestOptions);
    get reference(): Reference;
    get batchId(): BatchId | undefined;
    get isDirty(): boolean;
    download(options?: BaseManifestDownloadOptions): Promise<unknown>;
    upload(options?: BaseManifestUploadOptions): Promise<unknown>;
    resume(options?: BaseManifestUploadOptions): Promise<unknown>;
    /**
     * Set batchId or find the best batchId for the upload then laods the buckets
     * collsions map and verifies that the batchId is usable
     * for the upload.
     *
     * @param batchId The batch id to use for the upload (leave blank to find the best batch id)
     * @param batchLabelQuery The label query to use for finding the best batch id
     */
    prepareForUpload(batchId?: BatchId, batchLabelQuery?: string): Promise<void>;
    protected loadBestBatchId(options?: Omit<BaseManifestUploadOptions, "batchId">): Promise<BatchId>;
}
declare class BaseMantarayManifest extends BaseManifest {
    protected _node: MantarayNode;
    protected _rootManifest: Reference;
    protected _preview: Record<string, unknown>;
    protected _details: Record<string, unknown>;
    protected _hasLoadedPreview: boolean;
    protected _hasLoadedDetails: boolean;
    protected chunksUploader: ChunksUploader;
    constructor(init: unknown, options: BaseManifestOptions);
    get serialized(): unknown;
    get node(): MantarayNode;
    get rootManifest(): Reference;
    get hasLoadedPreview(): boolean;
    get hasLoadedDetails(): boolean;
    download(_options: BaseMantarayManifestDownloadOptions): Promise<unknown>;
    upload(options?: BaseManifestUploadOptions): Promise<unknown>;
    loadNode(cachedNode?: MantarayNode): Promise<void>;
    protected proxyHandler(): {
        get: (target: Record<string, unknown>, p: string | symbol, receiver: unknown) => any;
        set: (target: Record<string, unknown>, p: string | symbol, newValue: any, receiver: any) => boolean;
    };
    protected setPreviewProxy(preview: typeof this._preview): void;
    protected setDetailsProxy(details: typeof this._details): void;
    protected addFile(entry: Reference, path: string, meta: {
        filename: string;
        contentType?: string;
    }): void;
    protected removeFile(path: string): void;
    protected updateNodeDefaultEntries(): void;
    protected enqueueData(data: Uint8Array, key?: string): BytesReference;
    protected enqueueChunkedFile(chunkedFile: ChunkedFile<4096, 8>, key?: string): BytesReference;
    protected dequeueData(key: string): void;
    protected importImageProcessor(imageProcessor: ImageProcessor, key?: string): void;
    protected importVideoProcessor(videoProcessor: VideoProcessor, key?: string): void;
    protected enqueueProcessor(processor: BaseProcessor, key?: string): void;
}

interface Video {
    reference: Reference;
    preview: VideoPreview;
    details: VideoDetails;
}
type ProfileManifestInit = Reference | {
    owner: EthAddress;
} | Video;
declare const CURRENT_VIDEO_MANIFEST_VERSION: "2.1";
/**
 * This class is used to fetch any video data or update a video of the current user
 */
declare class VideoManifest extends BaseMantarayManifest {
    protected _preview: VideoPreview;
    protected _details: VideoDetails;
    /**
     * Fetch a video data
     * @param init Video reference
     * @param options Manifest options
     */
    constructor(init: Reference, options: BaseManifestOptions);
    /**
     * Update a user video from existing data
     * @param init Video existing data
     * @param options Manifest options
     */
    constructor(init: Video, options: BaseManifestOptions);
    /**
     * Create a new video for the current user
     * @param options Manifest options
     */
    constructor(options: BaseManifestOptions);
    get serialized(): Video;
    get v(): string;
    get title(): string;
    set title(value: string);
    get description(): string;
    set description(value: string);
    get duration(): number;
    get ownerAddress(): `0x${string}`;
    get thumbnail(): {
        aspectRatio: number;
        blurhash: string;
        sources: ({
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        })[];
    } | null;
    get createdAt(): Date;
    get updatedAt(): Date | null;
    get aspectRatio(): number;
    get sources(): ({
        quality: `${number}p`;
        size: number;
        type?: "mp4" | undefined;
        path?: string | undefined;
        reference?: Reference | undefined;
        bitrate?: number | undefined;
    } | {
        type: "dash" | "hls";
        path: string;
        size: number;
    })[];
    get captions(): {
        label: string;
        lang: string;
        path: string;
    }[];
    download(options: BaseMantarayManifestDownloadOptions): Promise<Video>;
    upload(options?: BaseManifestUploadOptions): Promise<Video>;
    resume(options?: BaseManifestUploadOptions): Promise<Video>;
    migrate(options?: {
        signal?: AbortSignal;
    }): Promise<Video>;
    addThumbnail(imageProcessor: ImageProcessor): void;
    removeThumbnail(): void;
    addVideo(videoProcessor: VideoProcessor): void;
    removeVideo(): void;
    addCaption(reference: Reference, lang: string, label: string): void;
    addCaption(text: string | Uint8Array, lang: string, label: string): void;
    removeCaption(lang: string): void;
    private getCaptionPath;
    private getCaptionKey;
    private getCaptionName;
}

interface PlaylistManifestUploadOptions extends BaseManifestUploadOptions {
    password?: string;
}
type PlaylistIdentification = Reference | {
    id: string;
    owner: EthAddress | EnsAddress;
};
interface Playlist {
    reference: Reference;
    rootManifest: Reference;
    preview: PlaylistPreview;
    details: PlaylistDetails;
    isEncrypted: boolean;
    encryptedDetails?: string;
}
declare const CHANNEL_PLAYLIST_ID = "Channel";
declare const SAVED_PLAYLIST_ID = "Saved";
declare const createPlaylistTopicName: (id: string) => string;
/**
 * This class is used to fetch/update a playlist
 */
declare class PlaylistManifest extends BaseMantarayManifest {
    private _ensName;
    protected _preview: PlaylistPreview;
    protected _details: PlaylistDetails;
    private _encryptedDetails?;
    private _isEncrypted;
    /**
     * Load a playlist from identification (rootManifest or id + owner)
     * @param identification Playlist identification (rootManifest or id + owner)
     * @param options Manifest options
     */
    constructor(identification: PlaylistIdentification, options: BaseManifestOptions);
    /**
     * Load a playlist from existing data for updating
     * @param playlist Playlist existing data
     * @param options Manifest options
     */
    constructor(playlist: Playlist, options: BaseManifestOptions);
    /**
     * Create new playlist
     * @param options Manifest options
     */
    constructor(options: BaseManifestOptions);
    get id(): string;
    get owner(): `0x${string}`;
    get type(): PlaylistType;
    set type(value: PlaylistType);
    get isEncrypted(): boolean;
    get isEncryptableType(): boolean;
    get previewName(): string;
    set previewName(value: string);
    get name(): string;
    set name(value: string);
    get description(): string | undefined;
    set description(value: string | undefined);
    get thumb(): {
        blurhash: string;
        path: string;
    } | null;
    get passwordHint(): string | undefined;
    set passwordHint(value: string | undefined);
    get createdAt(): Date;
    get updatedAt(): Date;
    get videos(): {
        title: string;
        reference: Reference;
        addedAt: Date;
        publishedAt: Date | null;
    }[];
    get serialized(): Playlist;
    download(options: BaseMantarayManifestDownloadOptions): Promise<Playlist>;
    upload(options?: PlaylistManifestUploadOptions): Promise<Playlist>;
    resume(options?: BaseManifestUploadOptions): Promise<Playlist>;
    decrypt(password: string): void;
    addVideo(video: Video, publishAt?: Date): void;
    replaceVideo(oldReference: Reference, newVideo: Video): void;
    removeVideo(videoReference: Reference): void;
    protected updateNodeDefaultEntries(): void;
    private updateThumb;
    private getPlaylistFeed;
}

interface Profile {
    reference: Reference;
    address: EthAddress;
    ensName: EnsAddress | null;
    preview: ProfilePreview;
    details: ProfileDetails;
}
declare const PROFILE_TOPIC = "EthernaUserProfile";
/**
 * This class is used to fetch any user profile data or update the current user profile
 */
declare class ProfileManifest extends BaseMantarayManifest {
    private _address;
    private _ensName;
    protected _preview: ProfilePreview;
    protected _details: ProfileDetails;
    /**
     * Download a profile of any user / update profile of the current user
     * @param identification Profile address or ENS name
     * @param options Manifest options
     */
    constructor(identification: EthAddress | EnsAddress, options: BaseManifestOptions);
    /**
     * Update the current user profile from existing data
     * @param profile Profile data
     * @param options Manifest options
     */
    constructor(profile: Profile, options: BaseManifestOptions);
    /**
     * Fetch/update the current user profile
     * @param options Manifest options
     */
    constructor(options: BaseManifestOptions);
    get serialized(): Profile;
    get address(): `0x${string}`;
    get ensName(): `${string}.eth` | null;
    get name(): string;
    set name(value: string);
    get avatar(): {
        aspectRatio: number;
        blurhash: string;
        sources: ({
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        })[];
    } | null;
    get cover(): {
        aspectRatio: number;
        blurhash: string;
        sources: ({
            width: number;
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl" | null;
            path?: string | undefined;
            reference?: Reference | undefined;
        } & {
            type: "jpeg" | "png" | "webp" | "avif" | "jpeg-xl";
        })[];
    } | null;
    get description(): string | null | undefined;
    set description(value: string | null | undefined);
    get website(): string | undefined;
    set website(value: string | undefined);
    get birthday(): string | undefined;
    set birthday(value: string | undefined);
    get location(): string | undefined;
    set location(value: string | undefined);
    get playlists(): Reference[];
    download(options: BaseMantarayManifestDownloadOptions): Promise<Profile>;
    upload(options?: BaseManifestUploadOptions): Promise<Profile>;
    resume(options?: BaseManifestUploadOptions): Promise<Profile>;
    addPlaylist(playlistRootManifest: Reference): void;
    removePlaylist(playlistRootManifest: Reference): void;
    setPlaylists(playlists: Reference[]): void;
    movePlaylist(playlistRootManifest: Reference, newIndex: number): void;
    addAvatar(imageProcessor: ImageProcessor): void;
    addCover(imageProcessor: ImageProcessor): void;
    removeAvatar(): void;
    removeCover(): void;
}

declare const UserFollowingsSchema: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
type UserFollowings = z.infer<typeof UserFollowingsSchema>;

declare const USER_FOLLOWINGS_TOPIC = "EthernaUserFollowings";
/**
 * This class is used to fetch/update the following users of the current user
 */
declare class UserFollowingsManifest extends BaseManifest {
    private _owner;
    private _followings;
    /**
     * Initialize a new UserFollowingsManifest instance from existing data
     * @param init List of all user followings
     * @param options BeeClient and batch options
     */
    constructor(init: UserFollowings, options: BaseManifestOptions);
    /**
     * Load followings from beeClient signer address
     * @param options BeeClient and batch options
     */
    constructor(options: BaseManifestOptions);
    get owner(): EthAddress;
    get followings(): UserFollowings;
    download(options?: BaseManifestDownloadOptions): Promise<UserFollowings>;
    upload(options?: BaseManifestUploadOptions): Promise<UserFollowings>;
    resume(options?: BaseManifestUploadOptions): Promise<UserFollowings>;
    addFollowing(address: EthAddress): void;
    removeFollowing(address: EthAddress): void;
}

declare const USER_PLAYLISTS_TOPIC = "EthernaUserPlaylists";
/**
 * This class is used to fetch/update the personal playlists of the current user
 */
declare class UserPlaylistsManifest extends BaseManifest {
    private _owner;
    private _playlists;
    /**
     * Initialize a new UserPlaylistsManifest instance from existing data
     * @param init List of all user playlists
     * @param options BeeClient and batch options
     */
    constructor(init: UserPlaylists, options: BaseManifestOptions);
    /**
     * Load playlists from beeClient signer address
     * @param options BeeClient and batch options
     */
    constructor(options: BaseManifestOptions);
    get owner(): EthAddress;
    get playlists(): UserPlaylists;
    download(options?: BaseManifestDownloadOptions): Promise<UserPlaylists>;
    upload(options?: BaseManifestUploadOptions): Promise<UserPlaylists>;
    resume(options?: BaseManifestUploadOptions): Promise<UserPlaylists>;
    addPlaylist(playlistRootManifest: Reference): void;
    removePlaylist(playlistRootManifest: Reference): void;
}

interface VideoPublisherOptions {
    video: Video;
    videoInitialReference?: Reference;
    beeClient: BeeClient;
    batchId: BatchId;
    sources: PublishSource[];
}
interface PublishSourcePlaylist {
    type: "playlist";
    playlist: Playlist;
}
interface PublishSourceIndex {
    type: "index";
    indexClient: EthernaIndexClient;
    indexVideoId?: string;
}
interface PublishResultStatus {
    sourceType: "playlist" | "index";
    sourceId: string;
    success: boolean;
    error: EthernaSdkError | null;
    videoId: string;
}
interface VideoPublisherSyncResult {
    publishResult: PublishResultStatus[];
    unpublishResult: PublishResultStatus[];
}
type PublishSource = PublishSourcePlaylist | PublishSourceIndex;
interface VideoPublisherUploadOptions extends Omit<RequestUploadOptions, "batchId" | "onUploadProgress"> {
}
declare class VideoPublisher {
    private video;
    private videoInitialReference?;
    private batchId;
    private beeClient;
    sources: PublishSource[];
    results: VideoPublisherSyncResult | undefined;
    constructor(options: VideoPublisherOptions);
    sync(publishTo: PublishSource[], options?: VideoPublisherUploadOptions): Promise<VideoPublisherSyncResult>;
    retry(options?: VideoPublisherUploadOptions): Promise<VideoPublisherSyncResult>;
    publish(source: PublishSource, options?: VideoPublisherUploadOptions): Promise<{
        id: string;
    }>;
    unpublish(source: PublishSource, options?: VideoPublisherUploadOptions): Promise<{
        id: string;
    }>;
    private internal_sync;
    private isEqualSource;
}

/**
 * Checks if the given address is a valid Ethereum address.
 *
 * @param address The address to check.
 * @returns A boolean indicating whether the address is a valid Ethereum address.
 */
declare function isEthAddress(address: string): address is EthAddress;
/**
 * Checks if the given address is a valid ENS address.
 *
 * @param address The address to check.
 * @returns A boolean indicating whether the address is a valid ENS address.
 */
declare function isEnsAddress(address: string): address is EnsAddress;
/**
 * Converts the given bytes or hex string to an Ethereum account address.
 *
 * @param bytes The bytes or hex string to convert.
 * @returns The Ethereum account address.
 */
declare function toEthAccount(bytes: Uint8Array | string): EthAddress;
/**
 * Fetches the Ethereum address associated with the given ENS address.
 *
 * @param ensAddress The ENS address to fetch the Ethereum address for.
 * @returns A Promise that resolves to the Ethereum address associated with the ENS address, or null if not found.
 */
declare function fetchAddressFromEns(ensAddress: EnsAddress): Promise<EthAddress | null>;
/**
 * Fetches the ENS address associated with the given Ethereum address.
 *
 * @param address The Ethereum address to fetch the ENS address for.
 * @returns A Promise that resolves to the ENS address associated with the Ethereum address, or null if not found.
 */
declare function fetchEnsFromAddress(address: EthAddress): Promise<EnsAddress | null>;

/**
 * Splits an array into chunks of a specified size.
 *
 * @param array - The array to be split into chunks.
 * @param chunkSize - The size of each chunk.
 * @returns An array of chunks.
 */
declare function splitArrayInChunks<T>(array: T[], chunkSize: number): T[][];

/**
 * Get postage batch space utilization (in bytes)
 *
 * @param batch Batch data
 * @returns An object with total, used and available space
 */
declare const getBatchSpace: (batch: PostageBatch) => {
    total: number;
    used: number;
    available: number;
};
/**
 * Calculate the minimum depth required to upload some data
 * @param bytesToUpload Amount of bytes to upload
 * @param currentDepth Current batch depth
 * @param availableSpace Available space in the current batch (leave blank if fully available)
 * @returns Minimum batch depth required to upload the specified amount of bytes
 */
declare function calcBatchMinDepth(bytesToUpload: number, currentDepth?: number, availableSpace?: number): number;
/**
 * Get batch capacity
 *
 * @param batchOrDepth Batch data or depth
 * @returns Batch total capcity in bytes
 */
declare function getBatchCapacity(batch: PostageBatch): number;
declare function getBatchCapacity(depth: number): number;
/**
 * Get batch utilization in percentage (0-1)
 *
 * @param batch Batch data
 * @returns Batch percent usage
 */
declare const getBatchPercentUtilization: (batch: Pick<PostageBatch, "utilization" | "depth" | "bucketDepth">) => number;
/**
 * Calculates the Utilization Rate (%) from a given Batch Depth
 * using a logistic function approximation.
 *
 * @param depth - Batch depth (typically between 17 and 41)
 * @returns Utilization Rate as a percentage (0 to 1)
 */
declare function getBatchUtilizationRate(depth: number): number;
/**
 * Get the batch expiration day
 *
 * @param batch Batch data
 * @returns Expiration dayjs object
 */
declare const getBatchExpiration: (batch: PostageBatch) => "unlimited" | Date;
/**
 * Convert TTL to batch amount
 *
 * @param ttl TTL in seconds
 * @param price Token price
 * @param blockTime Chain blocktime
 * @returns Batch amount (PLUR / block / chunk)
 */
declare const ttlToAmount: (ttl: number, price: string, blockTime: number) => bigint;
/**
 * Calc transaction price from depth & amount
 *
 * @param depth Batch depth
 * @param amount Batch amount
 * @returns Price in BZZ
 */
declare const calcAmountPrice: (depth: number, amount: bigint | string) => {
    bzz: number;
} | null;
/**
 * Calculate the batch TTL after a dilute
 *
 * @param currentTTL Current batch TTL
 * @param currentDepth Current batch depth
 * @param newDepth New batch depth
 * @returns The projected batch TTL
 */
declare const calcDilutedTTL: (currentTTL: number, currentDepth: number, newDepth: number) => number;
interface ExpandAmountOpts {
    price: string;
    blockTime: number;
}
/**
 * Calculate the amount needed to expand a postage batch (same TTL as the current one)
 * @param batch Batch data
 * @param newDepth New batch depth
 * @param opts Options object with price and blockTime
 * @returns Amount in BZZ needed to expand the batch
 */
declare function calcExpandAmount(batch: PostageBatch, newDepth: number, opts: ExpandAmountOpts): bigint;
/**
 * Calculate the amount needed to expand a postage batch (dilute and/or increase TTL)
 * @param batch Postage batch data
 * @param newDepth New batch depth
 * @param desiredTTL Desired TTL in seconds (must be greater than current batch TTL)
 * @param opts Options object with price and blockTime
 * @returns Amount in BZZ needed to expand the batch
 */
declare function calcExpandAmount(batch: PostageBatch, newDepth: number, desiredTTL: number, opts: ExpandAmountOpts): bigint;

/**
 * Convert blurhash to data URL image
 *
 * @param hash Blurhash string
 * @returns Data URL image
 */
declare function blurHashToDataURL(hash: string | null | undefined): string;
/**
 * Convert image to blurhash
 *
 * @param image Image buffer
 * @param imageWidth Output image width
 * @param imageHeight Output image height
 * @returns Blurhash string
 */
declare function imageToBlurhash(image: Uint8Array, imageWidth: number, imageHeight: number): Promise<string>;

/**
 * Calculate a Binary Merkle Tree hash for a chunk
 *
 * The BMT chunk address is the hash of the 8 byte span and the root
 * hash of a binary Merkle tree (BMT) built on the 32-byte segments
 * of the underlying data.
 *
 * If the chunk content is less than 4k, the hash is calculated as
 * if the chunk was padded with all zeros up to 4096 bytes.
 *
 * @param chunkContent Chunk data including span and payload as well
 *
 * @returns the keccak256 hash in a byte array
 */
declare function bmtHash(chunkContent: Uint8Array): Uint8Array;
/**
 * Calculate the root hash of a Binary Merkle Tree (BMT) for the given payload.
 *
 * @param payload The payload data as a Uint8Array.
 * @returns The root hash of the BMT as a Uint8Array.
 */
declare function bmtRootHash(payload: Uint8Array): Uint8Array;

/**
 * Get the array buffer of a file
 *
 * @param file File to convert
 * @returns The array buffer data
 */
declare function fileToBuffer(file: File | Blob): Promise<ArrayBuffer>;
/**
 * Get the array buffer of a file
 *
 * @param file File to convert
 * @returns The array buffer data
 */
declare function fileToUint8Array(file: File | Blob): Promise<Uint8Array<ArrayBuffer>>;
/**
 * Convert a file to a data URL string
 *
 * @param file File to convert
 * @returns The base64 data URL
 */
declare function fileToDataURL(file: File | Blob): Promise<string>;
/**
 * Convert a buffer to a File object
 *
 * @param buffer Buffer to convert
 * @param contentType Mime type of the array buffer
 * @returns The file object
 */
declare function bufferToFile(buffer: ArrayBuffer | Uint8Array, contentType?: string): File;
/**
 * Convert a buffer to a data URL string
 *
 * @param buffer Buffer to convert
 * @returns The base64 data URL
 */
declare function bufferToDataURL(buffer: ArrayBuffer | Uint8Array): Promise<string>;
/**
 * Convert a string to bae64
 *
 * @param str String to convert
 * @returns The base64 string
 */
declare function stringToBase64(str: string): string;

/**
 * Verify if passed data are Bytes and if the array has "length" number of bytes under given offset.
 *
 * @param data
 * @param offset
 * @param length
 */
declare function hasBytesAtOffset(data: unknown, offset: number, length: number): boolean;
/**
 * Finds starting index `searchFor` in `element` Uin8Arrays
 *
 * If `searchFor` is not found in `element` it returns -1
 *
 * @param element
 * @param searchFor
 * @returns starting index of `searchFor` in `element`
 */
declare function findIndexOfArray(element: Uint8Array, searchFor: Uint8Array): number;
/**
 * It returns the common bytes of the two given byte arrays until the first byte difference
 *
 * @param a
 * @param b
 * @returns
 */
declare function commonBytes(a: Uint8Array, b: Uint8Array): Uint8Array;
/**
 * Returns a new byte array filled with zeroes with the specified length
 *
 * @param length The length of data to be returned
 */
declare function makeBytes(length: number): Uint8Array;
/**
 * Helper function for serialize byte arrays
 *
 * @param arrays Any number of byte array arguments
 */
declare function serializeBytes(...arrays: Uint8Array[]): Uint8Array;
/**
 * Returns true if two byte arrays are equal
 *
 * @param a Byte array to compare
 * @param b Byte array to compare
 */
declare function bytesEqual(a: Uint8Array, b: Uint8Array): boolean;
/**
 * Overwrites `a` bytearrays elements with elements of `b` starts from `i`
 *
 * @param a Byte array to overwrite
 * @param b Byte array to copy
 * @param i Start index
 */
declare function overwriteBytes(a: Uint8Array, b: Uint8Array, i?: number): void;
/**
 * Flattens the given array that consist of Uint8Arrays.
 */
declare function flattenBytesArray(bytesArray: Uint8Array[]): Uint8Array;
/**
 * Checks if the given bytes array has the specified length.
 *
 * @param bytes The bytes array to check
 * @param length The expected length of the bytes array
 */
declare function checkBytes<Length extends number>(bytes: unknown, length: number): asserts bytes is Bytes$1<Length>;

/**
 * Encrypts the given data using the provided password.
 *
 * @param data The data to be encrypted.
 * @param password The password used for encryption.
 * @returns The encrypted data as a string.
 */
declare function encryptData(data: string, password: string): string;
/**
 * Decrypts the given data using the provided password.
 *
 * @param data The data to be decrypted.
 * @param password The password used for decryption.
 * @returns The decrypted data as a string.
 */
declare function decryptData(data: string, password: string): string;
/**
 *
 * runs a XOR operation on data, encrypting it if it
 * hasn't already been, and decrypting it if it has, using the key provided.
 *
 * @param key
 * @param data
 * @param startIndex
 * @param endIndex
 * @returns
 */
declare function encryptDecrypt(key: Uint8Array, data: Uint8Array, startIndex?: number, endIndex?: number): void;

declare global {
    interface ExternalProvider {
        _state?: {
            accounts: string[] | null;
            initialized: boolean;
            isConnected: boolean;
            isPermanentlyDisconnected: boolean;
            isUnlocked: boolean;
        };
        isMetaMask?: boolean;
        autoRefreshOnNetworkChange?: boolean;
        chainId?: string;
        networkVersion?: string;
        selectedAddress?: string;
        on?(event: "accountsChanged", callback: (accounts: string[]) => void): void;
        on?(event: "chainChanged", callback: (chainId: string) => void): void;
        on?(event: "connect", callback: (connectInfo: any) => void): void;
        on?(event: "disconnect", callback: (error: ProviderRpcError) => void): void;
        removeListener?(event: string, callback: Function): void;
        isConnected?(): Promise<boolean>;
        enable?(): Promise<string[]>;
        sendAsync?: (request: {
            method: string;
            params?: Array<any>;
        }, callback: (error: any, response: any) => void) => void;
        send?: (request: {
            method: string;
            params?: Array<any>;
        }, callback: (error: any, response: any) => void) => void;
        request?: (request: {
            method: string;
            params?: Array<any>;
        }) => Promise<any>;
    }
    interface ProviderRpcError extends Error {
        message: string;
        code: number;
        data?: unknown;
    }
    interface Window {
        ethereum?: ExternalProvider;
    }
}
/**
 * Sign a message with the user wallet
 *
 * @param digest Hex string of the message
 * @param address Signing address
 * @returns Signed hash
 */
declare const signMessage: (digest: string | Uint8Array, address: string) => Promise<string>;
/**
 * Covert an ETH address to bytes
 *
 * @param address Full address string (eg: 0xab...)
 * @returns The address bytes
 */
declare const addressBytes: (address: string) => Uint8Array<ArrayBuffer>;
/**
 * Check if a string a valid eth address
 *
 * @param address Address string value
 */
declare const checkIsEthAddress: (address: string | null | undefined) => boolean;
/**
 * Get the shorten string of a address
 *
 * @param address Address string value
 */
declare const shortenEthAddr: (address: string | null | undefined) => string;
/**
 * Check if a provider is injected by the browser
 *
 * @param provider Web3 provider
 */
declare const checkUsingInjectedProvider: (provider: any) => boolean;
/**
 * Fetch the wallet accounts
 */
declare const fetchAccounts: () => Promise<any>;
/**
 * Switch the wallet account
 */
declare const switchAccount: (address: string) => Promise<any>;
/**
 * Check if the wallet is locked
 */
declare const checkWalletLocked: () => boolean;
/**
 * Get the network name from the id
 *
 * @param networkId Id of the networks
 */
declare const getNetworkName: (networkId: number | string | undefined) => "" | "Main" | "Morder" | "Ropsten" | "Rinkeby" | "Kovan" | "Unknown";

declare const bytesToHex: (bytes: _noble_secp256k1.Bytes) => string;
declare const hexToBytes: (hex: string) => _noble_secp256k1.Bytes;

declare function keccak256Hash(...messages: Message[]): Bytes$1<32>;
declare function fromHexString(hexString: string): Uint8Array;
declare function toHexString(bytes: Uint8Array): string;
/**
 * Creates unprefixed hex string from wide range of data.
 *
 * @param input
 */
declare function makeHexString(input: string | number | Uint8Array | EthAddress): string;

declare global {
    interface HTMLCanvasElement {
        msToBlob(): Blob;
    }
}
/**
 * Resize an image
 *
 * @param imageBlob Image file to resize
 * @param toWidth Scaled width
 * @param quality Image quality (0-100)
 * @returns The resized image blob
 */
declare function resizeImage(imageBlob: File | Blob, toWidth: number, quality?: number): Promise<Blob>;
/**
 * Get the image type from the file name
 *
 * @param fileName The file name
 * @returns The image type
 */
declare function isImageTypeSupported(type: ImageType): boolean;
/**
 * Get the image metadata from the image data
 *
 * @param data The image data
 * @returns The image metadata
 */
declare function getImageMeta(data: Uint8Array | ArrayBuffer): Promise<{
    width: number;
    height: number;
    type: ReturnType<typeof getImageTypeFromData>;
}>;
/**
 * Get the image type from the image data
 *
 * @param data The image data
 * @returns The image type
 */
declare function getImageTypeFromData(data: Uint8Array | ArrayBuffer): "jpeg" | "png" | "webp" | "avif" | "gif" | "svg";
/**
 * Check if the browser supports the AVIF image format
 *
 * @returns true if AVIF is supported, false otherwise
 */
declare function isAvifSupported(): boolean;
/**
 * Check if the browser supports the WebP image format
 *
 * @returns true if WebP is supported, false otherwise
 */
declare function isWebpSupported(): boolean;

/**
 * Throws an error if the given nodes properties are not equal
 *
 * @param a Mantaray node to compare
 * @param b Mantaray node to compare
 * @param accumulatedPrefix accumulates the prefix during the recursion
 * @throws Error if the two nodes properties are not equal recursively
 */
declare const equalNodes: (a: MantarayNode, b: MantarayNode, accumulatedPrefix?: string) => void | never;
/**
 * Get the reference from bytes data
 *
 * @param data The data
 * @returns The reference
 */
declare function getReferenceFromData(data: Uint8Array): Reference;
/**
 * Get the reference from json data
 *
 * @param data The data
 * @returns The reference
 */
declare function jsonToReference(content: object): BytesReference;
/**
 * Get the reference from text data
 *
 * @param data The data
 * @returns The reference
 */
declare function textToReference(content: string): BytesReference;
/**
 * Encode the path to bytes
 *
 * @param data The path
 * @returns The bytes
 */
declare function encodePath(path: string): Uint8Array;
/**
 * Decode the path from bytes
 *
 * @param data The bytes
 * @returns The path
 */
declare function decodePath(path: Uint8Array): string;
/**
 * Check if the reference is zero bytes
 *
 * @param ref The reference
 * @returns True if the reference is zero bytes
 */
declare function isZeroBytesReference(ref: BytesReference | Reference): boolean;
/**
 * Get all paths from the mantaray node
 *
 * @param node The mantaray node
 * @returns The paths in a nested object
 */
declare function getAllPaths(node: MantarayNode): Record<string, MantarayNode>;
/**
 * Find all nodes with a prefix
 *
 * @param node The mantaray node
 * @param prefix The prefix to search for
 * @returns An array of nodes with the prefix
 */
declare function getNodesWithPrefix(node: MantarayNode, prefix: string): MantarayNode[];
/**
 * The hash length has to be 31 instead of 32 that comes from the keccak hash function
 */
declare function serializeVersion(version: MarshalVersion): Bytes$1<31>;
declare function serializeReferenceLength(entry: BytesReference): Bytes$1<1>;
/**
 * Checks for separator character in the node and its descendants prefixes
 */
declare function checkForSeparator(node: MantarayNode): boolean;
declare function getBzzNodeInfo(reference: Reference, beeClient: BeeClient, signal?: AbortSignal): Promise<{
    entry: BytesReference;
    contentType?: string;
} | null>;

interface VideoMeta {
    duration: number;
    width: number;
    height: number;
}
/**
 * Get the video metadata
 *
 * @param url The video url
 * @param data The video bytes
 * @returns The video metadata
 */
declare function getVideoMeta(url: string): Promise<VideoMeta>;
declare function getVideoMeta(data: Uint8Array): Promise<VideoMeta>;
/**
 * Get the video bitrate
 *
 * @param size Video size in bytes
 * @param duration Video duration in seconds
 * @returns The video bitrate
 */
declare function getBitrate(size: number, duration: number): number;
declare enum BitrateCompressionRate {
    none = 1,
    low = 2,
    normal = 4,
    high = 8
}
/**
 * Get the HLS video bitrate from resolution
 *
 * @param width Video resolution width
 * @param height Video resolution height
 * @returns The video bitrate
 */
declare function getHlsBitrate(width: number, height: number, compressionRate?: BitrateCompressionRate): number;

/**
 * `structuredClone` 'clone' that works with proxies also
 *
 * @param obj The object to clone
 * @returns The cloned object
 */
declare function structuredClone<T>(obj: T): T;

/**
 * Check if the given string is a valid swarm reference
 *
 * @param reference The reference to check
 * @returns True if the reference is valid
 */
declare function isValidReference(reference: string): reference is Reference;
/**
 * Check if the given reference is an empty reference
 *
 * @param ref The reference to check
 * @returns True if the reference is empty
 */
declare function isEmptyReference(ref: Reference): boolean;
/**
 * Check if the given reference is an invalid reference
 *
 * @param ref The reference to check
 * @returns True if the reference is invalid
 */
declare function isInvalidReference(ref: string): boolean;
/**
 * Check if the given bytes reference are valid
 *
 * @param ref The bytes reference to check
 * @returns True if the reference is valid
 */
declare function checkBytesReference(ref: BytesReference): void | never;
/**
 * Convert a reference to a bytes reference
 *
 * @param ref The reference
 * @returns The bytes reference
 */
declare function referenceToBytesReference(ref: Reference): BytesReference;
/**
 * Convert a bytes reference to a reference
 *
 * @param ref The bytes reference
 * @returns The reference
 */
declare function bytesReferenceToReference(ref: BytesReference | ChunkAddress): Reference;
/**
 * Make a bytes reference from a reference
 *
 * @param reference The reference
 * @returns The bytes reference
 */
declare function makeBytesReference(reference: string): Uint8Array;
/**
 * Parse a swarm url and return the reference
 *
 * @param bzzUrl The swarm url
 * @returns The reference
 */
declare function getReferenceFromUrl(bzzUrl: string): Reference;

/**
 * Creates a singer object that can be used when the private key is known.
 *
 * @param privateKey The private key
 */
declare function makePrivateKeySigner(privateKey: string): Signer;
declare function makeInjectedWalletSigner(address: EthAddress): Signer;
/**
 * The default signer function that can be used for integrating with
 * other applications (e.g. wallets).
 *
 * @param data The data to be signed
 * @param privateKey  The private key used for signing the data
 */
declare function defaultSign(data: Uint8Array | string, privateKey: Uint8Array): Promise<string>;
/**
 * Recovers the ethereum address from a given signature.
 *
 * Can be used for verifying a piece of data when the public key is
 * known.
 *
 * @param signature The signature
 * @param digest The digest of the data
 *
 * @returns the recovered address
 */
declare function recoverAddress(signature: Uint8Array, digest: Uint8Array): Uint8Array;

/**
 * Slugify a string
 *
 * @param str String to slugify
 * @param connector Character to use as connector
 * @returns Slugified string
 */
declare function slugify(str: string, connector?: string): string;

/**
 * Converts a timestamp in seconds to a date
 *
 * @param timestamp The timestamp in seconds
 * @returns The date
 */
declare function timestampToDate(timestamp: number): Date;
/**
 * Converts a date to a timestamp in seconds
 *
 * @param date The date to convert
 * @returns The timestamp in seconds
 */
declare function dateToTimestamp(date: Date): number;

/**
 * Convert bytes data to a number in big endian format.
 *
 * @param bytes The bytes data
 * @returns The number
 */
declare function fromBigEndian(bytes: Uint8Array): number;
/**
 * Convert a uint16 integer to a big endian bytes.
 *
 * @param value The uint16 integer
 * @returns The big endian bytes
 */
declare function toBigEndianFromUint16(value: number): Bytes$1<2>;
/**
 * Convert a uint32 integer to a big endian bytes.
 *
 * @param value The uint32 integer
 * @returns The big endian bytes
 */
declare function toBigEndianFromUint32(value: number): Bytes$1<4>;
/**
 * Convert a uint64 integer to a big endian bytes.
 *
 * @param value The uint64 integer
 * @returns The big endian bytes
 */
declare function toBigEndianFromBigInt64(value: bigint): Bytes$1<8>;
/**
 * Convert a uint64 integer to a little endian bytes.
 *
 * @param value The uint64 integer
 * @param bytes The bytes to write to
 * @returns The little endian bytes
 *
 * TODO: handle bigger values than 32 bit
 * For now it's good enough because we only use these functions
 * sequential feed indexes.
 */
declare function writeUint64LittleEndian(value: number, bytes?: Uint8Array): Uint8Array;
/**
 * Convert a uint64 integer to a big endian bytes.
 *
 * @param value The uint64 integer
 * @param bytes The bytes to write to
 * @returns The big endian bytes
 */
declare function writeUint64BigEndian(value: number, bytes?: Uint8Array): Uint8Array;
/**
 * Read a uint64 integer from a big endian bytes.
 *
 * @param bytes The big endian bytes
 * @returns The uint64 integer
 */
declare function readUint64BigEndian(bytes: Uint8Array): number;

/**
 * Compose a url by host & path
 *
 * @param host Url host
 * @param path Url path
 * @returns Full composed url
 */
declare function composeUrl(host: string, path?: string): string;
/**
 * Convert unsafe url string to a safe version
 * to be used in URL class
 *
 * @param url Url to convert
 * @param path Path to append (optional)
 * @returns The safe URL object
 */
declare function safeURL(url: string | null | undefined, path?: string): URL | null;
/**
 * Check if url is safe to use in URL class
 *
 * @param url Url to check
 * @param path Path to append
 * @returns True if safe
 */
declare function isSafeURL(url: string | null | undefined, path?: string): boolean;
/**
 * Get the url origin
 *
 * @param baseUrl Reference url
 * @returns The url origin
 */
declare function urlOrigin(baseUrl: string): string | undefined;
/**
 * Get the url hostname
 *
 * @param baseUrl Reference url
 * @returns The url hostname
 */
declare function urlHostname(baseUrl: string): string | undefined;
/**
 * Get the url href
 *
 * @param baseUrl Reference url
 * @param path Path to append (optional)
 * @returns The url href
 */
declare function urlPath(baseUrl: string, path?: string): string | undefined;

export { ADDRESS_HEX_LENGTH, AVATAR_PATH_FORMAT, AVATAR_SIZES, type AggregatedPaginatedResult, type AuthenticationOptions, BATCH_ID_HEX_LENGTH, BRANCHES, BUCKET_DEPTH, BaseManifest, type BaseManifestDownloadOptions, type BaseManifestOptions, type BaseManifestUploadOptions, BaseMantarayManifest, type BaseMantarayManifestDownloadOptions, BaseProcessor, type BaseProcessorUploadOptions, type BatchId, BatchIdSchema, type BeeAddress, BeeAddressSchema, type BeeChain, BeeClient, type BeeClientOptions, BeeReferenceSchema, BeeSafeReferenceSchema, BirthdaySchema, BitrateCompressionRate, type BucketCollisions, type BucketId, type BytesReference, CAC_PAYLOAD_OFFSET, CAC_SPAN_OFFSET, CHAIN_BLOCK_TIME, CHANNEL_PLAYLIST_ID, CHUNK_SIZE, COVER_PATH_FORMAT, COVER_SIZES, CURRENT_VIDEO_MANIFEST_VERSION, ChunksUploader, type ChunksUploaderOptions, type ContentAddressedChunk, type CreditBalance, type CreditClientOptions, type CreditLog, type Data, ENCRYPTED_REFERENCE_BYTES_LENGTH, ENCRYPTED_REFERENCE_HEX_LENGTH, ETHERNA_MAX_BATCH_DEPTH, ETHERNA_WELCOME_BATCH_DEPTH, ETHERNA_WELCOME_POSTAGE_LABEL, EmptyAddress, EmptyReference, type EnsAddress, EnsAddressSchema, EpochFeed, EpochFeedChunk, EpochIndex, type ErrorCode, ErrorCodes, type EthAddress, EthAddressSchema, EthSafeAddressSchema, EthernaCreditClient, type EthernaGatewayBatch, type EthernaGatewayBatchPreview, type EthernaGatewayChainState, type EthernaGatewayCredit, type EthernaGatewayCurrentUser, type EthernaGatewayPin, type EthernaGatewayWelcomeStatus, EthernaIndexAggregatorClient, EthernaIndexClient, EthernaSSOClient, EthernaSdkError, FEED_INDEX_HEX_LENGTH, type FeedInfo, type FeedType, type FeedUpdateHeaders, type FeedUpdateOptions, type FeedUploadOptions, type FileDownloadOptions, type FileUploadOptions, FolderBuilder, type FolderBuilderConfig, type FolderEntryDirectory, type FolderEntryFile, FolderExplorer, type FolderExplorerEntry, type FolderExplorerOptions, type ForkMapping, HASH_SIZE, IDENTIFIER_SIZE, type IIndexClientInterface, type Image, type ImageLegacySources, ImageLegacySourcesSchema, ImageProcessor, type ImageProcessorOptions, ImageSchema, type ImageSize, ImageSizeSchema, type ImageSource, ImageSourceBaseSchema, ImageSourceSchema, type ImageSources, ImageSourcesSchema, type ImageType, ImageTypeSchema, type Index, type IndexAggregatorClientOptions, type IndexAggregatorRequestOptions, type IndexClientOptions, type IndexCurrentUser, type IndexEncryptionType, type IndexParameters, type IndexUser, type IndexUserVideos, type IndexVideo, type IndexVideoComment, type IndexVideoCreation, type IndexVideoManifest, type IndexVideoPreview, type IndexVideoValidation, MANIFEST_DETAILS_PATH, MANIFEST_PREVIEW_PATH, MAX_CHUNK_PAYLOAD_SIZE, MAX_PAYLOAD_SIZE, MAX_SPAN_LENGTH, MIN_PAYLOAD_SIZE, MantarayEntryMetadataContentTypeKey, MantarayEntryMetadataFeedOwnerKey, MantarayEntryMetadataFeedTopicKey, MantarayEntryMetadataFeedTypeKey, MantarayEntryMetadataFilenameKey, MantarayFork, MantarayForkSchema, MantarayIndexBytes, MantarayNode, MantarayNodeSchema, MantarayRootPath, MantarayWebsiteErrorDocumentPathKey, MantarayWebsiteIndexDocumentPathKey, type MarshalVersion, type MetadataMapping, NonEmptyRecordSchema, PROFILE_TOPIC, PSS_TARGET_HEX_LENGTH_MAX, PUBKEY_HEX_LENGTH, type PaginatedResult, type Playlist, type PlaylistDetails, PlaylistDetailsSchema, type PlaylistIdentification, PlaylistManifest, type PlaylistManifestUploadOptions, type PlaylistPreview, PlaylistPreviewSchema, type PlaylistThumb, PlaylistThumbSchema, type PlaylistType, PlaylistTypeEncryptedSchema, PlaylistTypeSchema, PlaylistTypeVisibleSchema, type PlaylistVideo, PlaylistVideoSchema, type PostageBatch, type PostageBatchBucket, type PostageBatchBucketsData, type ProcessorOutput, type Profile, type ProfileDetails, ProfileDetailsSchema, ProfileManifest, type ProfileManifestInit, type ProfilePreview, ProfilePreviewSchema, type PublishResultStatus, type PublishSource, type PublishSourceIndex, type PublishSourcePlaylist, Queue, type QueueOptions, REFERENCE_BYTES_LENGTH, REFERENCE_HEX_LENGTH, type ReadableMantarayNode, type RecursiveSaveReturnType, type RedundancyLevel, RedundancyLevels, RedundancyStrategies, type RedundancyStrategy, type Reference, type ReferenceResponse, type RequestDownloadOptions, type RequestOptions, type RequestUploadOptions, SAVED_PLAYLIST_ID, SECTION_SIZE, SEGMENT_PAIR_SIZE, SEGMENT_SIZE, SIGNATURE_SIZE, SOC_IDENTIFIER_OFFSET, SOC_PAYLOAD_OFFSET, SOC_SIGNATURE_OFFSET, SOC_SPAN_OFFSET, SPAN_SIZE, type SSOClientOptions, type SSOIdentity$1 as SSOIdentity, STAMPS_DEPTH_MAX, STAMPS_DEPTH_MIN, type SchemaVersion, SchemaVersionSchema, type Signer, type SingleOwnerChunk, SlicedStringSchema, StampCalculator, type StorageHandler, type StorageLoader, type StorageSaver, TAGS_LIMIT_MAX, TAGS_LIMIT_MIN, THUMBNAIL_PATH_FORMAT, THUMBNAIL_SIZES, type Tag, TimestampSchema, USER_FOLLOWINGS_TOPIC, USER_PLAYLISTS_TOPIC, UserFollowingsManifest, type UserPlaylists, UserPlaylistsManifest, UserPlaylistsSchema, type Video, type VideoCaption, VideoCaptionSchema, type VideoDetails, VideoDetailsSchema, VideoManifest, type VideoPreview, VideoPreviewSchema, type VideoProcessedOutput, VideoProcessor, type VideoProcessorOptions, type VideoProcessorOutputOptions, VideoPublisher, type VideoPublisherOptions, type VideoPublisherSyncResult, type VideoPublisherUploadOptions, type VideoQuality, type VideoSource, VideoSourceSchema, type VoteValue, ZeroHashReference, addressBytes, blurHashToDataURL, bmtHash, bmtRootHash, bufferToDataURL, bufferToFile, bytesEqual, bytesReferenceToReference, bytesToHex, calcAmountPrice, calcBatchMinDepth, calcDilutedTTL, calcExpandAmount, checkBytes, checkBytesReference, checkForSeparator, checkIsEthAddress, checkUsingInjectedProvider, checkWalletLocked, commonBytes, composeUrl, createPlaylistTopicName, dateToTimestamp, decodePath, decryptData, defaultSign, encodePath, encryptData, encryptDecrypt, equalNodes, fetchAccounts, fetchAddressFromEns, fetchEnsFromAddress, fileToBuffer, fileToDataURL, fileToUint8Array, findIndexOfArray, flattenBytesArray, fromBigEndian, fromHexString, getAllPaths, getBatchCapacity, getBatchExpiration, getBatchPercentUtilization, getBatchSpace, getBatchUtilizationRate, getBitrate, getBzzNodeInfo, getHlsBitrate, getImageMeta, getImageTypeFromData, getNetworkName, getNodesWithPrefix, getReferenceFromData, getReferenceFromUrl, getSdkError, getVideoMeta, hasBytesAtOffset, hexToBytes, imageToBlurhash, isAvifSupported, isEmptyReference, isEnsAddress, isEthAddress, isImageTypeSupported, isInvalidReference, isSafeURL, isValidReference, isWebpSupported, isZeroBytesReference, jsonToReference, keccak256Hash, makeBytes, makeBytesReference, makeHexString, makeInjectedWalletSigner, makePrivateKeySigner, overwriteBytes, readUint64BigEndian, recoverAddress, referenceToBytesReference, resizeImage, safeURL, serializeBytes, serializeReferenceLength, serializeVersion, shortenEthAddr, signMessage, slugify, splitArrayInChunks, stringToBase64, structuredClone, switchAccount, textToReference, throwSdkError, timestampToDate, toBigEndianFromBigInt64, toBigEndianFromUint16, toBigEndianFromUint32, toEthAccount, toHexString, ttlToAmount, urlHostname, urlOrigin, urlPath, writeUint64BigEndian, writeUint64LittleEndian };
