import { Schema } from 'effect';
import { Environment } from '../vendor/cel-js/lib/index.js';
import { Locale } from './locale.js';
export type ResultType = string | string[] | ((type: string) => boolean);
/**
 * Result-type matcher for a request expression. A request expression may now
 * evaluate to `optional<HttpRequest>` — `None` means "no request, skip the
 * fetch" — letting authors fetch conditionally (e.g. only when a `form_id` is
 * present). For back-compat a bare `HttpRequest` still passes (always fetch).
 * `dyn` and `optional<dyn>` are accepted too; the runtime normalizer
 * (`asRequest`) treats any non-builder payload as `None` at dispatch time.
 *
 * Authors wrap both ternary branches in optionals, e.g.
 * `form_id == "" ? optional.none() : optional.of(http.get(url))`, which the
 * type-checker infers as `optional<HttpRequest>`.
 */
export declare const HttpRequestResult: ResultType;
/**
 * Type-check `expression` against `env` and, if `resultType` is given, verify the
 * inferred type satisfies it. Returns a Chinese error message, or `null` when the
 * expression is valid. This is the single chokepoint both the schema validator
 * (`Expression`'s filter) and the live `ExpressionEditor` call, so an inline
 * verdict can never disagree with the save-time decode.
 */
export declare function evaluateExpression(env: Environment, expression: string, resultType?: ResultType): string | null;
/**
 * Build a checking `Environment` from a flat list of `{ name, type }` variable
 * specs — the projection an `ExpressionEditor` already holds via its injected CEL
 * context plus `extraVars`. Functions/operators come free from the cloned
 * `globalRegistry`; only variables are host-scoped, so this is all the editor
 * needs to reproduce the schema's validation env. `__scopes__` is registered
 * canonically here (and skipped from `vars`) exactly as `Expression` does, so
 * cross-layer addressing type-checks in the editor too.
 */
export declare function buildCheckEnvironment(vars: Iterable<{
    name: string;
    type: string;
}>, options?: {
    unlistedVariablesAreDyn?: boolean;
}): Environment;
export declare function Expression(options: {
    configure: (env: Environment) => void;
    resultType?: ResultType;
    /**
     * Treat identifiers not registered by `configure` as `dyn` instead of
     * rejecting them. Needed when an expression references variables whose
     * names are user-defined and unknowable at schema-construction time
     * (e.g. the chart block's named data sources).
     */
    unlistedVariablesAreDyn?: boolean;
}): Schema.Schema<string, string>;
export declare function Markdown(options: {
    configure: (env: Environment) => void;
}): Schema.Schema<string, string>;
export declare function LocaleMarkdown(options: {
    configure: (env: Environment) => void;
}): Schema.filter<typeof Locale>;
