utils.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { ReactNode } from "react";
  2. import { XMLMeta } from "./types";
  3. /**
  4. * @see https://krpano.com/docu/actions
  5. */
  6. type FuncName = "addplugin" | "removeplugin" | "set" | "loadxml" | "loadscene" | "loadpano" | "tween" | "addhotspot" | "removehotspot" | "includexml" | "includexmlstring" | "addlayer" | "removelayer" | "nexttick";
  7. /**
  8. * 执行单个函数
  9. * @param func 函数名
  10. * @param params 参数列表
  11. */
  12. export declare const buildKrpanoAction: (func: FuncName, ...params: Array<string | number | boolean>) => string;
  13. /**
  14. * 动态添加标签用
  15. * @see https://krpano.com/forum/wbb/index.php?page=Thread&threadID=15873
  16. */
  17. export declare const buildKrpanoTagSetterActions: (name: string, attrs: Record<string, string | boolean | number | undefined>) => string;
  18. /**
  19. * 根据元数据构建xml
  20. */
  21. export declare const buildXML: ({ tag, attrs, children }: XMLMeta) => string;
  22. /**
  23. * 对Object进行map操作
  24. */
  25. export declare const mapObject: (obj: Record<string, unknown>, mapper: (key: string, value: unknown) => Record<string, unknown>) => Record<string, unknown>;
  26. /**
  27. * 主要用于绑定Krpano事件和js调用。提取某个对象中的onXXX属性并替换为对应的调用字符串,丢弃其他属性
  28. */
  29. export declare const mapEventPropsToJSCall: (obj: Record<string, unknown>, getString: (key: string, value: unknown) => string) => Record<string, string>;
  30. export declare const childrenToOuterHTML: (children: ReactNode) => string;
  31. export declare const compareVersions: (version1: string, version2: string) => number;
  32. export declare const is121Version: boolean;
  33. export {};
  34. //# sourceMappingURL=utils.d.ts.map