/**
 * Pull Stream
 *
 * A stream that allows pulling data from internal buffer with pattern matching.
 * Works identically in both browser and Node.js environments.
 */
import { EventEmitter } from "./event-emitter.js";
import type { PullStreamOptions } from "./types.js";
export type { PullStreamOptions } from "./types.js";
/**
 * Browser-compatible Pull Stream - Read data from buffer on demand with pattern matching
 */
export declare class PullStream extends EventEmitter {
    private _buffer;
    private _bufferReadIndex;
    private _bufferWriteIndex;
    protected finished: boolean;
    protected _match?: number;
    private _destroyed;
    constructor(_options?: PullStreamOptions);
    protected get buffer(): Uint8Array;
    protected set buffer(buf: Uint8Array);
    /**
     * Write data to the stream
     */
    write(chunk: Uint8Array): boolean;
    /**
     * Signal end of input
     */
    end(chunk?: Uint8Array): void;
    /**
     * Destroy the stream
     */
    destroy(error?: Error): void;
    /**
     * Pull exactly N bytes from buffer, or pull until pattern is found
     */
    pull(size: number): Promise<Uint8Array>;
    pull(pattern: Uint8Array, includePattern?: boolean): Promise<Uint8Array>;
    /**
     * Pull until pattern is found (alias for pull(pattern, includePattern))
     */
    pullUntil(pattern: Uint8Array, includePattern?: boolean): Promise<Uint8Array>;
    private _pullSize;
    private _pullPattern;
    /**
     * Get the match position from last pattern match
     */
    get matchPosition(): number | undefined;
    /**
     * Get remaining buffer length
     */
    get length(): number;
    /**
     * Check if stream is finished
     */
    get isFinished(): boolean;
    /**
     * Check if stream is destroyed
     */
    get destroyed(): boolean;
    /**
     * Find pattern in Uint8Array (like Buffer.indexOf)
     */
    private _indexOf;
}
