UNPKG

@convo-lang/convo-lang

Version:
13 lines (12 loc) 871 B
import { ZodType, z } from "zod"; import { ConvoObject, LockedConvoObject } from "./convo-types"; /** * Converts a template literal string into a ConvoObject. The completion of the conversation * is not started until then, catch, finally, getValue or getCompletionAsync is called. After one * of the previously stated functions or getInput, getValueAsync or getCompletionAsync are called * the ConvoObject is considered finalized and non of the setter function will be allowed * to be called, if they are called an error will be thrown. */ export declare const convo: <T>(strings: TemplateStringsArray, valueOrZodType?: T, ...values: any[]) => ConvoObject<T extends ZodType ? z.infer<T> : any>; export declare const isConvoObject: (value: any) => value is ConvoObject<any>; export declare const isLockedConvoObject: (value: any) => value is LockedConvoObject<any>;