UNPKG

@bizone-ai/json-transform-utils

Version:

Utilities for handling JSON transformers

31 lines 1.7 kB
import { FunctionDefinition, FunctionDescriptor } from "./types"; import { HandleFunctionMethod } from "../ParseContext"; import { TokenizedInlineFunction } from "@bizone-ai/json-transform"; type ObjectFunctionMatchResult = { name: string; func: FunctionDescriptor; value: any; args: Record<string, any>; }; export declare const getFunctionInlineSignature: (name: string, func: FunctionDescriptor, requiredOnly?: boolean) => string; export declare const getFunctionObjectSignature: (name: string, func: FunctionDescriptor) => string; export declare class FunctionsParser { private clientFunctions; private allFunctionsNames; private clientDocsUrlResolver; handleClientFunction?: HandleFunctionMethod; constructor(); setClientFunctions(clientFunctions: Record<string, FunctionDefinition>, handler?: HandleFunctionMethod, docsUrlResolver?: (funcName: string) => string): void; get(name: string, args?: Record<string, any>): FunctionDescriptor; getNames(): Set<string>; resolveDocsUrl(funcName: string, functionDescriptor?: FunctionDescriptor): string; matchInline(data: any, callback?: (funcName: string, func: FunctionDescriptor, value: any, args: Record<string, any>) => any): FunctionDescriptor | null; matchObject(data: any, extractOutputTypeRecursively?: boolean): ObjectFunctionMatchResult | undefined; matchAllFunctionsInLine(line: string): ({ index: number; } & TokenizedInlineFunction)[]; } export declare const functionsParser: FunctionsParser; export declare const getSubfunction: (func: FunctionDescriptor, args?: Record<string, any>) => FunctionDescriptor; export {}; //# sourceMappingURL=functionsParser.d.ts.map