import type { Component } from 'vue';
import type { Effect, Schema } from 'effect';
import type { Environment } from '../../../vendor/cel-js/lib/index.js';
import type { CelEvaluator } from '../../../share/interpolate.js';
import type { ChainStep, OperationHandlers } from '../../../share/event-bus.js';
type AnySchema = Schema.Schema<any, any, never>;
type SchemaFactory = (configure: (env: Environment) => void) => AnySchema;
/** Context a host supplies when wiring operation handlers into its channel. */
export type OperationContext = Readonly<{
    /** Evaluator for any CEL in an operation's params (host's bindings). */
    cel: CelEvaluator;
    /** Current UI locale, read live (handlers may run long after wiring). */
    locale: () => string;
    /**
     * This invocation's window onto its trigger chain — read earlier steps'
     * outputs, publish this step's own. Per-request (stamped by
     * `dispatchTriggers`, never by the host), so it is absent at wiring time and
     * outside a trigger chain. Handlers must tolerate the absent case.
     */
    step?: ChainStep;
}>;
/**
 * The generic behaviour of a parameterized operation. Infallible on the error
 * channel like every `OperationHandlers` entry; a handler MAY halt the trigger
 * chain via `Effect.die` (the guard shape — e.g. an alert whose user cancels).
 */
export type OperationHandler = (params: unknown, ctx: OperationContext) => Effect.Effect<void>;
export type OperationMetadata = Readonly<{
    name: string;
    icon: string;
    /**
     * Present iff this operation publishes a chain-step output (`ctx.step.publish`)
     * for later trigger rows to read via `steps["<row-id>"]` — the value is the
     * designer-facing label of what gets published (e.g. 'HTTP 响应'). The trigger
     * editor reads it to decide which rows to offer as step references, so a
     * non-publishing op never advertises a reference that resolves to nothing.
     */
    output?: string;
}>;
export type OperationEntry = Readonly<{
    type: string;
    compatibilityDate: string;
    metadata: OperationMetadata;
    schema: SchemaFactory;
    defaults?: () => Record<string, unknown>;
    config: Component;
    handler: OperationHandler;
}>;
export declare const OPERATIONS: ReadonlyArray<OperationEntry>;
export declare function findOperation(type: string, compatibilityDate: string): OperationEntry | undefined;
/**
 * Build the `OperationHandlers` for a host's `provideEventTarget`, one per
 * parameterized operation the host declares it exposes. Each handler keys on
 * the operation `type` (what the trigger stores as `operation`) and forwards
 * the request's `params` to the registered `handler` with `ctx`. Unknown
 * refs are skipped. Hosts merge the result with any bespoke param-less
 * handlers (e.g. the page's `close`).
 *
 * When the request carries an emit-site evaluator (`request.cel`, the
 * dispatching button's own scope), it overrides `ctx.cel` for that one call —
 * so a handler's CEL-bearing params resolve where they were authored (the
 * button, with `row` live) instead of against the host. Handlers read `ctx.cel`
 * unchanged; the swap is invisible to them. Falls back to the host's evaluator
 * when the emitter supplied none.
 */
export declare function operationHandlers(exposed: ReadonlyArray<{
    type: string;
    compatibilityDate: string;
}>, ctx: OperationContext): OperationHandlers;
export {};
