@bizone-ai/json-transform-utils
Version:
Utilities for handling JSON transformers
23 lines • 1.32 kB
TypeScript
import { TypeSchema } from "@bizone-ai/json-schema-utils";
import { FunctionDescriptor } from "./functions/types";
export declare class ParseContext {
private readonly paths?;
private readonly additionalContext?;
private knownVariables;
constructor(paths?: Record<string, TypeSchema>, additionalContext?: Record<string, TypeSchema>, previousPaths?: string[]);
hasPaths(): boolean;
hasPath(path: string): boolean;
/**
* If you are about to change the result, use this and not 'resolve()'
* @param path
*/
getPath(path: string): TypeSchema | undefined;
setPath(path: string, type: TypeSchema): void;
removePaths(paths: string[], variableToRemove?: string): void;
resolve(key: string): TypeSchema;
isReferencingKnownVariable(path: any): boolean;
}
export type ParseMethod = (definition: any, targetPath: string, localPath: string, previousPaths: string[], paths: string[], context: ParseContext) => void;
export type HandleFunctionMethod = (detectedAs: "inline" | "object", funcName: string, func: FunctionDescriptor, value: any, args: Record<string, any>, targetPath: string, localPath: string, previousPaths: string[], paths: string[], context: ParseContext, parse?: ParseMethod) => boolean;
export default ParseContext;
//# sourceMappingURL=ParseContext.d.ts.map