import * as z from 'zod';
import type { RuntimeApi } from './api';
import type { NodeMessage } from './types';
export type SendBuilder = {
    setTopic(topic: string): SendBuilder;
    getMessage(): Record<string, unknown>;
    /**
     * Payload is not deeply-merged with the input message payload,
     * but shallow-merged.
     */
    addPayload(payload: Record<string, any>): SendBuilder;
    sendToOutput(index: number): void;
};
export declare const NodeEnvConfig: z.ZodObject<{
    EWX_SOLUTION_ID: z.ZodOptional<z.ZodString>;
    EWX_SOLUTION_GROUP_ID: z.ZodOptional<z.ZodString>;
    EWX_WORKLOGIC_ID: z.ZodOptional<z.ZodString>;
    EWX_SQLITE_PATH: z.ZodOptional<z.ZodString>;
    EWX_WORKER_ADDRESS: z.ZodOptional<z.ZodString>;
    BASE_URL: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export declare const BaseUrlsConfig: z.ZodObject<{
    kafka_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
    kafka_proxy_url: z.ZodOptional<z.ZodString>;
    base_indexer_url: z.ZodOptional<z.ZodString>;
    rpc_url: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type NodeEnvConfig = z.infer<typeof NodeEnvConfig>;
export declare abstract class Node<T extends z.ZodObject<any, any> | z.ZodUnion<any>> {
    nodeConfig: unknown;
    messageZod: T;
    api: RuntimeApi;
    constructor(api: RuntimeApi, nodeConfig: unknown, // this is NodeDef from node-red, but let's keep it unknown for convenience (we add custom types there)
    messageZod: T, { validateMessage }?: {
        validateMessage?: boolean;
    });
    /**
     * Returns base_urls from a special endpoint maintained by EWF that contains configuration
     */
    getBaseUrls(): Promise<z.infer<typeof BaseUrlsConfig>>;
    /**
     * Returns parsed `.__envConfig` from node's config.
     * node's config, is basically one entry in flow.json
     * Marketplace will be injecting that property to each node before node-red start
     * Note, that if `.__envConfig` is injected that way, even the slightest node change (through node-red GUI) removes that property
     * because it is unknown to node-red.
     */
    getNodeEnvConfig(): NodeEnvConfig;
    /**
     * SendBuilder hides complexity of creating proper messages, and selecting output.
     * It is supposed to be used by all nodes to send messages to outputs
     * to ensure correct behavior.
     *
     * It uses message received on node input (passed manually), and then the payload should be only
     * >added< (not replaced!) to the input message. Optionally topic can be set.
     *
     * Note that if topic is not set explicitly, it will be removed (because topic is used
     * to describe what the node receiving it should do with the message, so it's not meant to be passed around
     * like message payload).
    */
    sendBuilder(inputMessage: NodeMessage<any>): SendBuilder;
    abstract onInput(message: z.infer<T>): void | Promise<void>;
    onDestroy?(): void | Promise<void>;
    handleMaybePromise<T>(maybePromiseCb: () => (T | Promise<T>), done: (err?: Error) => void): void;
}
