@qy_better_lib/hooks 0.1.7 → 0.1.9

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.
@@ -1,4 +1,4 @@
1
- (function(u,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("mitt")):typeof define=="function"&&define.amd?define(["exports","vue","mitt"],f):(u=typeof globalThis<"u"?globalThis:u||self,f(u["@qy_better_lib/hooks"]={},u.vue,u.mitt))})(this,(function(u,f,R){"use strict";function C(){const t=R();return t.emitAsync=async function(n,...a){const e=this.all?.get(n);if(!e||e.length===0)return[];const r=e.map(i=>{try{const l=i(...a);return l instanceof Promise?l:Promise.resolve(l)}catch(l){return Promise.reject(l)}});return Promise.all(r)},t}const g=C();function U(t){return f.onMounted(()=>{if(t&&t.length>0)for(let n=0;n<t.length;n++){debugger;g.on(t[n].key,t[n].value)}}),f.onUnmounted(()=>{if(t&&t.length>0)for(let n=0;n<t.length;n++)g.off(t[n].key,t[n].value),g.all.delete(t[n].key)}),{emitter:g}}function M(){function t(e,r){const i=document.createElement("a");i.href=e,i.target="_blank",r&&i.setAttribute("download",r),document.body.appendChild(i),i.click(),document.body.removeChild(i)}function n(e){e.forEach(r=>{t(r.url,r.name)})}async function a(e){if(!e)return;const r=new FileReader;return r.readAsDataURL(e),new Promise((i,l)=>{r.onload=o=>i(o.target?.result),r.onerror=o=>l(void 0)})}return{downLoadFile:t,downLoadFiles:n,toBase64:a}}function F(){function t(o){let c=n(),d=e(o);document.body.appendChild(c),document.body.appendChild(d),r(d).then(()=>{window.print(),document.body.removeChild(c),document.body.removeChild(d)})}function n(o){let c=`#print-container {
1
+ (function(u,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("mitt"),require("vue")):typeof define=="function"&&define.amd?define(["exports","mitt","vue"],y):(u=typeof globalThis<"u"?globalThis:u||self,y(u["@qy_better_lib/hooks"]={},u.mitt,u.vue))})(this,(function(u,y,R){"use strict";function C(){if(typeof y>"u")return{};const t=y();return t.emitAsync=async function(n,...a){const e=this.all?.get(n);if(!e||e.length===0)return[];const r=e.map(i=>{try{const l=i(...a);return l instanceof Promise?l:Promise.resolve(l)}catch(l){return Promise.reject(l)}});return Promise.all(r)},t}const g=C();function U(t){return typeof y>"u"?{emitter:g}:(R.onMounted(()=>{if(t&&t.length>0)for(let n=0;n<t.length;n++){debugger;g.on(t[n].key,t[n].value)}}),R.onUnmounted(()=>{if(t&&t.length>0)for(let n=0;n<t.length;n++)g.off(t[n].key,t[n].value),g.all.delete(t[n].key)}),{emitter:g})}function M(){function t(e,r){const i=document.createElement("a");i.href=e,i.target="_blank",r&&i.setAttribute("download",r),document.body.appendChild(i),i.click(),document.body.removeChild(i)}function n(e){e.forEach(r=>{t(r.url,r.name)})}async function a(e){if(!e)return;const r=new FileReader;return r.readAsDataURL(e),new Promise((i,l)=>{r.onload=o=>i(o.target?.result),r.onerror=o=>l(void 0)})}return{downLoadFile:t,downLoadFiles:n,toBase64:a}}function F(){function t(o){let c=n(),d=e(o);document.body.appendChild(c),document.body.appendChild(d),r(d).then(()=>{window.print(),document.body.removeChild(c),document.body.removeChild(d)})}function n(o){let c=`#print-container {
2
2
  display: none;
3
3
  }
4
4
  @media print {
@@ -12,4 +12,4 @@
12
12
  #print-container {
13
13
  display: block;
14
14
  }
15
- }`,d=document.createElement("style");return d.innerHTML=c,d}function a(){let o=document.getElementById("print-container");o&&document?.querySelector("body")?.removeChild(o)}function e(o){a();let c=document.createElement("div");return c.setAttribute("id","print-container"),c.innerHTML=o,c}function r(o){let c=o.querySelectorAll("img");const d=[].slice.call(c);if(d.length===0)return Promise.resolve();let m=0;return new Promise(h=>{function s(){m++,m===d.length&&h()}d.forEach(y=>{y.addEventListener("load",s),y.addEventListener("error",s)})})}function i(o){const c=document.querySelector(o);c&&t(c.innerHTML)}function l(o){let c="";for(let d=0;d<o.length;d++)c+=o[d].outerHTML;c&&t(c)}return{printHtml:i,printHtmlElement:l}}function j(){const t="A77B030B-E33D-C656-7642-56D6FEA46059";function n(r=null,i,l,o){let c=e(r,i,l,o);document.getElementById(c)===null&&(c=e(r,i,l))}function a(){document.getElementById(t)?.remove()}function e(r=null,i,l,o="#999"){const c=r!=null?document.querySelector(r):document.body,d=document.getElementById(t);d!==null&&c?.removeChild(d);let m=document.createElement("canvas");m.width=250,m.height=150;let h=m.getContext("2d");h&&(h.font="16px Avenir,Helvetica,Arial,sans-serif",h.fillStyle=o.replace(/\,\s(1|(0.\d+)\))/,", 0.1"),h.textAlign="left",h.textBaseline="middle",h.rotate(-15*Math.PI/180),h?.fillText(i,0,m.height),l&&h?.fillText(l,h.measureText(i).width+16,m.height));let s=document.createElement("div");s.id=t,s.style.pointerEvents="none",s.style.top="0px",s.style.left="0px",s.style.position="fixed",s.style.zIndex="100000";const{clientWidth:y,clientHeight:b}=document.documentElement;return s.style.width=y+"px",s.style.height=b+"px",s.style.background="url("+m.toDataURL("image/png")+") left top repeat",c?.appendChild(s),t}return{createWaterMark:n,removeWatermark:a}}function A(t){let n=0,a=!1,e,r;const{server:i,receive:l}=t;window.onbeforeunload=()=>{e?.close()};function o(){try{e=new WebSocket(i),d()}catch(s){console.log("连接建立异常",s)}}function c(){if(n>=5){e?.close();return}if(a)return!1;a=!0,r=setTimeout(function(){o(),a=!1,n++,r&&clearTimeout(r)},5e3)}function d(){e&&(e.onerror=s=>{console.log("连接错误",s),c()},e.onclose=()=>{console.log("连接关闭 - "+new Date().toLocaleTimeString()),c()},e.onopen=()=>{n=0,console.log("连接成功")},e.onmessage=s=>{try{l(s)}catch{console.log("message:"+s.data)}})}function m(s){e?.readyState===WebSocket.OPEN&&e?.send(s)}function h(){e?.close()}return{ws:e,create:o,socketClose:h,sendMessage:m}}var w=(t=>(t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t))(w||{});function p(t){return["image/png","image/jpeg","image/gif"].some(n=>n===t)}async function v(t,n=.92,a=w.JPEG){return p(a)||(a=w.JPEG),t.toDataURL(a,n)}function S(t,n=.92,a=w.JPEG){return new Promise(e=>t.toBlob(r=>e(r),a,n))}async function E(t,n){const a=t.split(",");let e=a[0].match(/:(.*?);/)?.[1];const r=atob(a[1]);let i=r.length;const l=new Uint8Array(i);for(;i--;)l[i]=r.charCodeAt(i);return p(n)&&(e=n),new Blob([l],{type:e})}function k(t){return new Promise((n,a)=>{const e=new Image;e.onload=()=>n(e),e.onerror=()=>a(new Error("dataURLtoImage(): dataURL is illegal")),e.src=t})}function z(t,n){const a=document.createElement("a");a.href=window.URL.createObjectURL(t),a.download=n||Date.now().toString(36),document.body.appendChild(a);const e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),a.dispatchEvent(e),document.body.removeChild(a)}function L(t){return new Promise(n=>{const a=new FileReader;a.onloadend=e=>n(e.target?.result),a.readAsDataURL(t)})}async function P(t,n={}){const a={...n},e=document.createElement("canvas"),r=e.getContext("2d");let i,l;for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&(a[o]=Number(a[o]));if(!a.scale)l=a.width||(a.height||0)*t.width/t.height||t.width,i=a.height||(a.width||0)*t.height/t.width||t.height;else{const o=a.scale>0&&a.scale<10?a.scale:1;l=t.width*o,i=t.height*o}switch([5,6,7,8].some(o=>o===a.orientation)?(e.height=l,e.width=i):(e.height=i,e.width=l),a.orientation){case 3:r.rotate(180*Math.PI/180),r.drawImage(t,-e.width,-e.height,e.width,e.height);break;case 6:r.rotate(90*Math.PI/180),r.drawImage(t,0,-e.width,e.height,e.width);break;case 8:r.rotate(270*Math.PI/180),r.drawImage(t,-e.height,0,e.height,e.width);break;case 2:r.translate(e.width,0),r.scale(-1,1),r.drawImage(t,0,0,e.width,e.height);break;case 4:r.translate(e.width,0),r.scale(-1,1),r.rotate(180*Math.PI/180),r.drawImage(t,-e.width,-e.height,e.width,e.height);break;case 5:r.translate(e.width,0),r.scale(-1,1),r.rotate(90*Math.PI/180),r.drawImage(t,0,-e.width,e.height,e.width);break;case 7:r.translate(e.width,0),r.scale(-1,1),r.rotate(270*Math.PI/180),r.drawImage(t,-e.height,0,e.height,e.width);break;default:r.drawImage(t,0,0,e.width,e.height)}return e}function B(t){return fetch(t).then(n=>n.blob())}function D(t){return new Promise((n,a)=>{const e=new Image;e.onload=()=>n(e),e.onerror=()=>a(new Error("urltoImage(): Image failed to load, please check the image URL")),e.src=t})}async function T(t,n={}){if(!(t instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if(typeof n!="object"&&(n=Object.assign({quality:n})),n.quality=Number(n.quality),Number.isNaN(n.quality))return t;const a=await L(t);let e=a.split(",")[0].match(/:(.*?);/)?.[1],r=w.JPEG;p(n.type)&&(r=n.type,e=n.type);const i=await k(a),l=await P(i,Object.assign({},n)),o=await v(l,n.quality,r),c=await E(o,e);return c.size>t.size?t:c}async function q(t,n={}){if(!(t instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if(typeof n!="object"&&(n=Object.assign({size:n})),n.size=Number(n.size),Number.isNaN(n.size)||n.size*1024>t.size)return t;n.accuracy=Number(n.accuracy),(!n.accuracy||n.accuracy<.8||n.accuracy>.99)&&(n.accuracy=.95);const a={max:n.size*(2-n.accuracy)*1024,accurate:n.size*1024,min:n.size*n.accuracy*1024},e=await L(t);let r=e.split(",")[0].match(/:(.*?);/)?.[1],i=w.JPEG;p(n.type)&&(i=n.type,r=n.type);const l=await k(e),o=await P(l,Object.assign({},n)),c=.75;let d=1,m;const h=new Array(2);for(let y=1;y<=7;y++){m=await v(o,d,i);const b=m.length*c;if(y===7){(a.max<b||a.min>b)&&(m=[m,...h].filter(I=>I).sort((I,H)=>Math.abs(I.length*c-a.accurate)-Math.abs(H.length*c-a.accurate))[0]);break}if(a.max<b)h[1]=m,d-=.5**(y+1);else if(a.min>b)h[0]=m,d+=.5**(y+1);else break}const s=await E(m,r);return s.size>t.size?t:s}u.canvastoDataURL=v,u.canvastoFile=S,u.compress=T,u.compressAccurately=q,u.dataURLtoFile=E,u.dataURLtoImage=k,u.downloadFile=z,u.filetoDataURL=L,u.imagetoCanvas=P,u.urltoBlob=B,u.urltoImage=D,u.useEmits=U,u.useFile=M,u.usePrintHtml=F,u.useWaterMark=j,u.useWebSocket=A,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
15
+ }`,d=document.createElement("style");return d.innerHTML=c,d}function a(){let o=document.getElementById("print-container");o&&document?.querySelector("body")?.removeChild(o)}function e(o){a();let c=document.createElement("div");return c.setAttribute("id","print-container"),c.innerHTML=o,c}function r(o){let c=o.querySelectorAll("img");const d=[].slice.call(c);if(d.length===0)return Promise.resolve();let m=0;return new Promise(h=>{function s(){m++,m===d.length&&h()}d.forEach(f=>{f.addEventListener("load",s),f.addEventListener("error",s)})})}function i(o){const c=document.querySelector(o);c&&t(c.innerHTML)}function l(o){let c="";for(let d=0;d<o.length;d++)c+=o[d].outerHTML;c&&t(c)}return{printHtml:i,printHtmlElement:l}}function j(){const t="A77B030B-E33D-C656-7642-56D6FEA46059";function n(r=null,i,l,o){let c=e(r,i,l,o);document.getElementById(c)===null&&(c=e(r,i,l))}function a(){document.getElementById(t)?.remove()}function e(r=null,i,l,o="#999"){const c=r!=null?document.querySelector(r):document.body,d=document.getElementById(t);d!==null&&c?.removeChild(d);let m=document.createElement("canvas");m.width=250,m.height=150;let h=m.getContext("2d");h&&(h.font="16px Avenir,Helvetica,Arial,sans-serif",h.fillStyle=o.replace(/\,\s(1|(0.\d+)\))/,", 0.1"),h.textAlign="left",h.textBaseline="middle",h.rotate(-15*Math.PI/180),h?.fillText(i,0,m.height),l&&h?.fillText(l,h.measureText(i).width+16,m.height));let s=document.createElement("div");s.id=t,s.style.pointerEvents="none",s.style.top="0px",s.style.left="0px",s.style.position="fixed",s.style.zIndex="100000";const{clientWidth:f,clientHeight:b}=document.documentElement;return s.style.width=f+"px",s.style.height=b+"px",s.style.background="url("+m.toDataURL("image/png")+") left top repeat",c?.appendChild(s),t}return{createWaterMark:n,removeWatermark:a}}function A(t){let n=0,a=!1,e,r;const{server:i,receive:l}=t;window.onbeforeunload=()=>{e?.close()};function o(){try{e=new WebSocket(i),d()}catch(s){console.log("连接建立异常",s)}}function c(){if(n>=5){e?.close();return}if(a)return!1;a=!0,r=setTimeout(function(){o(),a=!1,n++,r&&clearTimeout(r)},5e3)}function d(){e&&(e.onerror=s=>{console.log("连接错误",s),c()},e.onclose=()=>{console.log("连接关闭 - "+new Date().toLocaleTimeString()),c()},e.onopen=()=>{n=0,console.log("连接成功")},e.onmessage=s=>{try{l(s)}catch{console.log("message:"+s.data)}})}function m(s){e?.readyState===WebSocket.OPEN&&e?.send(s)}function h(){e?.close()}return{ws:e,create:o,socketClose:h,sendMessage:m}}var w=(t=>(t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t))(w||{});function p(t){return["image/png","image/jpeg","image/gif"].some(n=>n===t)}async function v(t,n=.92,a=w.JPEG){return p(a)||(a=w.JPEG),t.toDataURL(a,n)}function S(t,n=.92,a=w.JPEG){return new Promise(e=>t.toBlob(r=>e(r),a,n))}async function E(t,n){const a=t.split(",");let e=a[0].match(/:(.*?);/)?.[1];const r=atob(a[1]);let i=r.length;const l=new Uint8Array(i);for(;i--;)l[i]=r.charCodeAt(i);return p(n)&&(e=n),new Blob([l],{type:e})}function k(t){return new Promise((n,a)=>{const e=new Image;e.onload=()=>n(e),e.onerror=()=>a(new Error("dataURLtoImage(): dataURL is illegal")),e.src=t})}function z(t,n){const a=document.createElement("a");a.href=window.URL.createObjectURL(t),a.download=n||Date.now().toString(36),document.body.appendChild(a);const e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),a.dispatchEvent(e),document.body.removeChild(a)}function L(t){return new Promise(n=>{const a=new FileReader;a.onloadend=e=>n(e.target?.result),a.readAsDataURL(t)})}async function P(t,n={}){const a={...n},e=document.createElement("canvas"),r=e.getContext("2d");let i,l;for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&(a[o]=Number(a[o]));if(!a.scale)l=a.width||(a.height||0)*t.width/t.height||t.width,i=a.height||(a.width||0)*t.height/t.width||t.height;else{const o=a.scale>0&&a.scale<10?a.scale:1;l=t.width*o,i=t.height*o}switch([5,6,7,8].some(o=>o===a.orientation)?(e.height=l,e.width=i):(e.height=i,e.width=l),a.orientation){case 3:r.rotate(180*Math.PI/180),r.drawImage(t,-e.width,-e.height,e.width,e.height);break;case 6:r.rotate(90*Math.PI/180),r.drawImage(t,0,-e.width,e.height,e.width);break;case 8:r.rotate(270*Math.PI/180),r.drawImage(t,-e.height,0,e.height,e.width);break;case 2:r.translate(e.width,0),r.scale(-1,1),r.drawImage(t,0,0,e.width,e.height);break;case 4:r.translate(e.width,0),r.scale(-1,1),r.rotate(180*Math.PI/180),r.drawImage(t,-e.width,-e.height,e.width,e.height);break;case 5:r.translate(e.width,0),r.scale(-1,1),r.rotate(90*Math.PI/180),r.drawImage(t,0,-e.width,e.height,e.width);break;case 7:r.translate(e.width,0),r.scale(-1,1),r.rotate(270*Math.PI/180),r.drawImage(t,-e.height,0,e.height,e.width);break;default:r.drawImage(t,0,0,e.width,e.height)}return e}function B(t){return fetch(t).then(n=>n.blob())}function D(t){return new Promise((n,a)=>{const e=new Image;e.onload=()=>n(e),e.onerror=()=>a(new Error("urltoImage(): Image failed to load, please check the image URL")),e.src=t})}async function T(t,n={}){if(!(t instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if(typeof n!="object"&&(n=Object.assign({quality:n})),n.quality=Number(n.quality),Number.isNaN(n.quality))return t;const a=await L(t);let e=a.split(",")[0].match(/:(.*?);/)?.[1],r=w.JPEG;p(n.type)&&(r=n.type,e=n.type);const i=await k(a),l=await P(i,Object.assign({},n)),o=await v(l,n.quality,r),c=await E(o,e);return c.size>t.size?t:c}async function q(t,n={}){if(!(t instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if(typeof n!="object"&&(n=Object.assign({size:n})),n.size=Number(n.size),Number.isNaN(n.size)||n.size*1024>t.size)return t;n.accuracy=Number(n.accuracy),(!n.accuracy||n.accuracy<.8||n.accuracy>.99)&&(n.accuracy=.95);const a={max:n.size*(2-n.accuracy)*1024,accurate:n.size*1024,min:n.size*n.accuracy*1024},e=await L(t);let r=e.split(",")[0].match(/:(.*?);/)?.[1],i=w.JPEG;p(n.type)&&(i=n.type,r=n.type);const l=await k(e),o=await P(l,Object.assign({},n)),c=.75;let d=1,m;const h=new Array(2);for(let f=1;f<=7;f++){m=await v(o,d,i);const b=m.length*c;if(f===7){(a.max<b||a.min>b)&&(m=[m,...h].filter(I=>I).sort((I,H)=>Math.abs(I.length*c-a.accurate)-Math.abs(H.length*c-a.accurate))[0]);break}if(a.max<b)h[1]=m,d-=.5**(f+1);else if(a.min>b)h[0]=m,d+=.5**(f+1);else break}const s=await E(m,r);return s.size>t.size?t:s}u.canvastoDataURL=v,u.canvastoFile=S,u.compress=T,u.compressAccurately=q,u.dataURLtoFile=E,u.dataURLtoImage=k,u.downloadFile=z,u.filetoDataURL=L,u.imagetoCanvas=P,u.urltoBlob=B,u.urltoImage=D,u.useEmits=U,u.useFile=M,u.usePrintHtml=F,u.useWaterMark=j,u.useWebSocket=A,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,3 @@
1
+ import { ECOption } from './type';
2
+ declare const _default: ECOption;
3
+ export default _default;
@@ -5,6 +5,10 @@ import * as echarts from 'echarts/core';
5
5
  * @returns echartsType
6
6
  */
7
7
  export default function useEcharts(): {
8
+ renderChart?: undefined;
9
+ removeChart?: undefined;
10
+ getChart?: undefined;
11
+ } | {
8
12
  renderChart: (option: ECOption, domId: string, isdark?: boolean, renderer?: "canvas" | "svg") => echarts.ECharts | undefined;
9
13
  removeChart: (domId: string) => void;
10
14
  getChart: (domId: string) => echarts.ECharts | undefined;
@@ -1,10 +1,7 @@
1
- import { ECOption } from './type';
2
- declare const options: ECOption;
3
1
  /**
4
2
  * Echarts图表字体、间距自适应
5
3
  * @param size
6
4
  * @param defalteWidth
7
5
  * @returns
8
6
  */
9
- export declare function auto_chart_size(size: number, defalteWidth?: number): number | undefined;
10
- export default options;
7
+ export declare function auto_chart_size(size: number, defalteWidth?: number): number;
@@ -1,21 +1,23 @@
1
- import c from "mitt";
2
- function a() {
3
- const e = c();
4
- return e.emitAsync = async function(n, ...s) {
5
- const t = this.all?.get(n);
6
- if (!t || t.length === 0)
1
+ import n from "mitt";
2
+ function u() {
3
+ if (typeof n > "u")
4
+ return {};
5
+ const t = n();
6
+ return t.emitAsync = async function(o, ...s) {
7
+ const r = this.all?.get(o);
8
+ if (!r || r.length === 0)
7
9
  return [];
8
- const o = t.map((i) => {
10
+ const i = r.map((c) => {
9
11
  try {
10
- const r = i(...s);
11
- return r instanceof Promise ? r : Promise.resolve(r);
12
- } catch (r) {
13
- return Promise.reject(r);
12
+ const e = c(...s);
13
+ return e instanceof Promise ? e : Promise.resolve(e);
14
+ } catch (e) {
15
+ return Promise.reject(e);
14
16
  }
15
17
  });
16
- return Promise.all(o);
17
- }, e;
18
+ return Promise.all(i);
19
+ }, t;
18
20
  }
19
21
  export {
20
- a as createAsyncEmitter
22
+ u as createAsyncEmitter
21
23
  };
@@ -1,8 +1,9 @@
1
- import { onMounted as m, onUnmounted as u } from "vue";
2
- import { createAsyncEmitter as e } from "./extend.js";
3
- const f = e();
4
- function a(o) {
5
- return m(() => {
1
+ import m from "mitt";
2
+ import { onMounted as e, onUnmounted as u } from "vue";
3
+ import { createAsyncEmitter as n } from "./extend.js";
4
+ const f = n();
5
+ function p(o) {
6
+ return typeof m > "u" ? { emitter: f } : (e(() => {
6
7
  if (o && o.length > 0)
7
8
  for (let r = 0; r < o.length; r++) {
8
9
  debugger;
@@ -14,8 +15,8 @@ function a(o) {
14
15
  f.off(o[r].key, o[r].value), f.all.delete(o[r].key);
15
16
  }), {
16
17
  emitter: f
17
- };
18
+ });
18
19
  }
19
20
  export {
20
- a as useEmits
21
+ p as useEmits
21
22
  };
@@ -1,9 +1,15 @@
1
1
  import { default as mqtt } from 'mqtt';
2
2
  export default function useMQTT(url: string, options?: mqtt.IClientOptions): {
3
+ connect?: undefined;
4
+ close?: undefined;
5
+ subscribe?: undefined;
6
+ unsubscribe?: undefined;
7
+ publish?: undefined;
8
+ } | {
3
9
  connect: ({ success, err, receive }: {
4
10
  success: () => void;
5
11
  err: (e: any) => void;
6
- receive: (...args: any) => void;
12
+ receive: (...args: any[]) => void;
7
13
  }) => void;
8
14
  close: () => void;
9
15
  subscribe: (topic: any) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qy_better_lib/hooks",
3
3
  "private": false,
4
- "version": "0.1.7",
4
+ "version": "0.1.9",
5
5
  "description": "qy better lib hooks",
6
6
  "author": "luhuiming",
7
7
  "license": "ISC",
@@ -33,11 +33,7 @@
33
33
  "exports": {
34
34
  ".": {
35
35
  "import": "./lib/index.js"
36
- },
37
- "./use-chart": "./lib/use-chart/index.js",
38
- "./use-chart/*": "./lib/use-chart/*/*.js",
39
- "./use-utils": "./lib/use-utils/index.js",
40
- "./use-utils/*": "./lib/use-utils/*/*.js"
36
+ }
41
37
  },
42
38
  "devDependencies": {
43
39
  "@antv/x6": "^2.18.1",
@@ -52,5 +48,28 @@
52
48
  "vite-plugin-dts": "^4.5.4",
53
49
  "vue": "^3.5.22"
54
50
  },
55
- "dependencies": {}
51
+ "peerDependencies": {
52
+ "@antv/x6": "^2.18.1",
53
+ "dagre": "^0.8.5",
54
+ "echarts": "5.6.0",
55
+ "mitt": "^3.0.1",
56
+ "mqtt": "^5.14.1"
57
+ },
58
+ "peerDependenciesMeta": {
59
+ "@antv/x6": {
60
+ "optional": true
61
+ },
62
+ "dagre": {
63
+ "optional": true
64
+ },
65
+ "echarts": {
66
+ "optional": true
67
+ },
68
+ "mitt": {
69
+ "optional": true
70
+ },
71
+ "mqtt": {
72
+ "optional": true
73
+ }
74
+ }
56
75
  }