import type { ImportBase } from './import-base.js'; import type { ImportableSchemaBase } from './dsl.js'; import type { DtoField, DtoMessage, DtoArrayField, DtoObjectField } from './dto.js'; import type { ActionSchema } from './action.js'; import type { RefSchema } from './ref.js'; import type { EndpointSchema } from './endpoint.js'; /** Parameter data source for a call argument. */ export type DataRef = { type: 'route'; key: string; } | { type: 'data'; key: string; } | { type: 'value'; value: unknown; }; /** Create a route-parameter reference. */ export declare function route(key: string): DataRef; /** Create a page-data reference. */ export declare function data(key: string): DataRef; export interface CallAction extends ActionSchema { type: 'call'; func: ProviderSchema; args?: Record; } export declare function call(func: ProviderSchema, args?: Record): CallAction; /** Provider function signature. The generated API client exposes one function * per endpoint; ProviderSchema gives that function a name and a shared signature. */ export interface ProviderSchema extends ImportableSchemaBase { isAsync: boolean; /** Shared API signature — same instance the backend controller method references. */ signature: EndpointSchema; } /** Define a provider function. */ export declare function defineProvider(name: string, schema: { isAsync: boolean; signature: EndpointSchema; description?: string; importRef?: ImportBase; }): ProviderSchema; /** Assign a call's result to a page data field. * React: setState({ [field]: await ... }). Mini-program: this.setData({ [field]: ... }). */ export interface SetDataAction extends ActionSchema { type: 'setData'; call: CallAction; field: DtoField; } export declare function setData(call: CallAction, field: DtoField): SetDataAction;