import { Cache, StateObject } from "@hpcc-js/util";
import { IConnection, IOptions } from "../connection.ts";
import { WsDfu } from "../services/wsDFU.ts";
import { WorkunitsService, WsWorkunits } from "../services/wsWorkunits.ts";
import { XSDSchema, XSDXMLNode } from "./xsdParser.ts";
export declare class GlobalResultCache extends Cache<{
    BaseUrl: string;
    Wuid: string;
    ResultName: string;
}, Result> {
    constructor();
}
export type ResultFilter = {
    [key: string]: string | number;
};
export interface ECLResultEx extends WsWorkunits.ECLResult {
    Wuid: string;
    ResultName?: string;
    ResultSequence?: number;
    LogicalFileName?: string;
    NodeGroup?: string;
    ResultViews: string[];
}
export interface WUResultResponseEx {
    Exceptions: WsWorkunits.Exceptions;
    Wuid: string;
    Sequence: WsWorkunits.int;
    LogicalName: string;
    Cluster: string;
    Name: string;
    Start: WsWorkunits.long;
    Requested: WsWorkunits.int;
    Count: WsWorkunits.int;
    Total: WsWorkunits.long;
    Result: {
        [key: string]: any[];
    } & {
        XmlSchema?: {
            xml: string;
        };
    };
}
export type UResulState = ECLResultEx & WsDfu.DFULogicalFile;
export type IResulState = ECLResultEx | WsDfu.DFULogicalFile;
export declare class Result extends StateObject<UResulState, IResulState> implements ECLResultEx {
    protected connection: WorkunitsService;
    protected _bypassCache: boolean;
    get BaseUrl(): string;
    protected xsdSchema: XSDSchema;
    get properties(): WsWorkunits.ECLResult;
    get Wuid(): string;
    get ResultName(): string | undefined;
    get ResultSequence(): number | undefined;
    get LogicalFileName(): string | undefined;
    get Name(): string;
    get Sequence(): number;
    get Value(): string;
    get Link(): string;
    get FileName(): string;
    get IsSupplied(): boolean;
    get ShowFileContent(): boolean;
    get Total(): number;
    get ECLSchemas(): WsWorkunits.ECLSchemas;
    get NodeGroup(): string;
    get ResultViews(): string[];
    get XmlSchema(): string;
    static attach(optsConnection: IOptions | IConnection | WorkunitsService, wuid: string, name: string): any;
    static attach(optsConnection: IOptions | IConnection | WorkunitsService, wuid: string, sequence: number): any;
    static attach(optsConnection: IOptions | IConnection | WorkunitsService, wuid: string, eclResult: WsWorkunits.ECLResult, resultViews: string[]): any;
    static attachLogicalFile(optsConnection: IOptions | IConnection | WorkunitsService, nodeGroup: string, logicalFile: string): Result;
    private constructor();
    private constructor();
    private constructor();
    private constructor();
    isComplete(): boolean;
    bypassCache(bypass?: boolean): boolean | this;
    private _fetchXMLSchemaPromise;
    fetchXMLSchema(refresh?: boolean): Promise<XSDSchema | null>;
    refresh(): Promise<this>;
    fetchRows(from?: number, count?: number, includeSchema?: boolean, filter?: ResultFilter, abortSignal?: AbortSignal, bypassCache?: boolean): Promise<any[]>;
    rootField(): XSDXMLNode | null;
    fields(): XSDXMLNode[];
    protected WUResult(start?: number, count?: number, suppressXmlSchema?: boolean, filter?: {
        [key: string]: string | number;
    }, abortSignal?: AbortSignal, bypassCache?: boolean): Promise<WUResultResponseEx>;
}
export declare class ResultCache extends Cache<WsWorkunits.ECLResult, Result> {
    constructor();
}
