@qxs-bns/utils 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/es/index.js +2 -0
  2. package/es/index.js.map +1 -0
  3. package/es/src/argo-log.js +2 -0
  4. package/es/src/argo-log.js.map +1 -0
  5. package/es/src/date-transfer.js +2 -0
  6. package/es/src/date-transfer.js.map +1 -0
  7. package/es/src/device.js +2 -0
  8. package/es/src/device.js.map +1 -0
  9. package/es/src/file-operations.js +2 -0
  10. package/es/src/file-operations.js.map +1 -0
  11. package/es/src/json.js +2 -0
  12. package/es/src/json.js.map +1 -0
  13. package/es/src/oss-uploader.js +2 -0
  14. package/es/src/oss-uploader.js.map +1 -0
  15. package/es/src/set-guid.js +2 -0
  16. package/es/src/set-guid.js.map +1 -0
  17. package/es/src/storage.js +2 -0
  18. package/es/src/storage.js.map +1 -0
  19. package/es/src/types.js +2 -0
  20. package/es/src/types.js.map +1 -0
  21. package/es/src/use-api.js +2 -0
  22. package/es/src/use-api.js.map +1 -0
  23. package/es/src/watermark.js +2 -0
  24. package/es/src/watermark.js.map +1 -0
  25. package/lib/index.js +1 -1
  26. package/lib/src/argo-log.js +1 -1
  27. package/lib/src/argo-log.js.map +1 -1
  28. package/lib/src/date-transfer.js +1 -1
  29. package/lib/src/date-transfer.js.map +1 -1
  30. package/lib/src/device.js +1 -1
  31. package/lib/src/device.js.map +1 -1
  32. package/lib/src/file-operations.js +1 -1
  33. package/lib/src/file-operations.js.map +1 -1
  34. package/lib/src/json.js +1 -1
  35. package/lib/src/json.js.map +1 -1
  36. package/lib/src/oss-uploader.js +1 -1
  37. package/lib/src/oss-uploader.js.map +1 -1
  38. package/lib/src/set-guid.js +2 -0
  39. package/lib/src/set-guid.js.map +1 -0
  40. package/lib/src/storage.js +1 -1
  41. package/lib/src/storage.js.map +1 -1
  42. package/lib/src/types.js +1 -1
  43. package/lib/src/types.js.map +1 -1
  44. package/lib/src/use-api.js +1 -1
  45. package/lib/src/use-api.js.map +1 -1
  46. package/lib/src/watermark.js +1 -31
  47. package/lib/src/watermark.js.map +1 -1
  48. package/package.json +34 -27
  49. package/{es → types}/index.d.ts +2 -0
  50. package/types/index.d.ts.map +1 -0
  51. package/{es → types}/src/argo-log.d.ts +1 -0
  52. package/types/src/argo-log.d.ts.map +1 -0
  53. package/{es → types}/src/date-transfer.d.ts +1 -0
  54. package/types/src/date-transfer.d.ts.map +1 -0
  55. package/types/src/device.d.ts +18 -0
  56. package/types/src/device.d.ts.map +1 -0
  57. package/{es → types}/src/file-operations.d.ts +1 -0
  58. package/types/src/file-operations.d.ts.map +1 -0
  59. package/{lib → types}/src/json.d.ts +1 -0
  60. package/types/src/json.d.ts.map +1 -0
  61. package/{es → types}/src/oss-uploader.d.ts +2 -2
  62. package/types/src/oss-uploader.d.ts.map +1 -0
  63. package/types/src/set-guid.d.ts +5 -0
  64. package/types/src/set-guid.d.ts.map +1 -0
  65. package/{lib → types}/src/storage.d.ts +1 -0
  66. package/types/src/storage.d.ts.map +1 -0
  67. package/{es → types}/src/types.d.ts +1 -0
  68. package/types/src/types.d.ts.map +1 -0
  69. package/{es → types}/src/use-api.d.ts +3 -4
  70. package/types/src/use-api.d.ts.map +1 -0
  71. package/{es → types}/src/watermark.d.ts +1 -0
  72. package/types/src/watermark.d.ts.map +1 -0
  73. package/types/tsconfig.tsbuildinfo +1 -0
  74. package/README.md +0 -65
  75. package/es/_virtual/_commonjs-dynamic-modules.mjs +0 -7
  76. package/es/_virtual/_commonjs-dynamic-modules.mjs.map +0 -1
  77. package/es/_virtual/_commonjsHelpers.mjs +0 -7
  78. package/es/_virtual/_commonjsHelpers.mjs.map +0 -1
  79. package/es/_virtual/ali-oss/dist/aliyun-oss-sdk.mjs +0 -20195
  80. package/es/_virtual/ali-oss/dist/aliyun-oss-sdk.mjs.map +0 -1
  81. package/es/_virtual/aliyun-oss-sdk.mjs +0 -8
  82. package/es/_virtual/aliyun-oss-sdk.mjs.map +0 -1
  83. package/es/_virtual/aliyun-oss-sdk2.mjs +0 -5
  84. package/es/_virtual/aliyun-oss-sdk2.mjs.map +0 -1
  85. package/es/_virtual/ans-javascript-sdk/sdk/AnalysysAgent_JS_SDK.es6.min.mjs +0 -2142
  86. package/es/_virtual/ans-javascript-sdk/sdk/AnalysysAgent_JS_SDK.es6.min.mjs.map +0 -1
  87. package/es/_virtual/xlsx/xlsx.mjs +0 -24583
  88. package/es/_virtual/xlsx/xlsx.mjs.map +0 -1
  89. package/es/index.mjs +0 -35
  90. package/es/index.mjs.map +0 -1
  91. package/es/src/argo-log.mjs +0 -68
  92. package/es/src/argo-log.mjs.map +0 -1
  93. package/es/src/date-transfer.mjs +0 -17
  94. package/es/src/date-transfer.mjs.map +0 -1
  95. package/es/src/device.d.ts +0 -4
  96. package/es/src/device.mjs +0 -24
  97. package/es/src/device.mjs.map +0 -1
  98. package/es/src/file-operations.mjs +0 -79
  99. package/es/src/file-operations.mjs.map +0 -1
  100. package/es/src/json.d.ts +0 -15
  101. package/es/src/json.mjs +0 -45
  102. package/es/src/json.mjs.map +0 -1
  103. package/es/src/oss-uploader.mjs +0 -89
  104. package/es/src/oss-uploader.mjs.map +0 -1
  105. package/es/src/storage.d.ts +0 -26
  106. package/es/src/storage.mjs +0 -81
  107. package/es/src/storage.mjs.map +0 -1
  108. package/es/src/types.mjs +0 -37
  109. package/es/src/types.mjs.map +0 -1
  110. package/es/src/use-api.mjs +0 -44
  111. package/es/src/use-api.mjs.map +0 -1
  112. package/es/src/watermark.mjs +0 -147
  113. package/es/src/watermark.mjs.map +0 -1
  114. package/lib/_virtual/_commonjs-dynamic-modules.js +0 -2
  115. package/lib/_virtual/_commonjs-dynamic-modules.js.map +0 -1
  116. package/lib/_virtual/_commonjsHelpers.js +0 -2
  117. package/lib/_virtual/_commonjsHelpers.js.map +0 -1
  118. package/lib/_virtual/ali-oss/dist/aliyun-oss-sdk.js +0 -85
  119. package/lib/_virtual/ali-oss/dist/aliyun-oss-sdk.js.map +0 -1
  120. package/lib/_virtual/aliyun-oss-sdk.js +0 -2
  121. package/lib/_virtual/aliyun-oss-sdk.js.map +0 -1
  122. package/lib/_virtual/aliyun-oss-sdk2.js +0 -2
  123. package/lib/_virtual/aliyun-oss-sdk2.js.map +0 -1
  124. package/lib/_virtual/ans-javascript-sdk/sdk/AnalysysAgent_JS_SDK.es6.min.js +0 -30
  125. package/lib/_virtual/ans-javascript-sdk/sdk/AnalysysAgent_JS_SDK.es6.min.js.map +0 -1
  126. package/lib/_virtual/xlsx/xlsx.js +0 -105
  127. package/lib/_virtual/xlsx/xlsx.js.map +0 -1
  128. package/lib/index.d.ts +0 -10
  129. package/lib/src/argo-log.d.ts +0 -32
  130. package/lib/src/date-transfer.d.ts +0 -11
  131. package/lib/src/device.d.ts +0 -4
  132. package/lib/src/file-operations.d.ts +0 -42
  133. package/lib/src/oss-uploader.d.ts +0 -43
  134. package/lib/src/types.d.ts +0 -26
  135. package/lib/src/use-api.d.ts +0 -47
  136. package/lib/src/watermark.d.ts +0 -47
