/** * 转为驼峰 (lowerCamelCase) * @example foo -> foo * @example foo-bar -> fooBar * @param str * @returns */ export declare function camelCase(str: string): string; /** * 将输入字符串转换为大驼峰格式(PascalCase) * @example about -> About * @example not-found -> NotFound * @param str */ export declare function upperCamelCase(str: string): string; /** * 生成随机 uuid * @param prefix 前缀字符串 * @returns */ export declare function uuid(prefix?: string, fractionDigits?: number): string; /** * 是否是合法的 url 地址 * @example www.163.com * @example //www.163.com * @example https://www.163.com * @example http://www.163.com * @param url * @returns */ export declare function isValidUrl(url: string): boolean; /** * 检查给定的路径是否含有后缀名 * @param str 输入路径 * @returns 如果有后缀返回 true,反之返回 false */ export declare function hasFileExtension(str: string): boolean; /** * 解析 dnd 追踪字符串 * @deprecated 使用 parseDndId 代替 * * @example Button:123 -> ["Button", "Button:123"] * @param str 字符串 */ export declare function parseDndTrackId(str: string): string[]; interface DndIdParsedType { /** * full id */ id?: string; /** * 组件代码中的 id,一般对应组件的 tid 属性 */ codeId?: string; /** * 组件名 */ component?: string; /** * 文件名 */ filename?: string; } /** * 解析 dnd id * @example Button:button123 -> { component: "Button", id: "Button:123" } * @example LocalBlock:Button:123 -> { filename: LocalBlock, component: "Button", id: "Button:123" } * @param str */ export declare function parseDndId(str: string): DndIdParsedType; /** * 替换模板中的变量 * @example interpolate('hello {{name}}', { name: 'world' }) -> 'hello world' * * @param template 带模板变量的字符串 * @param props 变量字典 * @returns 返回替换后的字符串 */ export declare function interpolate(template: string, props: Record): string; export {};