/* tslint:disable */ /* eslint-disable */ /* auto-generated by NAPI-RS */ export interface ZenConfig { nodesInContext?: boolean } export function overrideConfig(config: ZenConfig): void export interface ZenEvaluateOptions { maxDepth?: number trace?: boolean } export interface ZenEngineOptions { loader?: (key: string) => Promise customHandler?: (request: ZenEngineHandlerRequest) => Promise } export function evaluateExpressionSync(expression: string, context?: any | undefined | null): any export function evaluateUnaryExpressionSync(expression: string, context: any): boolean export function renderTemplateSync(template: string, context: any): any export function evaluateExpression(expression: string, context?: any | undefined | null): Promise export function evaluateUnaryExpression(expression: string, context: any): Promise export function renderTemplate(template: string, context: any): Promise export interface ZenEngineTrace { id: string name: string input: any output: any performance?: string traceData?: any order: number } export interface ZenEngineResponse { performance: string result: any trace?: Record } export interface ZenEngineHandlerResponse { output: any traceData?: any } export interface DecisionNode { id: string name: string kind: string config: any } export class ZenDecisionContent { constructor(content: Buffer | object) toBuffer(): Buffer } export class ZenDecision { constructor() evaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise safeEvaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise> validate(): void } export class ZenEngine { constructor(options?: ZenEngineOptions | undefined | null) evaluate(key: string, context: any, opts?: ZenEvaluateOptions | undefined | null): Promise createDecision(content: ZenDecisionContent | Buffer | object): ZenDecision getDecision(key: string): Promise safeEvaluate(key: string, context: any, opts?: ZenEvaluateOptions | undefined | null): Promise> safeGetDecision(key: string): Promise> /** * Function used to dispose memory allocated for loaders * In the future, it will likely be removed and made automatic */ dispose(): void } export class ZenEngineHandlerRequest { input: any node: DecisionNode constructor() getField(path: string): unknown getFieldRaw(path: string): unknown } // Custom definitions type SafeResultSuccess = { success: true; data: T; } type SafeResultError = { success: false; error: any; } export type SafeResult = SafeResultSuccess | SafeResultError;