@@ -1,2 +1,2 @@
1
- "use strict";var h=Object.defineProperty;var l=(s,e,t)=>e in s?h(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>l(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class m{constructor(e="qxs_"){n(this,"prefix");n(this,"local",{has:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e;return Object.prototype.hasOwnProperty.call(localStorage,o)},get:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e;return localStorage.getItem(o)},set:(e,t,o=!0)=>{const r=o?`${this.prefix}${e}`:e;localStorage.setItem(r,t)},remove:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e;localStorage.removeItem(o)},clear:()=>{localStorage.clear()}});n(this,"session",{has:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e;return Object.prototype.hasOwnProperty.call(sessionStorage,o)},get:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e;return sessionStorage.getItem(o)},set:(e,t,o=!0)=>{const r=o?`${this.prefix}${e}`:e;sessionStorage.setItem(r,t)},remove:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e;sessionStorage.removeItem(o)},clear:()=>{sessionStorage.clear()}});n(this,"cookie",{has:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e;return new RegExp(`(^|;)\\s*${o}=`).test(document.cookie)},get:(e,t=!0)=>{const o=t?`${this.prefix}${e}`:e,r=document.cookie.match(new RegExp(`(^|;)\\s*${o}=([^;]*)`));return r?decodeURIComponent(r[2]):null},set:(e,t,o=1,r="/",c=window.location.hostname,a=!0)=>{const p=a?`${this.prefix}${e}`:e,i=new Date;i.setTime(i.getTime()+o*24*60*60*1e3);const $=`;expires=${i.toUTCString()}`,x=`;path=${r}`,f=c?`;domain=${c}`:"";document.cookie=`${p}=${encodeURIComponent(t)}${$}${x}${f}`},remove:(e,t="/",o=window.location.hostname,r=!0)=>{const c=r?`${this.prefix}${e}`:e,a=`;expires=${new Date(0).toUTCString()}`,p=`;path=${t}`,i=o?`;domain=${o}`:"";document.cookie=`${c}=;${a}${p}${i}`},clear:()=>{const e=document.cookie.match(/[^ =;]+(?==)/g);e&&e.forEach(t=>{document.cookie=`${t}=;expires=${new Date(0).toUTCString()};path=/`})}});this.prefix=e}}exports.Storage=m;
1
+ "use strict";var e=Object.defineProperty,t=(t,o,n)=>((t,o,n)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n)(t,"symbol"!=typeof o?o+"":o,n);exports.Storage=class{constructor(){var e=this;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"qxs_";t(this,"prefix"),t(this,"local",{has:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t;return Object.prototype.hasOwnProperty.call(localStorage,o)},get:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t;return localStorage.getItem(o)},set:function(t,o){const n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?`${e.prefix}${t}`:t;localStorage.setItem(n,o)},remove:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t;localStorage.removeItem(o)},clear:()=>{localStorage.clear()}}),t(this,"session",{has:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t;return Object.prototype.hasOwnProperty.call(sessionStorage,o)},get:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t;return sessionStorage.getItem(o)},set:function(t,o){const n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?`${e.prefix}${t}`:t;sessionStorage.setItem(n,o)},remove:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t;sessionStorage.removeItem(o)},clear:()=>{sessionStorage.clear()}}),t(this,"cookie",{has:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t;return new RegExp(`(^|;)\\s*${o}=`).test(document.cookie)},get:function(t){const o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?`${e.prefix}${t}`:t,n=document.cookie.match(new RegExp(`(^|;)\\s*${o}=([^;]*)`));return n?decodeURIComponent(n[2]):null},set:function(t,o){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window.location.hostname;const c=!(arguments.length>5&&void 0!==arguments[5])||arguments[5]?`${e.prefix}${t}`:t,s=new Date;s.setTime(s.getTime()+24*n*60*60*1e3);const l=`;expires=${s.toUTCString()}`,a=`;path=${i}`,$=r?`;domain=${r}`:"";document.cookie=`${c}=${encodeURIComponent(o)}${l}${a}${$}`},remove:function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.hostname;const i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3]?`${e.prefix}${t}`:t,r=`;expires=${new Date(0).toUTCString()}`,c=`;path=${o}`,s=n?`;domain=${n}`:"";document.cookie=`${i}=;${r}${c}${s}`},clear:()=>{const e=document.cookie.match(/[^ =;]+(?==)/g);e&&e.forEach((e=>{document.cookie=`${e}=;expires=${new Date(0).toUTCString()};path=/`}))}}),this.prefix=o}};
2
2
  //# sourceMappingURL=storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sources":["../../../../packages/utils/src/storage.ts"],"sourcesContent":["// 使用单例模式\nclass Storage {\n private readonly prefix: string\n\n constructor(prefix = 'qxs_') {\n this.prefix = prefix\n }\n\n local = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return Object.prototype.hasOwnProperty.call(localStorage, prefixedKey)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return localStorage.getItem(prefixedKey)\n },\n set: (key: string, value: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n localStorage.setItem(prefixedKey, value)\n },\n remove: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n localStorage.removeItem(prefixedKey)\n },\n clear: () => {\n localStorage.clear()\n },\n }\n\n session = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return Object.prototype.hasOwnProperty.call(sessionStorage, prefixedKey)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return sessionStorage.getItem(prefixedKey)\n },\n set: (key: string, value: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n sessionStorage.setItem(prefixedKey, value)\n },\n remove: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n sessionStorage.removeItem(prefixedKey)\n },\n clear: () => {\n sessionStorage.clear()\n },\n }\n\n cookie = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return new RegExp(`(^|;)\\\\s*${prefixedKey}=`).test(document.cookie)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const match = document.cookie.match(new RegExp(`(^|;)\\\\s*${prefixedKey}=([^;]*)`))\n return match ? decodeURIComponent(match[2]) : null\n },\n set: (key: string, value: string, expires = 1, path = '/', domain = window.location.hostname, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const expiresDate = new Date()\n expiresDate.setTime(expiresDate.getTime() + expires * 24 * 60 * 60 * 1000)\n const expiresStr = `;expires=${expiresDate.toUTCString()}`\n const pathStr = `;path=${path}`\n const domainStr = domain ? `;domain=${domain}` : ''\n\n document.cookie = `${prefixedKey}=${encodeURIComponent(value)}${expiresStr}${pathStr}${domainStr}`\n },\n remove: (key: string, path = '/', domain = window.location.hostname, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const expiresStr = `;expires=${new Date(0).toUTCString()}`\n const pathStr = `;path=${path}`\n const domainStr = domain ? `;domain=${domain}` : ''\n\n document.cookie = `${prefixedKey}=;${expiresStr}${pathStr}${domainStr}`\n },\n clear: () => {\n const keys = document.cookie.match(/[^ =;]+(?==)/g)\n if (keys) {\n keys.forEach((key) => {\n document.cookie = `${key}=;expires=${new Date(0).toUTCString()};path=/`\n })\n }\n },\n }\n}\n\n// 直接导出 Storage 类\nexport { Storage }\n"],"names":["Storage","prefix","__publicField","key","usePrefix","prefixedKey","value","match","expires","path","domain","expiresDate","expiresStr","pathStr","domainStr","keys"],"mappings":"oPACA,MAAMA,CAAQ,CAGZ,YAAYC,EAAS,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WAAWA,CAAM,GAAK,GAExC,SAAA,OAAS,GAAGL,CAAW,KAAKO,CAAU,GAAGC,CAAO,GAAGC,CAAS,EACvE,EACA,MAAO,IAAM,CACX,MAAMC,EAAO,SAAS,OAAO,MAAM,eAAe,EAC9CA,GACGA,EAAA,QAASZ,GAAQ,CACX,SAAA,OAAS,GAAGA,CAAG,iBAAiB,KAAK,CAAC,EAAE,YAAA,CAAa,SAAA,CAC/D,CACH,CAEJ,GAnFE,KAAK,OAASF,CAAA,CAoFlB"}
