UNPKG

@convo-lang/convo-lang

Version:
17 lines (16 loc) 1.26 kB
import { CodeParser, CodeParsingResult } from '@iyio/common'; import { ConvoMessage, ConvoParsingOptions, ConvoStatement, ConvoTrigger, InlineConvoParsingOptions, InlineConvoPrompt } from "./convo-types"; export declare const parseConvoCode: CodeParser<ConvoMessage[], ConvoParsingOptions>; /** * Parses a message trigger tag value to extract the trigger action and optional condition. * Supports syntax like "replace condition" or "append" where the condition is optional. * * @param eventName - Name of the event the trigger will listen to * @param fnName - The name of the function to be called by the trigger * @param condition - string condition. Should start with a `=` character or the condition will be ignored * @param role - The message role that will trigger this function * @returns Parsed ConvoMessageTrigger object, or undefined if parsing fails */ export declare const parseConvoMessageTrigger: (eventName: string, fnName: string, condition: string, role?: string) => CodeParsingResult<ConvoTrigger>; export declare const parseInlineConvoPrompt: (content: string | ConvoStatement, options?: InlineConvoParsingOptions) => CodeParsingResult<InlineConvoPrompt>; export declare const doesConvoContentHaveMessage: (content: string) => boolean;