/** * 给定字符串是否是合法的 JSON 字符串 * @param str */ export declare function isJSONString(str: string): boolean; /** * 给定代码是否是有效的函数代码 * @param str */ export declare function isValidFunctionCode(str: string): boolean; /** * 判断给定代码是否被双花括号包裹 * @example {{[]}} * @example {{{}}} * @example {{this.foo}} * @example {{123}} * @param str * @returns */ export declare function isWrappedCode(str: string): boolean; export declare const isVariableString: typeof isWrappedCode; /** * 从包裹的代码中获取代码内容 * @param str * @returns */ export declare function getCodeOfWrappedCode(str: string): string; export declare const getVariableContent: typeof getCodeOfWrappedCode; /** * 给输入代码加上双花括号 code -> {{code}} * @example foo -> {{foo}} * @example "hello" => {{"hello"}} * @example () => {} => {{() => {}}} * * @param code 输入代码 * @returns 加上花括号后的代码 */ export declare function wrapCode(code: string): string; /** * 使用 JSX 表达式容器包裹代码 * @example foo -> {foo} * @example "hello" => {"hello"} * @param code * @returns */ export declare function wrapCodeWithJSXExpressionContainer(code: string): string; /** * 是否为简单字符串,非变量字符串 * @param str */ export declare function isPlainString(str: string): boolean; /** * 从 markdown 中解析出代码片段,仅返回第一个匹配的代码片段 * @param markdown * @returns */ export declare function getCodeBlockFormMarkdown(markdown: string): string; export declare function url2serviceName(url: string): string; /** * 解析状态变量的 path * @example stores.foo.bar => { storeName: 'foo', variableName: 'bar' } * @example stores.user.count => { storeName: 'user', variableName: 'count' } * * @param variablePath * @returns */ export declare function parseStoreVariablePath(variablePath: string): { storeName: string; variableName: string; }; /** * 解析服务变量的 path * @param variablePath * @returns * * @example services.list => { moduleName: 'index', name: 'list' } * @example services.sub.list => { moduleName: 'sub', name: 'list' } * @example foo => undefined */ export declare function parseServiceVariablePath(variablePath: string): { moduleName?: undefined; name?: undefined; } | { moduleName: string; name: string; };