@xraph/smartform-react
Version:
React library for rendering and validating SmartForms with shadcn components
37 lines (36 loc) • 1.49 kB
TypeScript
import type { TemplateContext, TemplatePart, VariableRegistry } from "./types";
export declare class TextPart implements TemplatePart {
text: string;
constructor(text: string);
evaluate(_registry: VariableRegistry, _context: TemplateContext): any;
}
export declare class LiteralPart implements TemplatePart {
value: any;
constructor(value: any);
evaluate(_registry: VariableRegistry, _context: TemplateContext): any;
}
export declare class VariablePart implements TemplatePart {
path: string;
constructor(path: string);
evaluate(registry: VariableRegistry, context: TemplateContext): any;
}
export declare class FunctionPart implements TemplatePart {
name: string;
args: TemplatePart[];
constructor(name: string, args: TemplatePart[]);
evaluate(registry: VariableRegistry, context: TemplateContext): Promise<any>;
}
export declare class NullCoalescePart implements TemplatePart {
left: TemplatePart;
right: TemplatePart;
constructor(left: TemplatePart, right: TemplatePart);
evaluate(registry: VariableRegistry, context: TemplateContext): Promise<any>;
}
export declare class ForEachPart implements TemplatePart {
itemVar: string;
collection: TemplatePart;
body: TemplatePart;
indexVar?: string | undefined;
constructor(itemVar: string, collection: TemplatePart, body: TemplatePart, indexVar?: string | undefined);
evaluate(registry: VariableRegistry, context: TemplateContext): Promise<string>;
}