1
+ {"version":3,"file":"storage.js","sources":["../../../../packages/utils/src/storage.ts"],"sourcesContent":["// 使用单例模式\nclass Storage {\n private readonly prefix: string\n\n constructor(prefix = 'qxs_') {\n this.prefix = prefix\n }\n\n local = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return Object.prototype.hasOwnProperty.call(localStorage, prefixedKey)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return localStorage.getItem(prefixedKey)\n },\n set: (key: string, value: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n localStorage.setItem(prefixedKey, value)\n },\n remove: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n localStorage.removeItem(prefixedKey)\n },\n clear: () => {\n localStorage.clear()\n },\n }\n\n session = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return Object.prototype.hasOwnProperty.call(sessionStorage, prefixedKey)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return sessionStorage.getItem(prefixedKey)\n },\n set: (key: string, value: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n sessionStorage.setItem(prefixedKey, value)\n },\n remove: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n sessionStorage.removeItem(prefixedKey)\n },\n clear: () => {\n sessionStorage.clear()\n },\n }\n\n cookie = {\n has: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n return new RegExp(`(^|;)\\\\s*${prefixedKey}=`).test(document.cookie)\n },\n get: (key: string, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const match = document.cookie.match(new RegExp(`(^|;)\\\\s*${prefixedKey}=([^;]*)`))\n return match ? decodeURIComponent(match[2]) : null\n },\n set: (key: string, value: string, expires = 1, path = '/', domain = window.location.hostname, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const expiresDate = new Date()\n expiresDate.setTime(expiresDate.getTime() + expires * 24 * 60 * 60 * 1000)\n const expiresStr = `;expires=${expiresDate.toUTCString()}`\n const pathStr = `;path=${path}`\n const domainStr = domain ? `;domain=${domain}` : ''\n\n document.cookie = `${prefixedKey}=${encodeURIComponent(value)}${expiresStr}${pathStr}${domainStr}`\n },\n remove: (key: string, path = '/', domain = window.location.hostname, usePrefix: boolean = true) => {\n const prefixedKey = usePrefix ? `${this.prefix}${key}` : key\n const expiresStr = `;expires=${new Date(0).toUTCString()}`\n const pathStr = `;path=${path}`\n const domainStr = domain ? `;domain=${domain}` : ''\n\n document.cookie = `${prefixedKey}=;${expiresStr}${pathStr}${domainStr}`\n },\n clear: () => {\n const keys = document.cookie.match(/[^ =;]+(?==)/g)\n if (keys) {\n keys.forEach((key) => {\n document.cookie = `${key}=;expires=${new Date(0).toUTCString()};path=/`\n })\n }\n },\n }\n}\n\n// 直接导出 Storage 类\nexport { Storage }\n"],"names":["constructor","_this","this","prefix","__publicField","has","key","prefixedKey","arguments","length","undefined","Object","prototype","hasOwnProperty","call","localStorage","get","getItem","set","value","setItem","remove","removeItem","clear","sessionStorage","RegExp","test","document","cookie","match","decodeURIComponent","expires","path","domain","window","location","hostname","expiresDate","Date","setTime","getTime","expiresStr","toUTCString","pathStr","domainStr","encodeURIComponent","keys","forEach"],"mappings":"uLACA,MAGEA,WAAAA,GAA6B,IAAAC,EAAAC,KAAA,IAAjBC,yDAAS,OAFJC,EAAAF,KAAA,UAMTE,EAAAF,KAAA,QAAA,CACNG,IAAK,SAACC,GACJ,MAAMC,IADWC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GACe,GAAGP,EAAKE,SAASG,IAAQA,EACzD,OAAOK,OAAOC,UAAUC,eAAeC,KAAKC,aAAcR,EAC5D,EACAS,IAAK,SAACV,GACJ,MAAMC,IADWC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GACe,GAAGP,EAAKE,SAASG,IAAQA,EAClD,OAAAS,aAAaE,QAAQV,EAC9B,EACAW,IAAK,SAACZ,EAAaa,GACjB,MAAMZ,6DAA0B,GAAGN,EAAKE,SAASG,IAAQA,EAC5CS,aAAAK,QAAQb,EAAaY,EACpC,EACAE,OAAQ,SAACf,GACP,MAAMC,IADcC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GACY,GAAGP,EAAKE,SAASG,IAAQA,EACzDS,aAAaO,WAAWf,EAC1B,EACAgB,MAAOA,KACLR,aAAaQ,OAAM,IAIbnB,EAAAF,KAAA,UAAA,CACRG,IAAK,SAACC,GACJ,MAAMC,IADWC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GACe,GAAGP,EAAKE,SAASG,IAAQA,EACzD,OAAOK,OAAOC,UAAUC,eAAeC,KAAKU,eAAgBjB,EAC9D,EACAS,IAAK,SAACV,GACJ,MAAMC,IADWC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GACe,GAAGP,EAAKE,SAASG,IAAQA,EAClD,OAAAkB,eAAeP,QAAQV,EAChC,EACAW,IAAK,SAACZ,EAAaa,GACjB,MAAMZ,6DAA0B,GAAGN,EAAKE,SAASG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F,IAA7E0B,EAAOxB,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,IAAKyB,sDAASC,GAAAA,OAAOC,SAASC,SACzD,MAAM7B,IAD6DC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GACnC,GAAGP,EAAKE,SAASG,IAAQA,EACnDmC,EAAa,YAAY,IAAIH,KAAK,GAAGI,gBACrCC,EAAU,SAASX,IACnBY,EAAYX,EAAS,WAAWA,IAAW,GAExCN,SAAAC,OAAS,GAAGrB,MAAgBkC,IAAaE,IAAUC,GAC9D,EACArB,MAAOA,KACL,MAAMuB,EAAOnB,SAASC,OAAOC,MAAM,iBAC/BiB,GACGA,EAAAC,SAASzC,IACHqB,SAAAC,OAAS,GAAGtB,cAAG,IAAiBgC,KAAK,GAAGI,sBAAa,GAElE,IAjFFxC,KAAKC,OAASA,CAChB"}
package/lib/src/types.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=e=>e===void 0,i=e=>typeof e=="boolean",o=e=>typeof e=="number";function r(e){return typeof Element>"u"?!1:e instanceof Element}function s(e){return e===window}function l(e){return/^[\],:{}\s]*$/.test(e.replace(/\\["\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))&&u(e)}function u(e){try{return JSON.parse(e),!0}catch(n){return console.log("e: ",n),!1}}function c(e){return e.type.startsWith("image/")}function f(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}exports.isBoolean=i;exports.isElement=r;exports.isImageByMimeType=c;exports.isJSONString=l;exports.isNumber=o;exports.isPlainObject=f;exports.isUndefined=t;exports.isWindow=s;
1
+ "use strict";exports.isBoolean=e=>"boolean"==typeof e,exports.isElement=function(e){return"undefined"!=typeof Element&&e instanceof Element},exports.isImageByMimeType=function(e){return e.type.startsWith("image/")},exports.isJSONString=function(e){return/^[\],:{}\s]*$/.test(e.replace(/\\["\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))&&function(e){try{return JSON.parse(e),!0}catch(e){return console.log("e: ",e),!1}}(e)},exports.isNumber=e=>"number"==typeof e,exports.isPlainObject=function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},exports.isUndefined=e=>void 0===e,exports.isWindow=function(e){return e===window};
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../packages/utils/src/types.ts"],"sourcesContent":["export const isUndefined = (val: any): val is undefined => val === undefined\nexport const isBoolean = (val: any): val is boolean => typeof val === 'boolean'\nexport const isNumber = (val: any): val is number => typeof val === 'number'\n\nexport function isElement(e: unknown): e is Element {\n if (typeof Element === 'undefined') {\n return false\n }\n return e instanceof Element\n}\n\nexport function isWindow(val: unknown): val is Window {\n return val === window\n}\n\n/**\n * 判断字符串是否为JSON字符串\n * @param str - 要判断的字符串\n * @returns 如果字符串是JSON字符串,则返回true,否则返回false\n */\nexport function isJSONString(str: string) {\n const jsonStringRegex = /^[\\],:{}\\s]*$/\n .test(str.replace(/\\\\[\"\\\\/bfnrtu]/g, '@')\n .replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']')\n .replace(/(?:^|:|,)(?:\\s*\\[)+/g, ''))\n\n return jsonStringRegex && isValidJSON(str)\n}\n\n/**\n * 判断字符串是否为有效的JSON字符串\n * @param str - 要判断的字符串\n * @returns 如果字符串是有效的JSON字符串,则返回true,否则返回false\n */\nfunction isValidJSON(str: string) {\n try {\n JSON.parse(str)\n return true\n }\n catch (e) {\n console.log('e: ', e)\n return false\n }\n}\n\n/**\n * 通过 MIME 类型判断文件是否为图片\n * @param file - 要检查的文件对象\n * @returns {boolean} 如果文件是图片类型返回 true,否则返回 false\n * @example\n * const file = new File([''], 'test.png', { type: 'image/png' });\n * isImageByMimeType(file); // true\n */\nexport function isImageByMimeType(file: File) {\n return file.type.startsWith('image/')\n}\n\n/**\n * 判断一个值是否为普通对象\n * @param value - 要判断的值\n * @returns 如果值是普通对象,则返回 true,否则返回 false\n */\nexport function isPlainObject(value: unknown): value is Record<string, any> {\n if (value === null || typeof value !== 'object') {\n return false\n }\n\n // 获取原型\n const proto = Object.getPrototypeOf(value)\n\n // 如果没有原型(proto === null),说明是通过 Object.create(null) 创建的\n // 或者原型就是 Object.prototype,说明是普通对象\n return proto === null || proto === Object.prototype\n}\n"],"names":["isUndefined","val","isBoolean","isNumber","isElement","isWindow","isJSONString","str","isValidJSON","e","isImageByMimeType","file","isPlainObject","value","proto"],"mappings":"gFAAa,MAAAA,EAAeC,GAA+BA,IAAQ,OACtDC,EAAaD,GAA6B,OAAOA,GAAQ,UACzDE,EAAYF,GAA4B,OAAOA,GAAQ,SAE7D,SAASG,EAAU,EAA0B,CAC9C,OAAA,OAAO,QAAY,IACd,GAEF,aAAa,OACtB,CAEO,SAASC,EAASJ,EAA6B,CACpD,OAAOA,IAAQ,MACjB,CAOO,SAASK,EAAaC,EAAa,CAMjC,MALiB,gBACrB,KAAKA,EAAI,QAAQ,kBAAmB,GAAG,EACrC,QAAQ,mEAAoE,GAAG,EAC/E,QAAQ,uBAAwB,EAAE,CAAC,GAEdC,EAAYD,CAAG,CAC3C,CAOA,SAASC,EAAYD,EAAa,CAC5B,GAAA,CACF,YAAK,MAAMA,CAAG,EACP,SAEFE,EAAG,CACA,eAAA,IAAI,MAAOA,CAAC,EACb,EAAA,CAEX,CAUO,SAASC,EAAkBC,EAAY,CACrC,OAAAA,EAAK,KAAK,WAAW,QAAQ,CACtC,CAOO,SAASC,EAAcC,EAA8C,CAC1E,GAAIA,IAAU,MAAQ,OAAOA,GAAU,SAC9B,MAAA,GAIH,MAAAC,EAAQ,OAAO,eAAeD,CAAK,EAIlC,OAAAC,IAAU,MAAQA,IAAU,OAAO,SAC5C"}
1
+ {"version":3,"file":"types.js","sources":["../../../../packages/utils/src/types.ts"],"sourcesContent":["export const isUndefined = (val: any): val is undefined => val === undefined\nexport const isBoolean = (val: any): val is boolean => typeof val === 'boolean'\nexport const isNumber = (val: any): val is number => typeof val === 'number'\n\nexport function isElement(e: unknown): e is Element {\n if (typeof Element === 'undefined') {\n return false\n }\n return e instanceof Element\n}\n\nexport function isWindow(val: unknown): val is Window {\n return val === window\n}\n\n/**\n * 判断字符串是否为JSON字符串\n * @param str - 要判断的字符串\n * @returns 如果字符串是JSON字符串,则返回true,否则返回false\n */\nexport function isJSONString(str: string) {\n const jsonStringRegex = /^[\\],:{}\\s]*$/\n .test(str.replace(/\\\\[\"\\\\/bfnrtu]/g, '@')\n .replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g, ']')\n .replace(/(?:^|:|,)(?:\\s*\\[)+/g, ''))\n\n return jsonStringRegex && isValidJSON(str)\n}\n\n/**\n * 判断字符串是否为有效的JSON字符串\n * @param str - 要判断的字符串\n * @returns 如果字符串是有效的JSON字符串,则返回true,否则返回false\n */\nfunction isValidJSON(str: string) {\n try {\n JSON.parse(str)\n return true\n }\n catch (e) {\n console.log('e: ', e)\n return false\n }\n}\n\n/**\n * 通过 MIME 类型判断文件是否为图片\n * @param file - 要检查的文件对象\n * @returns {boolean} 如果文件是图片类型返回 true,否则返回 false\n * @example\n * const file = new File([''], 'test.png', { type: 'image/png' });\n * isImageByMimeType(file); // true\n */\nexport function isImageByMimeType(file: File) {\n return file.type.startsWith('image/')\n}\n\n/**\n * 判断一个值是否为普通对象\n * @param value - 要判断的值\n * @returns 如果值是普通对象,则返回 true,否则返回 false\n */\nexport function isPlainObject(value: unknown): value is Record<string, any> {\n if (value === null || typeof value !== 'object') {\n return false\n }\n\n // 获取原型\n const proto = Object.getPrototypeOf(value)\n\n // 如果没有原型(proto === null),说明是通过 Object.create(null) 创建的\n // 或者原型就是 Object.prototype,说明是普通对象\n return proto === null || proto === Object.prototype\n}\n"],"names":["val","e","Element","file","type","startsWith","str","test","replace","JSON","parse","console","log","isValidJSON","value","proto","Object","getPrototypeOf","prototype","window"],"mappings":"+BAC0BA,GAA4C,kBAARA,oBAGvD,SAAmBC,GACpB,MAAmB,oBAAZC,SAGJD,aAAaC,OACtB,4BA4CO,SAA2BC,GACzB,OAAAA,EAAKC,KAAKC,WAAW,SAC9B,uBAnCO,SAAsBC,GAMpB,MALiB,gBACrBC,KAAKD,EAAIE,QAAQ,kBAAmB,KAClCA,QAAQ,mEAAoE,KAC5EA,QAAQ,uBAAwB,MAUvC,SAAqBF,GACf,IAEK,OADPG,KAAKC,MAAMJ,IACJ,QAEFL,GAEE,OADCU,QAAAC,IAAI,MAAOX,IACZ,CACT,CACF,CAjB4BY,CAAYP,EACxC,mBAzByBN,GAA2C,iBAARA,wBA4DrD,SAAuBc,GAC5B,GAAc,OAAVA,GAAmC,iBAAVA,EACpB,OAAA,EAIH,MAAAC,EAAQC,OAAOC,eAAeH,GAI7B,OAAU,OAAVC,GAAkBA,IAAUC,OAAOE,SAC5C,sBAzE4BlB,QAAuC,IAARA,mBAWpD,SAAkBA,GACvB,OAAOA,IAAQmB,MACjB"}
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.defineProperty;var l=(r,s,e)=>s in r?f(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e;var a=(r,s,e)=>l(r,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./types.js"),i=class i{constructor(s,e){a(this,"useApi",async(s,e,u)=>{let d=null,o=null;try{const t={...s,...["GET"].includes(s.method.toUpperCase())?{params:e}:{data:e}};t.url=(t.proxyPrefix||"")+s.url,delete t.proxyPrefix;const n=await this.apiInstance(t);d=u?n.data:n.data.data}catch(t){if(this.axiosInstance.isAxiosError(t)){const{statusText:n="",status:h}=t.response||{};console.log(n?`${n}:${h}`:JSON.stringify(t))}else this.isAxiosResponse(t)?o=t.data:this.isErrorResponse(t)&&(o=t)}return{res:d,error:o}});if(this.apiInstance=s,this.axiosInstance=e,i.instance)return i.instance;i.instance=this}isBusinessError(s){return p.isPlainObject(s)&&typeof s.message=="string"&&typeof s.code=="number"&&s.code!==0}isAxiosResponse(s){return p.isPlainObject(s)&&s.data!==void 0&&this.isBusinessError(s.data)&&s.status!==void 0&&s.statusText!==void 0&&s.headers!==void 0&&s.config!==void 0&&s.request!==void 0}isErrorResponse(s){return"code"in s&&"data"in s&&"message"in s&&s.code!==0}};a(i,"instance");let c=i;exports.ApiService=c;
1
+ "use strict";var e=require("./types.js"),s=Object.defineProperty,r=(e,r,t)=>((e,r,t)=>r in e?s(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t)(e,"symbol"!=typeof r?r+"":r,t);const t=class s{constructor(e){if(this.apiInstance=e,r(this,"useApi",(async(e,s,r)=>{let t=null,i=null;try{const i={...e,...["GET"].includes(e.method.toUpperCase())?{params:s}:{data:s}};i.url=(i.proxyPrefix||"")+e.url,delete i.proxyPrefix;const a=await this.apiInstance(i);t=r?a.data:a.data.data}catch(e){"AxiosError"!==e.name?this.isAxiosResponse(e)?i=e.data:this.isErrorResponse(e)&&(i=e):console.error(e)}return{res:t,error:i}})),s.instance)return s.instance;s.instance=this}isBusinessError(s){return e.isPlainObject(s)&&"string"==typeof s.message&&"number"==typeof s.code&&0!==s.code}isAxiosResponse(s){return e.isPlainObject(s)&&void 0!==s.data&&this.isBusinessError(s.data)&&void 0!==s.status&&void 0!==s.statusText&&void 0!==s.headers&&void 0!==s.config&&void 0!==s.request}isErrorResponse(e){return"code"in e&&"data"in e&&"message"in e&&0!==e.code}};r(t,"instance");let i=t;exports.ApiService=i;
2
2
  //# sourceMappingURL=use-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-api.js","sources":["../../../../packages/utils/src/use-api.ts"],"sourcesContent":["import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosStatic } from 'axios'\nimport { isPlainObject } from './types'\n\nexport interface SuccessResponse<T> {\n code: number\n count: number\n data: T\n message: string\n}\n\nexport interface ErrorResponse {\n code: number\n data: null\n message: string\n}\n\nexport interface UseApiResponse<W extends boolean = false, T = unknown> {\n res: W extends true ? SuccessResponse<T> : T\n error: ErrorResponse | null\n}\n\nexport interface UrlObjectType {\n url: string\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'\n proxyPrefix?: string\n}\n\nexport type ApiTypeMap<U extends UrlObjectType> = {\n [K in U['url']]: {\n request: any\n response: any\n }\n}\n\ntype RequestPayload<T> = T extends { data: any } ? T['data'] : T\ntype RequestParams<T> = T extends { params: any } ? T['params'] : T\n\nexport class ApiService<\n T extends ApiTypeMap<U>,\n U extends UrlObjectType,\n> {\n private static instance: ApiService<any, any>\n\n constructor(\n private apiInstance: AxiosInstance,\n private axiosInstance: AxiosStatic,\n ) {\n if (ApiService.instance) {\n return ApiService.instance as ApiService<T, U>\n }\n ApiService.instance = this\n }\n\n private isBusinessError(obj: ErrorResponse): boolean {\n return isPlainObject(obj)\n && typeof obj.message === 'string'\n && typeof obj.code === 'number'\n && obj.code !== 0\n }\n\n private isAxiosResponse(value: any): value is AxiosResponse {\n return isPlainObject(value)\n && value.data !== undefined\n && this.isBusinessError(value.data)\n && value.status !== undefined\n && value.statusText !== undefined\n && value.headers !== undefined\n && value.config !== undefined\n && value.request !== undefined\n }\n\n private isErrorResponse(value: any): value is ErrorResponse {\n return 'code' in value && 'data' in value && 'message' in value && value.code !== 0\n }\n\n public useApi = async <\n K extends U,\n W extends boolean = false,\n >(\n axiosConfig: Omit<AxiosRequestConfig<RequestPayload<T[K['url']]['request']>>, 'params'> & K & {\n params?: RequestParams<T[K['url']]['request']>\n },\n params?: RequestParams<T[K['url']]['request']>,\n isWholeResponse?: W,\n ): Promise<UseApiResponse<W, T[K['url']]['response']>> => {\n let res: UseApiResponse<W, T[K['url']]['response']>['res'] | null = null\n let error: UseApiResponse['error'] = null\n\n try {\n const config = {\n ...axiosConfig,\n ...(['GET'].includes(axiosConfig.method.toUpperCase()) ? { params } : { data: params }),\n }\n\n config.url = (config.proxyPrefix || '') + axiosConfig.url\n delete config.proxyPrefix\n\n const response = await this.apiInstance<SuccessResponse<T[K['url']]['response']>>(config)\n res = isWholeResponse\n ? response.data\n : response.data.data\n }\n catch (err) {\n if (this.axiosInstance.isAxiosError(err)) {\n const { statusText = '', status } = err.response || {}\n console.log(statusText ? `${statusText}:${status}` : JSON.stringify(err))\n }\n else if (this.isAxiosResponse(err)) {\n error = err.data\n }\n else if (this.isErrorResponse(err)) {\n error = err\n }\n }\n\n return { res: res!, error }\n }\n}\n"],"names":["_ApiService","apiInstance","axiosInstance","__publicField","axiosConfig","params","isWholeResponse","res","error","config","response","err","statusText","status","obj","isPlainObject","value","ApiService"],"mappings":"kRAqCaA,EAAN,MAAMA,CAGX,CAGA,YACUC,EACAC,EACR,CA6BKC,EAAA,cAAS,MAIdC,EAGAC,EACAC,IACwD,CACxD,IAAIC,EAAgE,KAChEC,EAAiC,KAEjC,GAAA,CACF,MAAMC,EAAS,CACb,GAAGL,EACH,GAAI,CAAC,KAAK,EAAE,SAASA,EAAY,OAAO,YAAa,CAAA,EAAI,CAAE,OAAAC,GAAW,CAAE,KAAMA,CAAO,CACvF,EAEAI,EAAO,KAAOA,EAAO,aAAe,IAAML,EAAY,IACtD,OAAOK,EAAO,YAEd,MAAMC,EAAW,MAAM,KAAK,YAAsDD,CAAM,EACxFF,EAAMD,EACFI,EAAS,KACTA,EAAS,KAAK,WAEbC,EAAK,CACV,GAAI,KAAK,cAAc,aAAaA,CAAG,EAAG,CACxC,KAAM,CAAE,WAAAC,EAAa,GAAI,OAAAC,GAAWF,EAAI,UAAY,CAAC,EAC7C,QAAA,IAAIC,EAAa,GAAGA,CAAU,IAAIC,CAAM,GAAK,KAAK,UAAUF,CAAG,CAAC,CAEjE,MAAA,KAAK,gBAAgBA,CAAG,EAC/BH,EAAQG,EAAI,KAEL,KAAK,gBAAgBA,CAAG,IACvBH,EAAAG,EACV,CAGK,MAAA,CAAE,IAAAJ,EAAW,MAAAC,CAAM,CAC5B,GArEE,GAHQ,KAAA,YAAAP,EACA,KAAA,cAAAC,EAEJF,EAAW,SACb,OAAOA,EAAW,SAEpBA,EAAW,SAAW,IAAA,CAGhB,gBAAgBc,EAA6B,CACnD,OAAOC,EAAc,cAAAD,CAAG,GACnB,OAAOA,EAAI,SAAY,UACvB,OAAOA,EAAI,MAAS,UACpBA,EAAI,OAAS,CAAA,CAGZ,gBAAgBE,EAAoC,CACnD,OAAAD,EAAA,cAAcC,CAAK,GACrBA,EAAM,OAAS,QACf,KAAK,gBAAgBA,EAAM,IAAI,GAC/BA,EAAM,SAAW,QACjBA,EAAM,aAAe,QACrBA,EAAM,UAAY,QAClBA,EAAM,SAAW,QACjBA,EAAM,UAAY,MAAA,CAGjB,gBAAgBA,EAAoC,CAC1D,MAAO,SAAUA,GAAS,SAAUA,GAAS,YAAaA,GAASA,EAAM,OAAS,CAAA,CA6CtF,EA5EEb,EAJWH,EAII,YAJV,IAAMiB,EAANjB"}
1
+ {"version":3,"file":"use-api.js","sources":["../../../../packages/utils/src/use-api.ts"],"sourcesContent":["import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'\nimport { isPlainObject } from './types'\n\nexport interface SuccessResponse<T> {\n code: number\n count: number\n data: T\n message: string\n}\n\nexport interface ErrorResponse {\n code: number\n data: null\n message: string\n}\n\nexport interface UseApiResponse<W extends boolean = false, T = unknown> {\n res: W extends true ? SuccessResponse<T> : T\n error: ErrorResponse | null\n}\n\nexport interface UrlObjectType {\n url: string\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'\n proxyPrefix?: string\n}\n\nexport type ApiTypeMap<U extends UrlObjectType> = {\n [K in U['url']]: {\n request: any\n response: any\n }\n}\n\ntype RequestPayload<T> = T extends { data: any } ? T['data'] : T\ntype RequestParams<T> = T extends { params: any } ? T['params'] : T\n\nexport class ApiService<\n T extends ApiTypeMap<U>,\n U extends UrlObjectType,\n> {\n private static instance: ApiService<any, any>\n\n constructor(\n private apiInstance: AxiosInstance,\n ) {\n if (ApiService.instance) {\n return ApiService.instance as ApiService<T, U>\n }\n ApiService.instance = this\n }\n\n private isBusinessError(obj: ErrorResponse): boolean {\n return isPlainObject(obj)\n && typeof obj.message === 'string'\n && typeof obj.code === 'number'\n && obj.code !== 0\n }\n\n private isAxiosResponse(value: any): value is AxiosResponse {\n return isPlainObject(value)\n && value.data !== undefined\n && this.isBusinessError(value.data)\n && value.status !== undefined\n && value.statusText !== undefined\n && value.headers !== undefined\n && value.config !== undefined\n && value.request !== undefined\n }\n\n private isErrorResponse(value: any): value is ErrorResponse {\n return 'code' in value && 'data' in value && 'message' in value && value.code !== 0\n }\n\n public useApi = async <\n K extends U,\n W extends boolean = false,\n >(\n axiosConfig: Omit<AxiosRequestConfig<RequestPayload<T[K['url']]['request']>>, 'params'> & K & {\n params?: RequestParams<T[K['url']]['request']>\n },\n params?: RequestParams<T[K['url']]['request']>,\n isWholeResponse?: W,\n ): Promise<UseApiResponse<W, T[K['url']]['response']>> => {\n let res: UseApiResponse<W, T[K['url']]['response']>['res'] | null = null\n let error: UseApiResponse['error'] = null\n\n try {\n const config = {\n ...axiosConfig,\n ...(['GET'].includes(axiosConfig.method.toUpperCase()) ? { params } : { data: params }),\n }\n\n config.url = (config.proxyPrefix || '') + axiosConfig.url\n delete config.proxyPrefix\n\n const response = await this.apiInstance<SuccessResponse<T[K['url']]['response']>>(config)\n res = isWholeResponse\n ? response.data\n : response.data.data\n }\n catch (err: any) {\n if (err.name !== 'AxiosError') {\n if (this.isAxiosResponse(err)) {\n error = err.data\n }\n else if (this.isErrorResponse(err)) {\n error = err\n }\n }\n else {\n console.error(err)\n }\n }\n\n return { res: res!, error }\n }\n}\n"],"names":["_ApiService","constructor","apiInstance","this","__publicField","async","axiosConfig","params","isWholeResponse","res","error","config","includes","method","toUpperCase","data","url","proxyPrefix","response","err","name","isAxiosResponse","isErrorResponse","console","instance","isBusinessError","obj","isPlainObject","message","code","value","status","statusText","headers","request","ApiService"],"mappings":"+LAqCO,MAAMA,EAAN,MAAMA,EAMXC,WAAAA,CACUC,GAER,GAFQC,KAAAD,YAAAA,EA8BVE,EAAAD,KAAO,UAASE,MAIdC,EAGAC,EACAC,KAEA,IAAIC,EAAgE,KAChEC,EAAiC,KAEjC,IACF,MAAMC,EAAS,IACVL,KACC,CAAC,OAAOM,SAASN,EAAYO,OAAOC,eAAiB,CAAEP,UAAW,CAAEQ,KAAMR,IAGhFI,EAAOK,KAAOL,EAAOM,aAAe,IAAMX,EAAYU,WAC/CL,EAAOM,YAEd,MAAMC,QAAiBf,KAAKD,YAAsDS,GAClFF,EAAMD,EACFU,EAASH,KACTG,EAASH,KAAKA,WAEbI,GACY,eAAbA,EAAIC,KACFjB,KAAKkB,gBAAgBF,GACvBT,EAAQS,EAAIJ,KAELZ,KAAKmB,gBAAgBH,KACpBT,EAAAS,GAIVI,QAAQb,MAAMS,EAElB,CAEO,MAAA,CAAEV,MAAWC,QAAM,IArEtBV,EAAWwB,SACb,OAAOxB,EAAWwB,SAEpBxB,EAAWwB,SAAWrB,IACxB,CAEQsB,eAAAA,CAAgBC,GACtB,OAAOC,EAAcA,cAAAD,IACO,iBAAhBA,EAAIE,SACS,iBAAbF,EAAIG,MACE,IAAbH,EAAIG,IACX,CAEQR,eAAAA,CAAgBS,GACf,OAAAH,gBAAcG,SACD,IAAfA,EAAMf,MACNZ,KAAKsB,gBAAgBK,EAAMf,YACV,IAAjBe,EAAMC,aACe,IAArBD,EAAME,iBACY,IAAlBF,EAAMG,cACW,IAAjBH,EAAMnB,aACY,IAAlBmB,EAAMI,OACb,CAEQZ,eAAAA,CAAgBQ,GACtB,MAAO,SAAUA,GAAS,SAAUA,GAAS,YAAaA,GAAwB,IAAfA,EAAMD,IAC3E,GA/BAzB,EAJWJ,EAII,YAJV,IAAMmC,EAANnC"}
@@ -1,32 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $={id:"wm_div_id",prefix:"mask_div_id",text:"测试水印",x:0,y:0,rows:0,cols:0,width:0,height:0,x_space:100,y_space:40,font:"微软雅黑",color:"black",fontsize:"18px",alpha:.15,angle:15,parent_width:0,parent_height:0,parent_node:null,monitor:!0};function C(t,r,c){const u=document.createElement("canvas").getContext("2d");if(!u)return{width:100,height:100};u.font=`${c} ${r}`;const s=u.measureText(t.trim()),l=Number.parseFloat(c),p=s.actualBoundingBoxAscent!==void 0&&s.actualBoundingBoxDescent!==void 0?s.actualBoundingBoxAscent+s.actualBoundingBoxDescent:l;return{width:Math.ceil(s.width),height:Math.ceil(p)}}function M(){const t={...$};let r=!1;const c=new MutationObserver(k),w=new ResizeObserver(()=>{r||l(t)});function u(i,e){const h=i-t.x,n=e-t.y,o=t.x_space||20,d=t.y_space||20,m=Math.ceil(h/(t.width+o)),g=Math.ceil(n/(t.height+d));return{cols:m,rows:g,x_space:o,y_space:d}}function s(i,e,h){const n=document.createElement("div");return n.textContent=t.text,n.id=`${t.prefix}${h}`,n.style.cssText=`
2
- transform: rotate(-${t.angle}deg);
3
- position: absolute;
4
- left: ${i}px;
5
- top: ${e}px;
6
- overflow: hidden;
7
- z-index: 9999999;
8
- opacity: ${t.alpha};
9
- font-size: ${t.fontsize};
10
- font-family: ${t.font};
11
- color: ${t.color};
12
- text-align: center;
13
- width: ${t.width}px;
14
- height: ${t.height}px;
15
- line-height: ${t.height}px;
16
- display: flex;
17
- align-items: center;
18
- justify-content: center;
19
- user-select: none;
20
- visibility: visible;
21
- `.replace(/\s+/g," ").trim(),n}function l(i){if(p(),Object.assign(t,i),t.width===0&&t.height===0||t.width===0||t.height===0){const a=C(t.text,t.font,t.fontsize),f=10;t.width===0&&(t.width=a.width+f),t.height===0&&(t.height=a.height+f)}const e=t.parent_node||document.body,h=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),o=document.createElement("div");o.id=t.id,e.closest("body")&&getComputedStyle(e).position==="static"&&(e.style.position="relative"),o.style.cssText=`
22
- pointer-events: none;
23
- display: block;
24
- position: absolute;
25
- top: 0;
26
- left: 0;
27
- width: 100%;
28
- height: 100%;
29
- z-index: 9999999;
30
- overflow: hidden;
31
- `.replace(/\s+/g," ").trim();const d=o.attachShadow?o.attachShadow({mode:"open"}):o;e.appendChild(o);const{cols:m,rows:g,x_space:v,y_space:y}=u(h,n);t.cols=m,t.rows=g,t.x_space=v,t.y_space=y;const b=document.createDocumentFragment();for(let a=0;a<g;a++){const f=t.y+(t.height+y)*a;for(let x=0;x<m;x++){const _=t.x+(t.width+v)*x;b.appendChild(s(_,f,a*m+x))}}if(d.appendChild(b),t.monitor){w.observe(e);const a={attributes:!0,childList:!0,subtree:!0,characterData:!0};c.observe(o,a),d!==o&&c.observe(d,a)}}function p(){var e;const i=document.getElementById(t.id);c.disconnect(),i&&((e=i.parentNode)==null||e.removeChild(i))}function k(i){if(r){r=!1;return}if(!document.getElementById(t.id)){l(t);return}i.some(n=>n.type==="childList"||n.type==="attributes"||n.type==="characterData")&&l(t)}return{addMark:l,removeMark:()=>{r=!0,p()}}}exports.watermark=M;
1
+ "use strict";const t={id:"wm_div_id",prefix:"mask_div_id",text:"测试水印",x:0,y:0,rows:0,cols:0,width:0,height:0,x_space:100,y_space:40,font:"微软雅黑",color:"black",fontsize:"18px",alpha:.15,angle:15,parent_width:0,parent_height:0,parent_node:null,monitor:!0};exports.watermark=function(){const e={...t};let n=!1;const i=new MutationObserver((function(t){if(n)return void(n=!1);if(!document.getElementById(e.id))return void s(e);t.some((t=>"childList"===t.type||("attributes"===t.type||"characterData"===t.type)))&&s(e)})),o=new ResizeObserver((()=>{n||s(e)}));function c(t,n,i){const o=document.createElement("div");return o.textContent=e.text,o.id=`${e.prefix}${i}`,o.style.cssText=`\n transform: rotate(-${e.angle}deg);\n position: absolute;\n left: ${t}px;\n top: ${n}px;\n overflow: hidden;\n z-index: 9999999;\n opacity: ${e.alpha};\n font-size: ${e.fontsize};\n font-family: ${e.font};\n color: ${e.color};\n text-align: center;\n width: ${e.width}px;\n height: ${e.height}px;\n line-height: ${e.height}px;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n visibility: visible;\n `.replace(/\s+/g," ").trim(),o}function s(t){if(a(),Object.assign(e,t),0===e.width&&0===e.height||0===e.width||0===e.height){const t=function(t,e,n){const i=document.createElement("canvas").getContext("2d");if(!i)return{width:100,height:100};i.font=`${n} ${e}`;const o=i.measureText(t.trim()),c=Number.parseFloat(n),s=void 0!==o.actualBoundingBoxAscent&&void 0!==o.actualBoundingBoxDescent?o.actualBoundingBoxAscent+o.actualBoundingBoxDescent:c;return{width:Math.ceil(o.width),height:Math.ceil(s)}}(e.text,e.font,e.fontsize),n=10;0===e.width&&(e.width=t.width+n),0===e.height&&(e.height=t.height+n)}const n=e.parent_node||document.body,s=Math.max(n.scrollWidth,n.clientWidth),r=Math.max(n.scrollHeight,n.clientHeight),d=document.createElement("div");d.id=e.id,n.closest("body")&&"static"===getComputedStyle(n).position&&(n.style.position="relative"),d.style.cssText="\n pointer-events: none;\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999999;\n overflow: hidden;\n ".replace(/\s+/g," ").trim();const h=d.attachShadow?d.attachShadow({mode:"open"}):d;n.appendChild(d);const{cols:l,rows:p,x_space:u,y_space:g}=function(t,n){const i=t-e.x,o=n-e.y,c=e.x_space||20,s=e.y_space||20;return{cols:Math.ceil(i/(e.width+c)),rows:Math.ceil(o/(e.height+s)),x_space:c,y_space:s}}(s,r);e.cols=l,e.rows=p,e.x_space=u,e.y_space=g;const x=document.createDocumentFragment();for(let t=0;t<p;t++){const n=e.y+(e.height+g)*t;for(let i=0;i<l;i++){const o=e.x+(e.width+u)*i;x.appendChild(c(o,n,t*l+i))}}if(h.appendChild(x),e.monitor){o.observe(n);const t={attributes:!0,childList:!0,subtree:!0,characterData:!0};i.observe(d,t),h!==d&&i.observe(h,t)}}function a(){const t=document.getElementById(e.id);i.disconnect(),t&&t.parentNode?.removeChild(t)}return{addMark:s,removeMark:()=>{n=!0,a()}}};
32
2
  //# sourceMappingURL=watermark.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watermark.js","sources":["../../../../packages/utils/src/watermark.ts"],"sourcesContent":["interface SettingsType {\n /** 水印总体的id */\n id?: string\n /** 小水印的id前缀 */\n prefix?: string\n /** 水印文案 */\n text?: string\n /** 水印起始位置x轴坐标 */\n x?: number\n /** 水印起始位置Y轴坐标 */\n y?: number\n /** 水印行数 */\n rows?: number\n /** 水印列数 */\n cols?: number\n /** 水印x轴间隔 */\n x_space?: number\n /** 水印y轴间隔 */\n y_space?: number\n /** 水印字体 */\n font?: string\n /** 水印字体颜色 */\n color?: string\n /** 水印字体大小 */\n fontsize?: string\n /** 水印透明度,要求设置在大于等于0.005 */\n alpha?: number\n /** 水印宽度 */\n width?: number\n /** 水印长度 */\n height?: number\n /** 水印倾斜度数 */\n angle?: number\n /** 水印的总体宽度(默认值:body的scrollWidth和clientWidth的较大值) */\n parent_width?: number\n /** 水印的总体高度(默认值:body的scrollHeight和clientHeight的较大值) */\n parent_height?: number\n /** 水印插件挂载的父元素element,不输入则默认挂在body */\n parent_node?: HTMLElement | null\n /** 是否监控,true: 不可删除水印; false: 可删水印 */\n monitor?: boolean\n}\n\n// 默认配置\nconst initialSettings: Required<SettingsType> = {\n id: 'wm_div_id',\n prefix: 'mask_div_id',\n text: '测试水印',\n x: 0,\n y: 0,\n rows: 0,\n cols: 0,\n width: 0,\n height: 0,\n x_space: 100,\n y_space: 40,\n font: '微软雅黑',\n color: 'black',\n fontsize: '18px',\n alpha: 0.15,\n angle: 15,\n parent_width: 0,\n parent_height: 0,\n parent_node: null,\n monitor: true,\n}\n\nfunction calculateTextDimensions(text: string, font: string, fontSize: string): { width: number, height: number } {\n const canvas = document.createElement('canvas')\n const context = canvas.getContext('2d')\n if (!context) {\n return { width: 100, height: 100 }\n }\n\n context.font = `${fontSize} ${font}`\n const metrics = context.measureText(text.trim())\n const fontSizeNum = Number.parseFloat(fontSize)\n\n // 移除 DPI 缩放,直接使用原始值\n const height = (metrics.actualBoundingBoxAscent !== undefined && metrics.actualBoundingBoxDescent !== undefined)\n ? (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent)\n : fontSizeNum\n\n return {\n width: Math.ceil(metrics.width),\n height: Math.ceil(height),\n }\n}\n\nexport function watermark() {\n const globalSetting: Required<SettingsType> = { ...initialSettings }\n let forceRemove = false\n const watermarkDom = new MutationObserver(domChangeCallback)\n const resizeObserver = new ResizeObserver(() => {\n if (!forceRemove) {\n loadMark(globalSetting)\n }\n })\n\n // 计算水印布局\n function calculateWatermarkLayout(pageWidth: number, pageHeight: number) {\n const availableWidth = pageWidth - globalSetting.x\n const availableHeight = pageHeight - globalSetting.y\n\n // 使用固定间距\n const x_space = globalSetting.x_space || 20 // 如果未设置则使用默认值\n const y_space = globalSetting.y_space || 20 // 如果未设置则使用默认值\n\n // 计算能容纳的行数和列数\n const cols = Math.ceil(availableWidth / (globalSetting.width + x_space))\n const rows = Math.ceil(availableHeight / (globalSetting.height + y_space))\n\n return {\n cols,\n rows,\n x_space,\n y_space,\n }\n }\n\n // 创建水印元素\n function createWatermarkElement(x: number, y: number, index: number): HTMLElement {\n const maskDiv = document.createElement('div')\n maskDiv.textContent = globalSetting.text\n maskDiv.id = `${globalSetting.prefix}${index}`\n\n maskDiv.style.cssText = `\n transform: rotate(-${globalSetting.angle}deg);\n position: absolute;\n left: ${x}px;\n top: ${y}px;\n overflow: hidden;\n z-index: 9999999;\n opacity: ${globalSetting.alpha};\n font-size: ${globalSetting.fontsize};\n font-family: ${globalSetting.font};\n color: ${globalSetting.color};\n text-align: center;\n width: ${globalSetting.width}px;\n height: ${globalSetting.height}px;\n line-height: ${globalSetting.height}px;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n visibility: visible;\n `.replace(/\\s+/g, ' ').trim()\n\n return maskDiv\n }\n\n // 加载水印\n function loadMark(settings: Partial<SettingsType>) {\n removeMark()\n Object.assign(globalSetting, settings)\n\n if ((globalSetting.width === 0 && globalSetting.height === 0) || globalSetting.width === 0 || globalSetting.height === 0) {\n // 计算文本尺寸\n const textDimensions = calculateTextDimensions(\n globalSetting.text,\n globalSetting.font,\n globalSetting.fontsize,\n )\n const padding = 10\n if (globalSetting.width === 0) {\n globalSetting.width = textDimensions.width + padding\n }\n if (globalSetting.height === 0) {\n globalSetting.height = textDimensions.height + padding\n }\n }\n\n const parentElement = globalSetting.parent_node || document.body\n const pageWidth = Math.max(parentElement.scrollWidth, parentElement.clientWidth)\n const pageHeight = Math.max(parentElement.scrollHeight, parentElement.clientHeight)\n\n const watermarkContainer = document.createElement('div')\n watermarkContainer.id = globalSetting.id\n\n // 处理父元素定位\n if (parentElement.closest('body') && getComputedStyle(parentElement).position === 'static') {\n parentElement.style.position = 'relative'\n }\n\n watermarkContainer.style.cssText = `\n pointer-events: none;\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999999;\n overflow: hidden;\n `.replace(/\\s+/g, ' ').trim()\n\n const shadowRoot = watermarkContainer.attachShadow ? watermarkContainer.attachShadow({ mode: 'open' }) : watermarkContainer\n\n parentElement.appendChild(watermarkContainer)\n\n const { cols, rows, x_space, y_space } = calculateWatermarkLayout(pageWidth, pageHeight)\n globalSetting.cols = cols\n globalSetting.rows = rows\n globalSetting.x_space = x_space\n globalSetting.y_space = y_space\n\n const fragment = document.createDocumentFragment()\n for (let i = 0; i < rows; i++) {\n const y = globalSetting.y + (globalSetting.height + y_space) * i\n for (let j = 0; j < cols; j++) {\n const x = globalSetting.x + (globalSetting.width + x_space) * j\n fragment.appendChild(createWatermarkElement(x, y, i * cols + j))\n }\n }\n shadowRoot.appendChild(fragment)\n\n if (globalSetting.monitor) {\n // 监听父元素大小变化\n resizeObserver.observe(parentElement)\n\n // 监听水印容器及其子元素\n const config: MutationObserverInit = {\n attributes: true, // 监听属性变化\n childList: true, // 监听子元素变化\n subtree: true, // 监听子树变化\n characterData: true, // 监听文本内容变化\n }\n\n // 监听水印容器\n watermarkDom.observe(watermarkContainer, config)\n\n // 如果使用了 Shadow DOM,还需要监听 shadowRoot 内的元素\n if (shadowRoot !== watermarkContainer) {\n watermarkDom.observe(shadowRoot, config)\n }\n }\n }\n\n // 移除水印\n function removeMark() {\n const watermarkElement = document.getElementById(globalSetting.id)\n watermarkDom.disconnect()\n if (watermarkElement) {\n watermarkElement.parentNode?.removeChild(watermarkElement)\n }\n }\n\n // 监听DOM变化\n function domChangeCallback(records: MutationRecord[]) {\n if (forceRemove) {\n forceRemove = false\n return\n }\n\n const watermarkElement = document.getElementById(globalSetting.id)\n if (!watermarkElement) {\n // 如果水印容器被删除,重新创建\n loadMark(globalSetting)\n return\n }\n\n // 检查是否有任何修改\n const hasChanges = records.some((record) => {\n // 检查元素是否被删除或添加\n if (record.type === 'childList') {\n return true\n }\n\n // 检查属性是否被修改\n if (record.type === 'attributes') {\n return true\n }\n\n // 检查文本内容是否被修改\n if (record.type === 'characterData') {\n return true\n }\n\n return false\n })\n\n if (hasChanges) {\n loadMark(globalSetting)\n }\n }\n\n return {\n addMark: loadMark,\n removeMark: () => {\n forceRemove = true\n // 删除这行,不重置全局配置\n // Object.assign(globalSetting, initialSettings)\n removeMark()\n },\n }\n}\n"],"names":["initialSettings","calculateTextDimensions","text","font","fontSize","context","metrics","fontSizeNum","height","watermark","globalSetting","forceRemove","watermarkDom","domChangeCallback","resizeObserver","loadMark","calculateWatermarkLayout","pageWidth","pageHeight","availableWidth","availableHeight","x_space","y_space","cols","rows","createWatermarkElement","x","y","index","maskDiv","settings","removeMark","textDimensions","padding","parentElement","waterm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SAAS5B,EAAkB8B,EAA2B,CACpD,GAAIhC,EAAa,CACDA,EAAA,GACd,MAAA,CAIF,GAAI,CADqB,SAAS,eAAeD,EAAc,EAAE,EAC1C,CAErBK,EAASL,CAAa,EACtB,MAAA,CAIiBiC,EAAQ,KAAMC,GAE3BA,EAAO,OAAS,aAKhBA,EAAO,OAAS,cAKhBA,EAAO,OAAS,eAKrB,GAGC7B,EAASL,CAAa,CACxB,CAGK,MAAA,CACL,QAASK,EACT,WAAY,IAAM,CACFJ,EAAA,GAGHoB,EAAA,CAAA,CAEf,CACF"}
1
+ {"version":3,"file":"watermark.js","sources":["../../../../packages/utils/src/watermark.ts"],"sourcesContent":["interface SettingsType {\n /** 水印总体的id */\n id?: string\n /** 小水印的id前缀 */\n prefix?: string\n /** 水印文案 */\n text?: string\n /** 水印起始位置x轴坐标 */\n x?: number\n /** 水印起始位置Y轴坐标 */\n y?: number\n /** 水印行数 */\n rows?: number\n /** 水印列数 */\n cols?: number\n /** 水印x轴间隔 */\n x_space?: number\n /** 水印y轴间隔 */\n y_space?: number\n /** 水印字体 */\n font?: string\n /** 水印字体颜色 */\n color?: string\n /** 水印字体大小 */\n fontsize?: string\n /** 水印透明度,要求设置在大于等于0.005 */\n alpha?: number\n /** 水印宽度 */\n width?: number\n /** 水印长度 */\n height?: number\n /** 水印倾斜度数 */\n angle?: number\n /** 水印的总体宽度(默认值:body的scrollWidth和clientWidth的较大值) */\n parent_width?: number\n /** 水印的总体高度(默认值:body的scrollHeight和clientHeight的较大值) */\n parent_height?: number\n /** 水印插件挂载的父元素element,不输入则默认挂在body */\n parent_node?: HTMLElement | null\n /** 是否监控,true: 不可删除水印; false: 可删水印 */\n monitor?: boolean\n}\n\n// 默认配置\nconst initialSettings: Required<SettingsType> = {\n id: 'wm_div_id',\n prefix: 'mask_div_id',\n text: '测试水印',\n x: 0,\n y: 0,\n rows: 0,\n cols: 0,\n width: 0,\n height: 0,\n x_space: 100,\n y_space: 40,\n font: '微软雅黑',\n color: 'black',\n fontsize: '18px',\n alpha: 0.15,\n angle: 15,\n parent_width: 0,\n parent_height: 0,\n parent_node: null,\n monitor: true,\n}\n\nfunction calculateTextDimensions(text: string, font: string, fontSize: string): { width: number, height: number } {\n const canvas = document.createElement('canvas')\n const context = canvas.getContext('2d')\n if (!context) {\n return { width: 100, height: 100 }\n }\n\n context.font = `${fontSize} ${font}`\n const metrics = context.measureText(text.trim())\n const fontSizeNum = Number.parseFloat(fontSize)\n\n // 移除 DPI 缩放,直接使用原始值\n const height = (metrics.actualBoundingBoxAscent !== undefined && metrics.actualBoundingBoxDescent !== undefined)\n ? (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent)\n : fontSizeNum\n\n return {\n width: Math.ceil(metrics.width),\n height: Math.ceil(height),\n }\n}\n\nexport function watermark() {\n const globalSetting: Required<SettingsType> = { ...initialSettings }\n let forceRemove = false\n const watermarkDom = new MutationObserver(domChangeCallback)\n const resizeObserver = new ResizeObserver(() => {\n if (!forceRemove) {\n loadMark(globalSetting)\n }\n })\n\n // 计算水印布局\n function calculateWatermarkLayout(pageWidth: number, pageHeight: number) {\n const availableWidth = pageWidth - globalSetting.x\n const availableHeight = pageHeight - globalSetting.y\n\n // 使用固定间距\n const x_space = globalSetting.x_space || 20 // 如果未设置则使用默认值\n const y_space = globalSetting.y_space || 20 // 如果未设置则使用默认值\n\n // 计算能容纳的行数和列数\n const cols = Math.ceil(availableWidth / (globalSetting.width + x_space))\n const rows = Math.ceil(availableHeight / (globalSetting.height + y_space))\n\n return {\n cols,\n rows,\n x_space,\n y_space,\n }\n }\n\n // 创建水印元素\n function createWatermarkElement(x: number, y: number, index: number): HTMLElement {\n const maskDiv = document.createElement('div')\n maskDiv.textContent = globalSetting.text\n maskDiv.id = `${globalSetting.prefix}${index}`\n\n maskDiv.style.cssText = `\n transform: rotate(-${globalSetting.angle}deg);\n position: absolute;\n left: ${x}px;\n top: ${y}px;\n overflow: hidden;\n z-index: 9999999;\n opacity: ${globalSetting.alpha};\n font-size: ${globalSetting.fontsize};\n font-family: ${globalSetting.font};\n color: ${globalSetting.color};\n text-align: center;\n width: ${globalSetting.width}px;\n height: ${globalSetting.height}px;\n line-height: ${globalSetting.height}px;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n visibility: visible;\n `.replace(/\\s+/g, ' ').trim()\n\n return maskDiv\n }\n\n // 加载水印\n function loadMark(settings: Partial<SettingsType>) {\n removeMark()\n Object.assign(globalSetting, settings)\n\n if ((globalSetting.width === 0 && globalSetting.height === 0) || globalSetting.width === 0 || globalSetting.height === 0) {\n // 计算文本尺寸\n const textDimensions = calculateTextDimensions(\n globalSetting.text,\n globalSetting.font,\n globalSetting.fontsize,\n )\n const padding = 10\n if (globalSetting.width === 0) {\n globalSetting.width = textDimensions.width + padding\n }\n if (globalSetting.height === 0) {\n globalSetting.height = textDimensions.height + padding\n }\n }\n\n const parentElement = globalSetting.parent_node || document.body\n const pageWidth = Math.max(parentElement.scrollWidth, parentElement.clientWidth)\n const pageHeight = Math.max(parentElement.scrollHeight, parentElement.clientHeight)\n\n const watermarkContainer = document.createElement('div')\n watermarkContainer.id = globalSetting.id\n\n // 处理父元素定位\n if (parentElement.closest('body') && getComputedStyle(parentElement).position === 'static') {\n parentElement.style.position = 'relative'\n }\n\n watermarkContainer.style.cssText = `\n pointer-events: none;\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999999;\n overflow: hidden;\n `.replace(/\\s+/g, ' ').trim()\n\n const shadowRoot = watermarkContainer.attachShadow ? watermarkContainer.attachShadow({ mode: 'open' }) : watermarkContainer\n\n parentElement.appendChild(watermarkContainer)\n\n const { cols, rows, x_space, y_space } = calculateWatermarkLayout(pageWidth, pageHeight)\n globalSetting.cols = cols\n globalSetting.rows = rows\n globalSetting.x_space = x_space\n globalSetting.y_space = y_space\n\n const fragment = document.createDocumentFragment()\n for (let i = 0; i < rows; i++) {\n const y = globalSetting.y + (globalSetting.height + y_space) * i\n for (let j = 0; j < cols; j++) {\n const x = globalSetting.x + (globalSetting.width + x_space) * j\n fragment.appendChild(createWatermarkElement(x, y, i * cols + j))\n }\n }\n shadowRoot.appendChild(fragment)\n\n if (globalSetting.monitor) {\n // 监听父元素大小变化\n resizeObserver.observe(parentElement)\n\n // 监听水印容器及其子元素\n const config: MutationObserverInit = {\n attributes: true, // 监听属性变化\n childList: true, // 监听子元素变化\n subtree: true, // 监听子树变化\n characterData: true, // 监听文本内容变化\n }\n\n // 监听水印容器\n watermarkDom.observe(watermarkContainer, config)\n\n // 如果使用了 Shadow DOM,还需要监听 shadowRoot 内的元素\n if (shadowRoot !== watermarkContainer) {\n watermarkDom.observe(shadowRoot, config)\n }\n }\n }\n\n // 移除水印\n function removeMark() {\n const watermarkElement = document.getElementById(globalSetting.id)\n watermarkDom.disconnect()\n if (watermarkElement) {\n watermarkElement.parentNode?.removeChild(watermarkElement)\n }\n }\n\n // 监听DOM变化\n function domChangeCallback(records: MutationRecord[]) {\n if (forceRemove) {\n forceRemove = false\n return\n }\n\n const watermarkElement = document.getElementById(globalSetting.id)\n if (!watermarkElement) {\n // 如果水印容器被删除,重新创建\n loadMark(globalSetting)\n return\n }\n\n // 检查是否有任何修改\n const hasChanges = records.some((record) => {\n // 检查元素是否被删除或添加\n if (record.type === 'childList') {\n return true\n }\n\n // 检查属性是否被修改\n if (record.type === 'attributes') {\n return true\n }\n\n // 检查文本内容是否被修改\n if (record.type === 'characterData') {\n return true\n }\n\n return false\n })\n\n if (hasChanges) {\n loadMark(globalSetting)\n }\n }\n\n return {\n addMark: loadMark,\n removeMark: () => {\n forceRemove = true\n // 删除这行,不重置全局配置\n // Object.assign(globalSetting, initialSettings)\n removeMark()\n },\n }\n}\n"],"names":["initialSettings","id","prefix","text","x","y","rows","cols","width","height","x_space","y_space","font","color","fontsize","alpha","angle","parent_width","parent_height","parent_node","monitor","globalSetting","forceRemove","watermarkDom","MutationObserver","records","document","getElementById","loadMark","some","record","type","resizeObserver","ResizeObserver","createWatermarkElement","index","maskDiv","createElement","textContent","style","cssText","replace","trim","settings","removeMark","Object","assign","textDimensions","fontSize","context","getContext","metrics","measureText","fontSizeNum","Number","parseFloat","actualBoundingBoxAscent","actualBoundingBoxDescent","Math","ceil","calculateTextDimensions","padding","parentElement","body","pageWidth","max","scrollWidth","clientWidth","pageHeight","scrollHeight","clientHeight","watermarkContainer","closest","getComputedStyle","position","shadowRoot","attachShadow","mode","appendChild","availableWidth","availableHeight","calculateWatermarkLayout","fragment","createDocumentFragment","i","j","observe","config","attributes","childList","subtree","characterData","watermarkElement","disconnect","parentNode","removeChild","addMark"],"mappings":"aA4CA,MAAMA,EAA0C,CAC9CC,GAAI,YACJC,OAAQ,cACRC,KAAM,OACNC,EAAG,EACHC,EAAG,EACHC,KAAM,EACNC,KAAM,EACNC,MAAO,EACPC,OAAQ,EACRC,QAAS,IACTC,QAAS,GACTC,KAAM,OACNC,MAAO,QACPC,SAAU,OACVC,MAAO,IACPC,MAAO,GACPC,aAAc,EACdC,cAAe,EACfC,YAAa,KACbC,SAAS,qBAyBJ,WACC,MAAAC,EAAwC,IAAKrB,GACnD,IAAIsB,GAAc,EACZ,MAAAC,EAAe,IAAIC,kBA4JzB,SAA2BC,GACzB,GAAIH,EAEF,YADcA,GAAA,GAKhB,IADyBI,SAASC,eAAeN,EAAcpB,IAI7D,YADA2B,EAASP,GAKQI,EAAQI,MAAMC,GAEX,cAAhBA,EAAOC,OAKS,eAAhBD,EAAOC,MAKS,kBAAhBD,EAAOC,SAQXH,EAASP,EAEb,IA/LMW,EAAiB,IAAIC,gBAAe,KACnCX,GACHM,EAASP,EACX,IAyBO,SAAAa,EAAuB9B,EAAWC,EAAW8B,GAC9C,MAAAC,EAAUV,SAASW,cAAc,OA0BhC,OAzBPD,EAAQE,YAAcjB,EAAclB,KACpCiC,EAAQnC,GAAK,GAAGoB,EAAcnB,SAASiC,IAEvCC,EAAQG,MAAMC,QAAU,kCACGnB,EAAcL,8DAE3BZ,wBACDC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AQX,EAAYY,EAErC,CACF,CAGA,SAAS3C,IACP,MAAMgD,EAAmBlE,SAASC,eAAeN,EAAcpB,IAC/DsB,EAAasE,aACTD,GACeA,EAAAE,YAAYC,YAAYH,EAE7C,CAyCO,MAAA,CACLI,QAASpE,EACTgB,WAAYA,KACItB,GAAA,EAGHsB,GAAA,EAGjB"}
package/package.json CHANGED
@@ -1,38 +1,45 @@
1
1
  {
2
2
  "name": "@qxs-bns/utils",
3
- "version": "0.0.17",
4
- "main": "lib/index.js",
5
- "module": "es/index.mjs",
6
- "types": "es/index.d.ts",
7
3
  "type": "module",
8
- "exports": {
9
- ".": {
10
- "types": "./es/index.d.ts",
11
- "import": "./es/index.mjs",
12
- "require": "./lib/index.js"
13
- },
14
- "./es": {
15
- "types": "./es/index.d.ts",
16
- "import": "./es/index.mjs",
17
- "require": "./lib/index.js"
18
- },
19
- "./*": {
20
- "types": "./es/*/index.d.ts",
21
- "import": "./es/*/index.mjs",
22
- "require": "./lib/*/index.js"
23
- }
4
+ "version": "0.0.19",
5
+ "private": false,
6
+ "license": "MIT",
7
+ "sideEffects": false,
8
+ "main": "./es/index.js",
9
+ "peerDependencies": {
10
+ "axios": "^1.7.9"
24
11
  },
25
- "files": [
26
- "es",
27
- "lib"
28
- ],
29
12
  "dependencies": {
30
13
  "ali-oss": "^6.22.0",
31
14
  "ans-javascript-sdk": "^4.5.5",
32
15
  "xlsx": "^0.18.5"
33
16
  },
34
- "devDependencies": {
35
- "@types/ali-oss": "^6.16.11",
36
- "axios": "^1.7.9"
17
+ "module": "./es/index.js",
18
+ "types": "./types/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "import": "./es/index.js",
22
+ "require": "./lib/index.js",
23
+ "types": "./types/index.d.ts"
24
+ },
25
+ "./es": {
26
+ "import": "./es/index.js",
27
+ "require": "./lib/index.js",
28
+ "types": "./types/index.d.ts"
29
+ },
30
+ "./lib": {
31
+ "import": "./es/index.js",
32
+ "require": "./lib/index.js",
33
+ "types": "./types/index.d.ts"
34
+ },
35
+ "./es/*": {
36
+ "import": "./es/*.js",
37
+ "types": "./types/*.d.ts"
38
+ },
39
+ "./lib/*": {
40
+ "require": "./lib/*.js",
41
+ "types": "./types/*.d.ts"
42
+ },
43
+ "./*": "./*"
37
44
  }
38
45
  }
@@ -4,7 +4,9 @@ export * from './src/device';
4
4
  export * from './src/file-operations';
5
5
  export * from './src/json';
6
6
  export * from './src/oss-uploader';
7
+ export * from './src/set-guid';
7
8
  export * from './src/storage';
8
9
  export * from './src/types';
9
10
  export * from './src/use-api';
10
11
  export * from './src/watermark';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
@@ -30,3 +30,4 @@ export declare class ArgoLog<T = EnvironmentConfig> {
30
30
  setProfile: (info: Record<string, any>) => void;
31
31
  setAlias: (code: string) => void;
32
32
  }
33
+ //# sourceMappingURL=argo-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"argo-log.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/argo-log.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,OAAO,CAAC,CAAC,GAAG,iBAAiB;IACxC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAkC;IAC1D,OAAO,CAAC,aAAa,CAAmB;gBAE5B,SAAS,EAAE,CAAC;IAoCxB,KAAK,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,IAAI,CAetD;IAED,UAAU,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,IAAI,CAW7C;IAED,QAAQ,GAAI,MAAM,MAAM,KAAG,IAAI,CAW9B;CACF"}
@@ -9,3 +9,4 @@
9
9
  * 3. 大于等于24小时:显示 x天x小时x分钟
10
10
  */
11
11
  export declare function formatDuration(ms: number): string;
12
+ //# sourceMappingURL=date-transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-transfer.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/date-transfer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAuCjD"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 获取设备类型
3
+ * @returns {string} 设备类型: "iOS", "Android" 或 "desktop"
4
+ */
5
+ export declare function getDeviceType(): "iOS" | "Android" | "desktop";
6
+ /**
7
+ * 判断是否是移动端
8
+ */
9
+ export declare function isMobile(): boolean;
10
+ /**
11
+ * 判断是否是ios
12
+ */
13
+ export declare function isIOS(): boolean;
14
+ /**
15
+ * 判断是否是安卓
16
+ */
17
+ export declare function isAndroid(): boolean;
18
+ //# sourceMappingURL=device.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/device.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,aAAa,kCAY5B;AAED;;GAEG;AACH,wBAAgB,QAAQ,YAGvB;AAED;;GAEG;AACH,wBAAgB,KAAK,YAEpB;AAED;;GAEG;AACH,wBAAgB,SAAS,YAExB"}
@@ -40,3 +40,4 @@ export declare function createVideoUploader(options: VideoUploadOptions): Promis
40
40
  */
41
41
  export declare function downloadFile(url: string, fileName: string): void;
42
42
  export {};
43
+ //# sourceMappingURL=file-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-operations.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/file-operations.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,EAAE,GAAG,CAAA;QACjB,GAAG,EAAE,GAAG,CAAA;KACT;CACF;AAoCD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,UAAU,kBAAkB;IAC1B,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACzE,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAA;IAC3C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACvF,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAA;IAC9C,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACtH;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,GAAG,CAAA;CAChB;AACD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,GAAG,CAAA;IACb,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACnD;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CA4E9F;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAQzD"}
@@ -13,3 +13,4 @@ export declare function JsonToExcel(title?: string, json?: (string | number)[][]
13
13
  * @param start - 开始行号
14
14
  */
15
15
  export declare function excelToJson(file: File, cb: (json: any[]) => void, start: number): Promise<any[]>;
16
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/json.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAK,EAAE,IAAI,GAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAO,EAAE,KAAK,CAAC,EAAE,GAAG,qBAmBpF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAuChG"}
@@ -1,5 +1,4 @@
1
- import { default as OSS } from 'ali-oss';
2
-
1
+ import OSS from 'ali-oss';
3
2
  export interface OssCredentials {
4
3
  accessKeyId: string;
5
4
  accessKeySecret: string;
@@ -41,3 +40,4 @@ export declare class OssUploader {
41
40
  }
42
41
  export declare const uploadFile: typeof OssUploader.uploadFile;
43
42
  export declare const generateSignedUrl: typeof OssUploader.generateSignedUrl;
43
+ //# sourceMappingURL=oss-uploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oss-uploader.d.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I,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;WAyBpG,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG;QAAE,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;WAmBjH,iBAAiB,CACnC,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAAC,EAC3C,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC;CASnB;AAGD,eAAO,MAAM,UAAU,+BAA2C,CAAA;AAClE,eAAO,MAAM,iBAAiB,sCAAkD,CAAA"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 随机id
3
+ */
4
+ export declare function setGuid(): string;
5
+ //# sourceMappingURL=set-guid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-guid.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/set-guid.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,OAAO,WAMtB"}
@@ -24,3 +24,4 @@ declare class Storage {
24
24
  };
25
25
  }
26
26
  export { Storage };
27
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/storage.ts"],"names":[],"mappings":"AACA,cAAM,OAAO;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,MAAM,SAAS;IAI3B,KAAK;mBACQ,MAAM,cAAa,OAAO;mBAI1B,MAAM,cAAa,OAAO;mBAI1B,MAAM,SAAS,MAAM,cAAa,OAAO;sBAItC,MAAM,cAAa,OAAO;;MAOzC;IAED,OAAO;mBACM,MAAM,cAAa,OAAO;mBAI1B,MAAM,cAAa,OAAO;mBAI1B,MAAM,SAAS,MAAM,cAAa,OAAO;sBAItC,MAAM,cAAa,OAAO;;MAOzC;IAED,MAAM;mBACO,MAAM,cAAa,OAAO;mBAI1B,MAAM,cAAa,OAAO;mBAK1B,MAAM,SAAS,MAAM,gEAAyE,OAAO;sBAUlG,MAAM,8CAA4D,OAAO;;MAgBxF;CACF;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -24,3 +24,4 @@ export declare function isImageByMimeType(file: File): boolean;
24
24
  * @returns 如果值是普通对象,则返回 true,否则返回 false
25
25
  */
26
26
  export declare function isPlainObject(value: unknown): value is Record<string, any>;
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,KAAK,GAAG,KAAG,GAAG,IAAI,SAA8B,CAAA;AAC5E,eAAO,MAAM,SAAS,GAAI,KAAK,GAAG,KAAG,GAAG,IAAI,OAAmC,CAAA;AAC/E,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,KAAG,GAAG,IAAI,MAAiC,CAAA;AAE5E,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,OAAO,CAKlD;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,WAOvC;AAkBD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,WAE3C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAW1E"}
@@ -1,5 +1,4 @@
1
- import { AxiosInstance, AxiosRequestConfig, AxiosStatic } from 'axios';
2
-
1
+ import type { AxiosInstance, AxiosRequestConfig } from 'axios';
3
2
  export interface SuccessResponse<T> {
4
3
  code: number;
5
4
  count: number;
@@ -34,9 +33,8 @@ type RequestParams<T> = T extends {
34
33
  } ? T['params'] : T;
35
34
  export declare class ApiService<T extends ApiTypeMap<U>, U extends UrlObjectType> {
36
35
  private apiInstance;
37
- private axiosInstance;
38
36
  private static instance;
39
- constructor(apiInstance: AxiosInstance, axiosInstance: AxiosStatic);
37
+ constructor(apiInstance: AxiosInstance);
40
38
  private isBusinessError;
41
39
  private isAxiosResponse;
42
40
  private isErrorResponse;
@@ -45,3 +43,4 @@ export declare class ApiService<T extends ApiTypeMap<U>, U extends UrlObjectType
45
43
  }, params?: RequestParams<T[K["url"]]["request"]>, isWholeResponse?: W) => Promise<UseApiResponse<W, T[K["url"]]["response"]>>;
46
44
  }
47
45
  export {};
46
+ //# sourceMappingURL=use-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-api.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/use-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAiB,MAAM,OAAO,CAAA;AAG7E,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,CAAA;IACP,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,OAAO,GAAG,KAAK,EAAE,CAAC,GAAG,OAAO;IACpE,GAAG,EAAE,CAAC,SAAS,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC5C,KAAK,EAAE,aAAa,GAAG,IAAI,CAAA;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,KAAK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,CAAC,EAC9C,kBAAkB,CAAC,KAClB,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAiCrD;CACF"}
@@ -45,3 +45,4 @@ export declare function watermark(): {
45
45
  removeMark: () => void;
46
46
  };
47
47
  export {};
48
+ //# sourceMappingURL=watermark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watermark.d.ts","sourceRoot":"","sources":["../../../../packages/utils/src/watermark.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,cAAc;IACd,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,eAAe;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iBAAiB;IACjB,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,iBAAiB;IACjB,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qCAAqC;IACrC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAChC,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAgDD,wBAAgB,SAAS;wBA+DK,OAAO,CAAC,YAAY,CAAC;;EA+IlD"}
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../packages/utils/src/argo-log.ts","../../../packages/utils/src/date-transfer.ts","../../../packages/utils/src/device.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/hmrpayload.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/customevent.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/hot.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/importglob.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/types/importmeta.d.ts","../../../node_modules/.pnpm/vite@6.2.1_@types+node@22.13.10_jiti@2.4.2_sass-embedded@1.85.1_sass@1.85.1_terser@5.39.0_tsx@4.19.3_yaml@2.7.0/node_modules/vite/client.d.ts","../../../packages/utils/src/file-operations.ts","../../../node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/types/index.d.ts","../../../packages/utils/src/json.ts","../../../node_modules/.pnpm/@types+ali-oss@6.16.11/node_modules/@types/ali-oss/index.d.ts","../../../packages/utils/src/oss-uploader.ts","../../../packages/utils/src/set-guid.ts","../../../packages/utils/src/storage.ts","../../../packages/utils/src/types.ts","../../../node_modules/.pnpm/axios@1.8.2/node_modules/axios/index.d.ts","../../../packages/utils/src/use-api.ts","../../../packages/utils/src/watermark.ts","../../../packages/utils/index.ts","../../../packages/utils/shims.d.ts","../../../node_modules/.pnpm/@types+estree@1.0.6/node_modules/@types/estree/index.d.ts","../../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts","../../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/use-at-your-own-risk.d.ts","../../../node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index.d.ts","../../../node_modules/.pnpm/@types+eslint-scope@3.7.7/node_modules/@types/eslint-scope/index.d.ts"],"fileIdsList":[[70,73],[70,71,72],[73],[55],[51],[52],[53,54],[48,49,50,57,59,61,62,63,64,66,67],[69],[56],[58],[60],[64,65]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"9efe271422d844c9a36e0ea606704268e4c8ee34bd2a194e954a31381475ea55","signature":"a8f6c54b02a016b0a4c0cbe6a878df7f2656f9a3f43986ad257d45665e612e94"},{"version":"72af2f99ff91a9a6767e9374d5bcfdfa734f056e0ca4f99acfbdc0b6910cbe6a","signature":"642691020b5d2610d98d8dfa25df7e7c58a2e885d24bdec278f98842b02892f6"},{"version":"de9652b1bdad8aa2fa302b263a6a72265b276fec040394aa3b6c1adcff419ebc","signature":"6364be1269de7f1efc40324fb2cadc9a17d9bd2742d5bc1b95e309d848ca50f6"},{"version":"02b1133807234b1a7d9bf9b1419ee19444dd8c26b101bc268aa8181591241f1f","impliedFormat":1},{"version":"6222e987b58abfe92597e1273ad7233626285bc2d78409d4a7b113d81a83496b","impliedFormat":1},{"version":"cbe726263ae9a7bf32352380f7e8ab66ee25b3457137e316929269c19e18a2be","impliedFormat":1},{"version":"7f698624bbbb060ece7c0e51b7236520ebada74b747d7523c7df376453ed6fea","impliedFormat":1},{"version":"4025a454b1ca489b179ee8c684bdd70ff8c1967e382076ade53e7e4653e1daec","affectsGlobalScope":true,"impliedFormat":1},{"version":"1eef826bc4a19de22155487984e345a34c9cd511dd1170edc7a447cb8231dd4a","affectsGlobalScope":true,"impliedFormat":99},{"version":"e3c551500bab7aea1c3065871fa5689e723598adbc0e5854aceee8b0a7cdb51f","signature":"4f8d8bcaa7127e5ed2d649cd5fc16b4e46b6d6960d82982ede8429d8066f9b96","affectsGlobalScope":true},{"version":"593654eebe902db28ca173f021f74ea9f77e8b344aebb0a80fa4d10f29bb3a9d","impliedFormat":1},{"version":"19f50a093aa873de6321cd996913aa89e0ec5308a8ae49bf05f071cd9614d0c6","signature":"10ee1d72a1aeb7992ec2517f444db7d425261969e0476b94a1bef6e47fd5c4b6"},{"version":"07e3a9a4ac19e4b39c9403908e87cd24166f9392851d566e0e32b2271dedb4e8","impliedFormat":1},{"version":"42b4030b8dfde5376043f3dd2ce1296697d0e6905f21f2c93463b1d22c4862a0","signature":"28568c2a38ace4ec018e86ea1bdb429d563b3765af5d386b15c6b5a7055e348b"},{"version":"b661af9a80f1690400c4e230fc012525de39b87e9ed2d44b9501581eaf6f8102","signature":"3452b2a4e467983a2cebf29bed5e4810866b8b191972cb9ed23f8c3907dfb56e"},{"version":"7484cd645652e5de0e944021ff47e2794cd64e91ccba9e2ddfe2e5c4c7e62b89","signature":"b5ff6435fa9c6d61900a8764225558104fce909c6005109cb4ec42a6772052bd"},{"version":"7ad9aed3f5dc3de5049e8ba6912319dace213430b8babffad59e9b3cb8835760","signature":"a7b65e5fbd85d753c99c13a242176ec0f4f024108de502acbd52f82108f9386d"},{"version":"dc602ef9638db2163c461ec64133fe76f890f6e03b69b1c96f5c5e59592025e8","impliedFormat":99},{"version":"9b1a91ded1ee70a40efc83bcdb8b8d30d8d5c76ba242b212340e336db9cdaacc","signature":"8874c78b276f3814fbd836fe203e419eab5070a0475219239ffa5d1df9d27af8"},{"version":"808c2f0eb7b2f0649c958a8ec904dd0d536d25005206181724bfd8a81770cfca","signature":"d5558453f558b2d33d9ad6ca2de541eac57fadc92e45cf8872d934956a937152"},{"version":"c03fbd1cf61ca9df4c98bf961f830ab1c969125d52d08fcb735832f7ba5eab38","signature":"11ed0f688306271bcf71f6e820151ae9fa88709a6512ead1790970439ee8dd7d"},{"version":"c5b10ab86f8531b13e850a61020f9209e786ae6940fab1c4a12fc4c34267a3c4","affectsGlobalScope":true},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1}],"root":[[48,50],57,59,[61,64],[66,69]],"options":{"allowJs":true,"composite":true,"declaration":true,"declarationDir":"./","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../../packages/utils","skipLibCheck":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[74,1],[73,2],[72,3],[56,4],[52,5],[53,6],[55,7],[68,8],[48,9],[57,10],[59,11],[61,12],[66,13]],"latestChangedDtsFile":"./index.d.ts","version":"5.8.2"}