import type { RpcPlugin } from '../core'; import type { Transformer } from '../core/transformer'; import type { Context as BaseContext, Railiz } from 'railiz'; export type CacheDecision = { enabled: boolean; ttl?: number; staleWhileRevalidate?: number; }; export interface RpcHandlerOptions { prefix?: string; createContext?: (context: BaseContext) => Context | Promise; transformer?: Transformer; plugins?: RpcPlugin[]; cache?: { enabled?: boolean; policy?: (args: { path: string; input: any; context: Context; }) => CacheDecision; key?: (args: { path: string; input: any; context: Context; }) => string; }; } export type RpcHandler = (app: Railiz) => void; export declare function rpcHandler(router: any, options?: RpcHandlerOptions): RpcHandler;