easy-soft-utility 2.2.0
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.
- package/README.md +11 -0
- package/es/index.d.ts +19 -0
- package/es/index.js +1 -0
- package/es/utils/base64.d.ts +9 -0
- package/es/utils/cacheAssist.d.ts +85 -0
- package/es/utils/checkAssist.d.ts +81 -0
- package/es/utils/colorAssist.d.ts +28 -0
- package/es/utils/common.d.ts +63 -0
- package/es/utils/componentAssist.d.ts +16 -0
- package/es/utils/constants.d.ts +138 -0
- package/es/utils/convertAssist.d.ts +56 -0
- package/es/utils/datetime.d.ts +22 -0
- package/es/utils/formatAssist.d.ts +45 -0
- package/es/utils/htmlAssist.d.ts +4 -0
- package/es/utils/localStorageAssist.d.ts +44 -0
- package/es/utils/lodashTools.d.ts +72 -0
- package/es/utils/loggerAssist.d.ts +53 -0
- package/es/utils/messagePromptAssist.d.ts +112 -0
- package/es/utils/meta.d.ts +75 -0
- package/es/utils/nearestLocalhostNotify.d.ts +9 -0
- package/es/utils/notificationPromptAssist.d.ts +104 -0
- package/es/utils/queryString.d.ts +8 -0
- package/es/utils/userInterfaceGenerate.d.ts +17 -0
- package/package.json +121 -0
package/README.md
ADDED
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./utils/base64";
|
|
2
|
+
export * from "./utils/cacheAssist";
|
|
3
|
+
export * from "./utils/checkAssist";
|
|
4
|
+
export * from "./utils/colorAssist";
|
|
5
|
+
export * from "./utils/common";
|
|
6
|
+
export * from "./utils/componentAssist";
|
|
7
|
+
export * from "./utils/constants";
|
|
8
|
+
export * from "./utils/convertAssist";
|
|
9
|
+
export * from "./utils/datetime";
|
|
10
|
+
export * from "./utils/formatAssist";
|
|
11
|
+
export * from "./utils/htmlAssist";
|
|
12
|
+
export * from "./utils/localStorageAssist";
|
|
13
|
+
export * from "./utils/lodashTools";
|
|
14
|
+
export * from "./utils/loggerAssist";
|
|
15
|
+
export * from "./utils/messagePromptAssist";
|
|
16
|
+
export * from "./utils/meta";
|
|
17
|
+
export * from "./utils/nearestLocalhostNotify";
|
|
18
|
+
export * from "./utils/queryString";
|
|
19
|
+
export * from "./utils/userInterfaceGenerate";
|
package/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"node-cache";import n from"lodash/isBoolean";import e from"lodash/isDate";import r from"lodash/isEqual";import o from"lodash/isFunction";import a from"lodash/isNull";import i from"lodash/isNumber";import u from"lodash/isObject";import c from"lodash/isString";import l from"lodash/isUndefined";import s from"lodash/replace";import f from"lodash/assign";import d from"lodash/assignWith";import h from"lodash/difference";import m from"lodash/dropRight";import g from"lodash/endsWith";import v from"lodash/filter";import p from"lodash/find";import y from"lodash/findIndex";import w from"lodash/first";import b from"lodash/floor";import A from"lodash/forEach";import x from"lodash/get";import S from"lodash/gte";import M from"lodash/map";import E from"lodash/memoize";import D from"lodash/remove";import C from"lodash/reverse";import O from"lodash/round";import I from"lodash/set";import j from"lodash/size";import k from"lodash/sortBy";import N from"lodash/sortedUniq";import P from"lodash/split";import Y from"lodash/startsWith";import T from"lodash/trim";import H from"lodash/uniqBy";import W from"lodash/toNumber";import R from"lodash/toString";import U from"object-hash";import L from"dayjs";import{stringify as B,parse as F}from"qs";function K(t){var n=(t||"").replace(/\s/g,"+");return n=Buffer.from(n,"base64").toString()}function J(t){return Buffer.from(t).toString("base64")}function Q(t){return 1*t<10?"0".concat(t):t}function G(t){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(t)}function V(t){var n=function(t,n){if("object"!==G(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n||"default");if("object"!==G(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===G(n)?n:String(n)}function q(t,n,e){return(n=V(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function z(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function $(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?z(Object(e),!0).forEach((function(n){q(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):z(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function X(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return x(t,n,e)}function Z(t,n){return O(t,n)}function _(t,n,e){return g(t,n,e)}function tt(t){return N(t)}function nt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;return P(t,n,e)}function et(t,n){return f(t,n)}function rt(t,n,e){return d(t,n,e)}function ot(t){return C(t)}function at(t,n){return A(t,n)}function it(t,n){return S(t,n)}function ut(t){return E(t)}function ct(t,n){return b(t,n)}function lt(t){return w(t)}function st(t,n){return Y(t,n)}function ft(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return m(t,n)}function dt(t,n){return H(t,n)}function ht(t){return T(t)}function mt(t,n,e){return s(t,n,e)}function gt(t,n){return D(t,n)}function vt(t,n){return M(t,n)}function pt(t,n,e){return I(t,n,e)}function yt(t){return j(t)}function wt(t,n){return h(t,n)}function bt(t,n){return v(t,n)}function At(t,n){return k(t,n)}function xt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return y(t,n,e)}function St(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return p(t,n,e)}function Mt(t){return Nt(t)}function Et(t){var n="".concat(Nt(t)?null:t).match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);if(null==n)return!1;var e=new Date(n[1],n[3]-1,n[4]);return e.getFullYear()===parseInt(n[1],10)&&e.getMonth()+1===parseInt(n[3],10)&&e.getDate()===parseInt(n[4],10)}function Dt(t){return i(t)}function Ct(t){var n="".concat(Nt(t)?null:t);if(""===n)return!1;return new RegExp(/^([1-9][\d]{0,15}|0)(\.[\d]{1,2})?$/).test(n)}function Ot(t,n){return r(t,n)}function It(t,n){return JSON.stringify(t||{})===JSON.stringify(n||{})}function jt(t){return o(t)}function kt(t){return n(t)}function Nt(t){return l(t)}function Pt(t){return a(t)}function Yt(t){return e(t)}function Tt(t){return c(t)}function Ht(t){return Array.isArray(t)}function Wt(t){return u(t)}function Rt(t){return null!==t&&"object"===G(t)&&!Ht(t)}function Ut(t){return Rt(t)&&jt(t.then)&&jt(t.catch)}function Lt(t){return new RegExp(/(http|https):\/\/([\w.]+\/?)\S*/).test(t)}function Bt(t){return new RegExp(/(data):image\/([\w.]+\/?)\S*/).test(t)}function Ft(t){return""===ht(s(t||""," ",""))}function Kt(t,n){var e=!1;return Ht(t)?(t.some((function(t){return t===n&&(e=!0,!0)})),e):e}var Jt={WEAPP:"WEAPP",WEB:"WEB",RN:"RN",SWAN:"SWAN",ALIPAY:"ALIPAY",TT:"TT",QQ:"QQ",JD:"JD",UNKNOWN:"UNKNOWN"},Qt={loadApiPath:"",firstLoadSuccess:!1,loadSuccess:!1,registering:!1,dataLoading:!1,reloading:!1,searching:!1,refreshing:!1,paging:!1,processing:!1,dispatchComplete:!0,metaData:null,metaExtra:null,metaListData:[],metaOriginalData:null,urlParams:null,externalData:null},Gt={dataLoading:!0},Vt={get:"GET",post:"POST",put:"PUT",delete:"DELETE",trace:"TRACE",connect:"CONNECT"},qt="0",zt=0,$t="1970-01-01 00:00",Xt={number:"number",datetime:"datetime",string:"string",moment:"moment",money:"money",array:"array",boolean:"boolean"},Zt={money:"money",datetime:"datetime",chineseMoney:"chineseMoney",percentage:"percentage"},_t={yearMonthDayHourMinuteSecond:"YYYY-MM-DD HH:mm:ss",yearMonthDayHourMinute:"YYYY-MM-DD HH:mm",yearMonthDay:"YYYY-MM-DD",yearMonth:"YYYY-MM",year:"YYYY",monthDayHourMinuteSecond:"YYYY-MM-DD HH:mm:ss",monthDayHourMinute:"MM-DD HH:mm",monthDay:"MM-DD",hourMinute:"HH:mm",hourMinuteSecond:"HH:mm:ss",month:"MM",day:"DD",hour:"HH",minute:"mm",second:"ss"},tn={moveUp:"moveUp",moveDown:"moveDown"},nn={no:"0",yes:"1"},en={no:0,yes:1},rn={trace:"trace",debug:"debug",warn:"warn",error:"error",info:"info",config:"config",execute:"execute"},on={auto:"auto",text:"text",object:"object"},an={success:"success",error:"error",info:"info",warning:"warning",warn:"warn",open:"open"},un=$({},an),cn=$({},an),ln="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABLCAYAAACGGCK3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA0SURBVHhe7cExAQAAAMKg9U9tDQ8gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIA3NXV7AAHfw7zWAAAAAElFTkSuQmCC",sn=ln;function fn(t){return U(t,{algorithm:"sha1"})}function dn(t){return U(t,{algorithm:"md5"})}function hn(t,n){var e=Math.pow(10,n+1),r=Math.floor(mn(t)*e);return 10*Math.round(r/10)/e}function mn(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=W(t),r=Number.isNaN(e)?0:e;return null==(n||null)?r:hn(r,n)}function gn(t,n,e){if(!Dt(t))throw new Error("value must be number value");var r=mn(t);return void 0!==n&&(r=Math.max(t,n)),void 0!==e&&(r=Math.min(r,e)),r}function vn(t){return Ct(t)?parseFloat(t,10):0}function pn(t){return"".concat(vn(1e3*mn(t)/10),"%")}function yn(t){return R(t)}function wn(t){return!!t}function bn(t){return yn(t).toUpperCase()}function An(t){return yn(t).toLowerCase()}function xn(t){if(null==(t||null))return null;if(Yt(t))return t;if(Tt(t)&&t.indexOf("T")<0){var n=t.replace(/\-/g,"/");return new Date(n)}return new Date(t)}function Sn(t){return Ut(t)?t:Promise.resolve(t)}function Mn(t,n){return Z(t,n)}function En(t){var n=t.target,e=t.convert;if(jt(e))return e(n);if(Tt(e))switch(e){case Xt.number:return mn(n);case Xt.datetime:return xn(n);case Xt.string:return yn(n);case Xt.money:return vn(n);case Xt.array:return null==(n||null)?[]:Ht(n)?n:[n];default:return n}return n}function Dn(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function Cn(t,n){if(t){if("string"==typeof t)return Dn(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Dn(t,n):void 0}}function On(t){return function(t){if(Array.isArray(t))return Dn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function In(t){return"".concat("easy-soft-utility","::").concat(t,"::")}function jn(){var t=navigator.userAgent;return{trident:t.indexOf("Trident")>-1,presto:t.indexOf("Presto")>-1,webKit:t.indexOf("AppleWebKit")>-1,gecko:t.indexOf("Gecko")>-1&&-1===t.indexOf("KHTML"),mobile:!!t.match(/AppleWebKit.*Mobile.*/),ios:!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:t.indexOf("Android")>-1||t.indexOf("Linux")>-1,iPhone:t.indexOf("iPhone")>-1,iPad:t.indexOf("iPad")>-1,webApp:-1===t.indexOf("Safari")}}function kn(){var t;return{versions:jn(),language:(null!==(t=navigator.browserLanguage||navigator.language)&&void 0!==t?t:"").toLowerCase()}}function Nn(t){var n=t.seed,e=t.min||0;return e+(9301*n+49297)%233280/233280*((t.max||1)-e)}function Pn(t){return null==t?null:JSON.parse(JSON.stringify(t))}function Yn(t,n,e){var r=[];return null!=t&&(r=On(t)),null!=e&&(r=[].concat(On(r),On(e))),null!=n&&(r=[n].concat(On(r))),r}function Tn(t,n,e,r,o){var a=r,i=void 0===e?null:e;return null!=n&&("function"==typeof convertValue?a.initialValue=o(t)||i:a.initialValue=t||i),a}function Hn(t,n,e){var r=null;return null==n||(e||[]).forEach((function(e){e[t]===n&&(r=e)})),r}function Wn(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[],a=0;if(e=e||r.length,n)for(a=0;a<n;a++)o[a]=r[0|Math.random()*e];else for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",a=0;a<36;a++)o[a]||(t=0|16*Math.random(),o[a]=r[19===a?3&t|8:t]);return o.join("")}function Rn(t){var n=t.pageNo,e=t.pageSize,r=t.total;return!((r||0)<=0)&&(n||0)*(e||0)<(r||0)}function Un(){return"development"===process.env.NODE_ENV}function Ln(t){return Object.keys(t).map((function(n){return t[n]})).join(",")}var Bn="loggerAssist",Fn={loggerDisplaySwitchPromptSetInformationComplete:!1,loggerDisplaySwitchSetComplete:!1,display:!1},Kn="#F8C471",Jn="#C39BD3",Qn="#89ca78",Gn="#ff4f49",Vn="#00768f",qn="#596032";function zn(t,n){return"".concat(yn(t)).concat(Ft(n?"":" -> ".concat(n)))}function $n(t){var n=t.text,e=t.color,r=void 0===e?"":e,o=t.ancillaryInformation,a={trace:zn(n,void 0===o?"":o)};console.log("%c%s","color:".concat(r,";"),JSON.stringify(a))}function Xn(t){var n=t.data,e=t.color,r=void 0===e?"":e,o=t.dataDescription,a=void 0===o?"":o,i=t.ancillaryInformation,u=void 0===i?"":i;console.log("%c%s","color:".concat(r,";"),JSON.stringify({config:"check the following ".concat(a," data").concat(Ft(u)?"":" -> ".concat(u),".")})),console.log(n)}function Zn(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on.auto,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rn.debug,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=ce();if(Fn.loggerDisplaySwitchSetComplete||Fn.loggerDisplaySwitchPromptSetInformationComplete||(console.log("".concat(In(Bn),"logData -> please set logger display switch before first log, use setLoggerDisplaySwitch to set it.")),Fn.loggerDisplaySwitchPromptSetInformationComplete=!0),o||e===rn.error){var a=null==(n||null)||Ft(n)?on.auto:n;if(!Kt([on.auto,on.text,on.object],a))throw new Error("Invalid log display mode -> ".concat(a));if(a===on.auto&&(a=Tt(t)?on.text:on.object),e===rn.error){if(a===on.text){var i={error:t};console.error(JSON.stringify(i))}a===on.object&&console.error({error:t})}o&&(e===rn.trace&&(a===on.text&&$n({text:t,color:qn,ancillaryInformation:r}),a===on.object&&Xn({data:t,color:qn,dataDescription:"trace",ancillaryInformation:r})),e===rn.debug&&(a===on.text&&$n({text:t,color:Vn,ancillaryInformation:r}),a===on.object&&Xn({data:t,color:Vn,dataDescription:"debug",ancillaryInformation:r})),e===rn.warn&&(a===on.text&&$n({text:t,color:Gn,ancillaryInformation:r}),a===on.object&&Xn({data:t,color:Gn,dataDescription:"warn",ancillaryInformation:r})),e===rn.info&&(a===on.text&&$n({text:t,color:Qn,ancillaryInformation:r}),a===on.object&&Xn({data:t,color:Qn,dataDescription:"info",ancillaryInformation:r})),e===rn.execute&&(a===on.text&&$n({text:t,color:Jn,ancillaryInformation:r}),a===on.object&&Xn({data:t,color:Jn,dataDescription:"execute",ancillaryInformation:r})),e===rn.config&&(a===on.text&&$n({text:t,color:Kn,ancillaryInformation:r}),a===on.object&&Xn({data:t,color:Kn,dataDescription:"config",ancillaryInformation:r})))}}function _n(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Tt(t)?ie(t,rn.warn):ue(t,rn.warn,n)}function te(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Tt(t)?ie(t,rn.info):ue(t,rn.info,n)}function ne(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Tt(t)?ie(t,rn.config):ue(t,rn.config,n)}function ee(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Tt(t)?ie(t,rn.trace):ue(t,rn.trace,n)}function re(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Tt(t)?ie(t,rn.debug):ue(t,rn.debug,n)}function oe(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Tt(t)?ie(t,rn.execute):ue(t,rn.execute,n)}function ae(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Tt(t)?ie(t,rn.error):ue(t,rn.error,n)}function ie(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rn.trace,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Zn(t,on.text,n,e)}function ue(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rn.trace,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Zn(t,on.object,n,e)}function ce(){return wn(Fn.display)}function le(t){Fn.display=wn(t)}var se={mountComplete:!1,target:null};function fe(n){if(Wt(n))throw new Error("".concat(In("cacheAssist"),"setCacheMount -> cache mount target must be a object"));null==(n.localRuntimeCache||null)&&(n.localRuntimeCache=new t),se.target=n,se.mountComplete=!0,te("setCacheMount -> cache mount success.")}function de(t){if(Ft(t))throw new Error("checkKey -> cache key is null or empty.");if(!Tt(t)&&!Dt(t))throw ae(t),new Error("checkKey -> cache key must be string or number,you can check it in console.")}function he(){if(!se.mountComplete||!se.target||!se.target.localRuntimeCache)throw new Error("getCachePool -> please use setCacheMount function to set cache mount target before get it.");return se.target.localRuntimeCache}function me(t){var n=t.key,e=he();if(null==e)throw new Error("cache pool not exist");return e.has(n)}function ge(t){var n=t.key,e=t.value,r=t.expiration,o=void 0===r?0:r;de(n);var a=he();if(null==a)throw new Error("cache pool not exist");return a.set(n,e,o)}function ve(t){if(!Ht(t))throw new Error("setMultiCache: list must be array");if(t.length<=0)return!0;var n=[];if(t.forEach((function(t){var e=$($({},{key:"",value:"",expiration:0}),t),r=e.key,o=e.value,a=e.expiration;Ft(r)||(de(r),n.push({key:r,value:o,ttl:a}))})),n.length<=0)return!1;var e=he();if(null==e)throw new Error("cache pool not exist");return e.mset(n)}function pe(t){var n=t.key,e=he();if(null==e)throw new Error("cache pool not exist");return e.getTtl(n)}function ye(t){var n=t.key,e=t.expiration,r=he();if(null==r)throw new Error("cache pool not exist");return r.ttl(n,e)}function we(t){var n=t.key,e=he();if(null==e)throw new Error("cache pool not exist");return e.get(n)}function be(){var t=he();if(null==t)throw new Error("cache pool not exist");return t.keys()}function Ae(t){if(!Ht(t))throw new Error("getMultiCache: list must be array");var n=he();if(null==n)throw new Error("cache pool not exist");return n.mget(t)}function xe(t){var n=t.key,e=he();if(null==e)throw new Error("cache pool not exist");return e.take(n)}function Se(t){var n=t.key;de(n);var e=he();if(null==e)throw new Error("cache pool not exist");return e.del(n)}function Me(t){if(!Ht(t))throw new Error("deleteMultiCache: list must be array");var n=he();if(null==n)throw new Error("cache pool not exist");return n.del(t)}function Ee(){var t=he();if(null==t)throw new Error("cache pool not exist");return t.flushAll()}function De(){var t=he();if(null==t)throw new Error("cache pool not exist");return t.getStats()}function Ce(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,a,i,u=[],c=!0,l=!1;try{if(a=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;c=!1}else for(;!(c=(r=a.call(e)).done)&&(u.push(r.value),u.length!==n);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(l)throw o}}return u}}(t,n)||Cn(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(t){var n=t.seed;return"#".concat("00000".concat((16777216*Nn({seed:n})<<0).toString(16)).substring(-6))}function Ie(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"RGB",e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,o=(null!=t?t:"").toLowerCase();if(r.test(o)){if(4===o.length){for(var a="#",i=1;i<4;i+=1)a+=o.slice(i,i+1).concat(o.slice(i,i+1));o=a}for(var u=[],c=1;c<7;c+=2)u.push(parseInt("0x"+o.slice(c,c+2)));return n?"".concat(n,"(").concat(u.join(","),")"):e?u:u.join(",")}return ae("Invalid hex color -> ".concat(t)),o}function je(t){var n=t.progress,e=t.startColor,r=t.endColor,o=Ie(e,null,!0),a=Ie(r,null,!0),i=Ce(o,3),u=i[0],c=i[1],l=i[2],s=Ce(a,3),f=s[0],d=s[1],h=s[2],m=[(u+Math.round((f-u)*n)).toString(16),(c+Math.round((d-c)*n)).toString(16),(l+Math.round((h-l)*n)).toString(16)];return"#".concat(m.join("").toUpperCase())}function ke(t){var n=t.direct,e=t.list,r=void 0===e?[]:e,o=Dt(n)?"".concat(n,"deg"):n;return"linear-gradient(".concat(o,", ").concat(r.join(),")")}function Ne(t,n){var e=xn(t);return e.setHours(e.getHours()+n)}function Pe(t,n){var e=xn(t);return e.setMinutes(e.getMinutes()+n)}function Ye(t,n){var e=xn(t);return e.setSeconds(e.getSeconds()+n)}function Te(){return new Date}function He(t,n){var e=t.getTime(),r=(n.getTime()-e)/1e3,o=parseInt(r/86400),a=parseInt((r-24*o*60*60)/3600),i=parseInt((r-24*o*60*60-60*a*60)/60);return{day:o,hour:a,minute:i,second:r-24*o*60*60-60*a*60-60*i}}var We=function(t,n,e){var r=xn(t),o=n?xn(n):new Date,a=o.getTime()-r.getTime();return"second"===e&&a/1e3||"minute"===e&&a/1e3/60||"hour"===e&&a/1e3/60/60||"day"===e&&a/1e3/60/60/24||"week"===e&&a/1e3/60/60/24/7||"month"===e&&Re(r,o)||"quarter"===e&&Re(r,o)/3||"year"===e&&Re(r,o)/12||a},Re=function(t,n){var e=xn(t),r=xn(n);return 12*(e.getFullYear()-r.getFullYear())+e.getMonth()-r.getMonth()};function Ue(t){var n=t.data;return L(n).day()}function Le(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=L().day();if(!t)return n;var e="";switch(mn(n)){case 0:e="日";break;case 1:e="一";break;case 2:e="二";break;case 3:e="三";break;case 4:e="四";break;case 5:e="五";break;case 6:e="六";break;default:e=""}return Ft(e)?"":"星期".concat(e)}function Be(t){var n=t.data,e=t.places,r=void 0===e?2:e,o=t.thousand,a=void 0===o?",":o,i=t.decimal;return Fe({data:n,places:r,symbol:"",thousand:a,decimal:void 0===i?".":i})}function Fe(t){var n=t.data,e=t.places,r=void 0===e?2:e,o=t.symbol,a=void 0===o?"¥":o,i=t.thousand,u=void 0===i?",":i,c=t.decimal,l=void 0===c?".":c,s=n||0,f=isNaN(r=Math.abs(r))?2:r,d=void 0!==a?a:"¥",h=u||",",m=l||".",g=s<0?"-":"",v=parseInt(s=Math.abs(+s||0).toFixed(f),10)+"",p=v.length;return d+g+((p=p>3?p%3:0)?v.substr(0,p)+h:"")+v.substr(p).replace(/(\d{3})(?=\d)/g,a+"1"+h)+(f?m+Math.abs(s-mn(v)).toFixed(f).slice(2):"")}function Ke(t){var n,e,r,o=t.target,a=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],i=["","拾","佰","仟"],u=["","万","亿","兆"],c=["角","分","毫","厘"],l="";if(""===o)return"";if((o=parseFloat(o))>=1e15)return"超出最大处理数字";if(0===o)return l=a[0]+"元";if(-1===(o=o.toString()).indexOf("."))n=o,e="";else{var s=Ce(r=o.split("."),2);n=s[0],e=s[1],e=r[1].substr(0,4)}if(parseInt(n,10)>0){for(var f=0,d=n.length,h=0;h<d;h+=1){var m=n.substr(h,1),g=d-h-1,v=g/4,p=g%4;"0"===m?f+=1:(f>0&&(l+=a[0]),f=0,l+=a[parseInt(m,10)]+i[p]),0===p&&f<4&&(l+=u[v])}l+="元"}if(""!==e)for(var y=e.length,w=0;w<y;w+=1){var b=e.substr(w,1);"0"!==b&&(l+=a[Number(b)]+c[w])}return""===l&&(l+=a[0]+"元"),l}function Je(t){var n=t.data,e=t.fmt,r=void 0===e?_t.yearMonthDayHourMinuteSecond:e;return null==(n||null)?"":L(n).format(r)}function Qe(t){var n=t.target,e=t.format,r=t.option,o=void 0===r?{}:r;if(jt(e))return e(n);if(Tt(e))switch(e){case Zt.money:return Fe({data:n});case Zt.datetime:return Je({data:n});case Zt.chineseMoney:return Ke({target:n,option:o});case Zt.percentage:return"".concat(Mn(100*n,1),"%");default:return n}return n}function Ge(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=$($({},{second:["刚刚","片刻后"],seconds:["%d 秒前","%d 秒后"],minute:["大约 1 分钟前","大约 1 分钟后"],minutes:["%d 分钟前","%d 分钟后"],hour:["大约 1 小时前","大约 1 小时后"],hours:["%d 小时前","%d 小时后"],day:["1 天前","1 天后"],days:["%d 天前","%d 天后"],month:["大约 1 个月前","大约 1 个月后"],months:["%d 月前","%d 月后"],year:["大约 1 年前","大约 1 年后"],years:["%d 年前","%d 年后"]}),e||{}),o=We(t,n),a=o<0?1:0,i=Math.abs(o)/1e3,u=i/60,c=u/60,l=c/24,s=l/365,f=function(t,n){return t.replace(/%d/i,n)};return i<10&&f(r.second[a],parseInt(i))||i<45&&f(r.seconds[a],parseInt(i))||i<90&&f(r.minute[a],1)||u<45&&f(r.minutes[a],parseInt(u))||u<90&&f(r.hour[a],1)||c<24&&f(r.hours[a],parseInt(c))||c<42&&f(r.day[a],1)||l<30&&f(r.days[a],parseInt(l))||l<45&&f(r.month[a],1)||l<365&&f(r.months[a],parseInt(l/30))||s<1.5&&f(r.year[a],1)||f(r.years[a],parseInt(s))}function Ve(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ge(t,Te(),n)}var qe={showOpenMessage:function(t){var n=t.text;t.duration,t.onClose,te({text:n})},showInfoMessage:function(t){var n=t.text;t.duration,t.onClose,te({text:n})},showSuccessMessage:function(t){var n=t.text;t.duration,t.onClose,te({text:n})},showWarnMessage:function(t){var n=t.text;t.duration,t.onClose,_n(n)},showWarningMessage:function(t){var n=t.text;t.duration,t.onClose,_n(n)},showErrorMessage:function(t){var n=t.text;t.duration,t.onClose,ae(n)}};function ze(t){qe.showOpenMessage=t}function $e(t){qe.showInfoMessage=t}function Xe(t){qe.showSuccessMessage=t}function Ze(t){qe.showWarnMessage=t}function _e(t){qe.showWarningMessage=t}function tr(t){qe.showErrorMessage=t}function nr(t){var n=t.text,e=t.duration,r=void 0===e?1500:e,o=t.onClose,a=void 0===o?function(){}:o;jt(qe.showOpenMessage)&&qe.showOpenMessage({text:n,duration:r,onClose:a})}function er(t){var n=t.text,e=t.duration,r=void 0===e?1500:e,o=t.onClose,a=void 0===o?function(){}:o;jt(qe.showInfoMessage)&&qe.showInfoMessage({text:n,duration:r,onClose:a})}function rr(t){var n=t.text,e=t.duration,r=void 0===e?1500:e,o=t.onClose,a=void 0===o?function(){}:o;jt(qe.showSuccessMessage)&&qe.showSuccessMessage({text:n,duration:r,onClose:a})}function or(t){var n=t.text,e=t.duration,r=void 0===e?1500:e,o=t.onClose,a=void 0===o?function(){}:o;jt(qe.showWarnMessage)&&qe.showWarnMessage({text:n,duration:r,onClose:a})}function ar(t){var n=t.text,e=t.duration,r=void 0===e?1500:e,o=t.onClose,a=void 0===o?function(){}:o;jt(qe.showWarningMessage)&&qe.showWarningMessage({text:n,duration:r,onClose:a})}function ir(t){var n=t.text,e=t.duration,r=void 0===e?1500:e,o=t.onClose,a=void 0===o?function(){}:o;jt(qe.showErrorMessage)&&qe.showErrorMessage({text:n,duration:r,onClose:a})}function ur(t){ir({text:t})}function cr(t){var n=t.text,e=t.showStack,r=void 0===e||e;try{if(Ft(n||"")||(ir({text:n}),ae({text:n})),r)throw new Error("".concat(Ft(n||"")?"":"".concat(yn(n),", "),"call stack:"))}catch(t){console.log(t.stack)}}function lr(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return t&&t.length>n?"".concat(yn(t).substring(0,n)).concat(e):yn(t)}function sr(t,n,e,r){var o=yn(t),a=(t||"").length;a>0&&(e>=0||r>=0)&&(o=e>=a||r>=a||(e||0)+(r||0)>=a?t:t.substr(0,e)+n+t.substr(a-r,r));return o||""}function fr(t,n){for(var e=(new Date).getTime();!((new Date).getTime()-e>t););jt(n)&&n()}function dr(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(Nt(t))return e;if(null==t)return e;if(!Tt(n)){var r="getPathValue Function param path must be string";return cr({message:r}),null}var o=X(t,n,e);return Nt(e)||Pt(e)?o:o||e}function hr(t,n){if(!Tt(t))throw new Error("removeEndMatch only use for string target");if(!Tt(n))throw new Error("removeEndMatch only use for string match");if(Ft(t))return t;if(Ft(n))return t;var e=t.lastIndexOf(n);return e>=0&&t.length===e+n.length?t.substr(e,n.length):t}function mr(t,n){if(!Tt(t))throw new Error("removeEndMatch only use for string source");if(!Tt(n))throw new Error("removeEndMatch only use for string target");if(Ft(t))return t;if(Ft(n))return t;var e=t.lastIndexOf(n);return e>=0?t.substr(e,n.length):t}function gr(t){var n=t.data,e=t.key,r=t.defaultValue,o=void 0===r?null:r,a=t.convert,i=void 0===a?null:a,u=t.convertBuilder,c=void 0===u?null:u,l=t.format,s=void 0===l?null:l,f=t.formatBuilder,d=void 0===f?null:f,h=dr(n,e,o),m=h;return null==(c||null)&&null==(i||null)||(m=jt(c)?En({target:h,convert:c}):En({target:h,convert:i})),null==(d||null)&&null==(s||null)||(m=jt(d)?Qe({target:m,format:d}):Qe({target:m,format:s})),m}function vr(t){var n=t.operate,e=t.item,r=t.list,o=t.key,a=t.sortInitialValue,i=void 0===a?0:a;if(null==(e||null))return r;var u=[],c=[],l=[];if((r||[]).length<=1){return or({message:"无需排序!"}),r}var s=gr({data:e,key:o,convert:Xt.number});switch((r||[]).forEach((function(t){var n=gr({data:t,key:o,convert:Xt.number});n<s&&u.push(t),n>s&&c.push(t)})),n){case tn.moveUp:if(s===i){return or({message:"已经排在首位!"}),r}(u||[]).forEach((function(t,n){if(n<u.length-1)l.push(t);else{var r=e;r[o]-=1,l.push(r);var a=t;a[o]+=1,l.push(a)}})),l=l.concat(c);break;case tn.moveDown:if(s===(r||[]).length+i-1){return or({message:"已经排在末位!"}),r}l=l.concat(u),(c||[]).forEach((function(t,n){if(0===n){var r=t;r[o]-=1,l.push(r);var a=e;a[o]+=1,l.push(a)}else l.push(t)}));break;default:or({message:"不符合的操作, 允许的操作为['".concat(tn.moveUp,"','").concat(tn.moveDown,"']!")})}return l}function pr(t){var n=t.list,e=void 0===n?[]:n,r=t.convert,o=void 0===r?null:r,a=t.recursiveKey,i=void 0===a?"children":a;return(Ht(e)?e:[e]).map((function(t){return yr({data:t,convert:o,target:i})}))}function yr(t){var n=t.data,e=t.convert,r=void 0===e?null:e,o=t.recursiveKey,a=void 0===o?"children":o;if(!jt(r))return n;var i=r(n),u=n[a],c=[];return Ht(u)&&(c=u.map((function(t){return yr({data:t,convert:r,target:a})}))),i[a]=c,i}function wr(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=St(t,n,e);return!Nt(r)}function br(){function t(t,n){return Nt(n)?t:n}for(var n=et({},arguments.length<=0?void 0:arguments[0]),e=1;e<arguments.length;e++)n=rt(n,e<0||arguments.length<=e?void 0:arguments[e],t);return n}function Ar(t){if(t&&"object"===G(t)){var n="";return Object.keys(t).forEach((function(e){var r,o=(null!==(r=e.replace(/([A-Z])/g,"-$1"))&&void 0!==r?r:"").toLowerCase();n+="".concat(o,":").concat(t[e],";")})),n}return t&&"string"==typeof t?t:""}function xr(t,n){return t&&"object"===G(t)&&n&&"object"===G(n)?Object.assign({},t,n):Ar(t)+Ar(n)}var Sr,Mr="htmlAssist";function Er(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!Dt(t))return t;if(!Dt(n)||n<=0)throw new Error("".concat(In(Mr),"pxToRem -> root value must be number and greater than 0, current root value [").concat(n,"] is invalid."));var o=parseFloat(t);if(o<r)return t;var a=mn(o/n,e);return 0===a?"0":a+"rem"}var Dr="localStorageAssist",Cr=(q(Sr={getStorage:function(t){ae("".concat(In(Dr),"setStorageGetter need config, use setStorageGetter to set it"))},setStorage:function(t,n){ae("".concat(In(Dr),"setStorageSetter need config, use setStorageSetter to set it"))},removeStorage:function(t){ae("".concat(In(Dr),"setStorageRemover need config, use setStorageRemover to set it"))}},"removeStorage",(function(t){ae("".concat(In(Dr),"setStorageRemover need config, use setStorageRemover to set it"))})),q(Sr,"flushStorage",(function(){ae("".concat(In(Dr),"setStorageFlusher need config, use setStorageFlusher to set it"))})),Sr);function Or(t){Cr.getStorage=t}function Ir(t){Cr.setStorage=t}function jr(t){Cr.removeStorage=t}function kr(t){try{return Cr.getStorage(t)}catch(n){throw ae({key:t,e:n}),n}}function Nr(t){var n=kr(t);return Ft(n)?null:JSON.parse(n||"{}")}function Pr(t,n){Cr.setStorage(t,n)}function Yr(t,n){Cr.setStorage(t,JSON.stringify(n||{}))}function Tr(t){Cr.removeStorage(t)}function Hr(){Cr.flushStorage()}var Wr=function(t){var n=t.text;t.duration,t.onClose,te({text:n})};var Rr="nearestLocalhostNotify";function Ur(){var t=Nr(Rr);return null==(t||null)||null==(t.nearestTime||null)?null:t||null}function Lr(){return Yr(Rr,{nearestTime:parseInt((new Date).getTime()/1e3,10)})}function Br(){Tr(Rr)}function Fr(t){var n=t.text,e=!1,r=0,o=Ur()||null;null==o?e=!0:r=o.nearestTime||0;var a=parseInt((new Date).getTime()/1e3,10);try{if(r+30<a&&(e=!0),e){var i="当前接口域名: ".concat(n,". ");!function(t){var n=t.text,e=t.duration,r=void 0===e?1500:e,o=t.onClose,a=void 0===o?function(){}:o;jt(Wr)&&Wr({text:n,duration:r,onClose:a})}({text:i}),ie({message:i}),Lr()}}catch(t){Zn(t)}}function Kr(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=B(t);if(Ft(n))return e;if(Ft(e))return n;var r=n.lastIndexOf("?")>=0?"&":"?";return"".concat(n).concat(r).concat(e)}function Jr(t){return F(t)}function Qr(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"请".concat(n||"输入").concat(t).concat(Ft(e)?"":",".concat(e))}function Gr(t){var n=t.label,e=t.name,r=t.helper,o="",a="",i="";if(Tt(n))o=n;else{_n({label:n,name:e,helper:r}),cr({message:"label必须为文本"})}if(Tt(e))a=e;else{_n({label:n,name:e,helper:r}),cr({message:"name必须为文本"})}if(Tt(r))i=r;else{_n({label:n,name:e,helper:r}),cr({message:"helper必须为文本"})}return{label:o,name:a,helper:i}}function Vr(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"注: ";return"".concat(n).concat(t,". ")}export{Ne as addHour,Pe as addMinute,Ye as addSecond,et as assign,rt as assignWith,Qr as buildFieldDescription,Vr as buildFieldHelper,je as buildHexColor,ke as buildLinearGradient,In as buildPromptModuleInfo,Kr as buildQueryStringify,Ie as buildRGBColorFromHexColor,Oe as buildRandomHexColor,Ar as buildStringStyle,se as cacheMountTarget,We as calculateDateInterval,Re as calculateMonthInterval,He as calculateTimeInterval,wr as checkExist,Gr as checkFromConfig,Rn as checkHasMore,Kt as checkInCollection,Ft as checkStringIsNullOrWhiteSpace,Un as checkWhetherDevelopmentEnvironment,Pn as cloneWithoutMethod,Xt as convertCollection,Er as convertPixelToRem,_t as datetimeFormat,K as decodeBase64,Se as deleteCache,Me as deleteMultiCache,wt as difference,ft as dropRight,lr as ellipsis,$t as emptyDatetime,J as encodeBase64,_ as endsWith,Jt as envCollection,sn as errorImage,bt as filter,St as find,xt as findIndex,lt as first,Q as fixedZero,ct as floor,Ee as flushAllCache,Hr as flushLocalStorage,at as forEach,Zt as formatCollection,Ge as formatDateInterval,Ve as formatDateIntervalWithNow,Je as formatDatetime,Be as formatDecimal,Fe as formatMoney,Ke as formatMoneyToChinese,Qe as formatTarget,X as get,kn as getBrowserInfo,jn as getBrowserVersion,we as getCache,he as getCachePool,Ue as getDayOfWeek,pe as getExpiration,Wn as getGuid,Nr as getJsonFromLocalStorage,ce as getLoggerDisplaySwitch,Ae as getMultiCache,Ur as getNearestLocalhostNotifyCache,Te as getNow,dr as getPathValue,kr as getStringFromLocalStorage,Le as getTodayOfWeek,Ln as getValue,gr as getValueByKey,it as gte,me as hasCache,Ht as isArray,kt as isBoolean,Yt as isDate,Et as isDatetime,Ot as isEqual,It as isEqualBySerialize,jt as isFunction,Bt as isImageBase4,Mt as isInvalid,Ct as isMoney,Pt as isNull,Dt as isNumber,Wt as isObject,Rt as isPlainObject,Ut as isPromise,Tt as isString,Nt as isUndefined,Lt as isUrl,be as keys,Cr as localStorageAssist,ne as logConfig,Zn as logData,re as logDebug,on as logDisplay,ae as logError,oe as logExecute,te as logInfo,rn as logLevel,ue as logObject,ie as logText,ee as logTrace,_n as logWarn,Fn as loggerSwitch,vt as map,ut as memoize,br as mergeProps,xr as mergeStyle,qe as messagePromptAssist,cn as messageTypeCollection,un as notificationTypeCollection,Jr as parseQueryString,Yn as refitCommonData,Tn as refitFieldDecoratorOption,hr as removeEndMatch,gt as removeFromArray,mr as removeLastMatch,Tr as removeLocalStorage,Br as removeNearestLocalhostNotifyCache,mt as replace,sr as replaceWithKeep,Vt as requestMethod,ot as reverse,Z as round,Yr as saveJsonToLocalStorage,Pr as saveStringToLocalStorage,Xe as seSuccessMessageDisplayMonitor,Hn as searchFromList,Nn as seededRandom,pt as set,ge as setCache,fe as setCacheMount,tr as setErrorMessageDisplayMonitor,ye as setExpiration,$e as setInfoMessageDisplayMonitor,le as setLoggerDisplaySwitch,ve as setMultiCache,Lr as setNearestLocalhostNotifyCache,ze as setOpenMessageDisplayMonitor,Or as setStorageGetter,jr as setStorageRemover,Ir as setStorageSetter,Ze as setWarnMessageDisplayMonitor,_e as setWarningMessageDisplayMonitor,ur as showError,ir as showErrorMessage,er as showInfoMessage,nr as showOpenMessage,cr as showRuntimeError,rr as showSuccessMessage,or as showWarnMessage,ar as showWarningMessage,yt as size,fr as sleep,At as sortBy,vr as sortCollectionByKey,tn as sortOperate,tt as sortedUnique,nt as split,st as startsWith,De as statisticsCache,xe as takeCache,En as to,wn as toBoolean,gn as toBoundary,xn as toDatetime,An as toLower,dn as toMd5,vn as toMoney,mn as toNumber,pn as toPercentage,Sn as toPromise,Mn as toRound,fn as toSha1,yn as toString,bn as toUpper,yr as transformData,pr as transformListData,ln as transparentImage,ht as trim,Fr as trySendNearestLocalhostNotify,Gt as underlyingExtensionState,Qt as underlyingState,dt as uniqBy,en as whetherNumber,nn as whetherString,zt as zeroInt,qt as zeroString};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set cache mount target.
|
|
3
|
+
*/
|
|
4
|
+
export function setCacheMount(target: any): void;
|
|
5
|
+
/**
|
|
6
|
+
* Get the runtime cache pool.
|
|
7
|
+
* @returns {nodeCache}
|
|
8
|
+
*/
|
|
9
|
+
export function getCachePool(): nodeCache;
|
|
10
|
+
/**
|
|
11
|
+
* Returns boolean indicating if the key is cached.
|
|
12
|
+
*/
|
|
13
|
+
export function hasCache({ key }: {
|
|
14
|
+
key: any;
|
|
15
|
+
}): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Sets a key value pair. It is possible to define a ttl (in seconds). Returns true on success. Expiration time default is 0, it mean never expire
|
|
18
|
+
*/
|
|
19
|
+
export function setCache({ key, value, expiration }: {
|
|
20
|
+
key: any;
|
|
21
|
+
value: any;
|
|
22
|
+
expiration?: number | undefined;
|
|
23
|
+
}): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Sets multiple key val pairs. It is possible to define a ttl (seconds). Returns true on success.
|
|
26
|
+
*/
|
|
27
|
+
export function setMultiCache(list: any): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp in ms representing the time at which the key will expire.
|
|
30
|
+
*/
|
|
31
|
+
export function getExpiration({ key }: {
|
|
32
|
+
key: any;
|
|
33
|
+
}): number | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Redefine the ttl of a key. Returns true if the key has been found and changed. Otherwise returns false. If the ttl-argument isn't passed the default-TTL will be used. The key will be deleted when passing in a ttl < 0. Expiration value 0 mean never expire
|
|
36
|
+
*/
|
|
37
|
+
export function setExpiration({ key, expiration }: {
|
|
38
|
+
key: any;
|
|
39
|
+
expiration: any;
|
|
40
|
+
}): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Gets a saved value from the cache. Returns a undefined if not found or expired. If the value was found it returns the value.
|
|
43
|
+
*/
|
|
44
|
+
export function getCache({ key }: {
|
|
45
|
+
key: any;
|
|
46
|
+
}): any;
|
|
47
|
+
/**
|
|
48
|
+
* Get all cache keys.
|
|
49
|
+
*/
|
|
50
|
+
export function keys(): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Gets multiple saved values from the cache. Returns an empty object {} if not found or expired. If the value was found it returns an object with the key value pair.
|
|
53
|
+
*/
|
|
54
|
+
export function getMultiCache(list: any): {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Get the cached value and remove the key from the cache.
|
|
59
|
+
*/
|
|
60
|
+
export function takeCache({ key }: {
|
|
61
|
+
key: any;
|
|
62
|
+
}): any;
|
|
63
|
+
/**
|
|
64
|
+
* Delete a key. Returns the number of deleted entries. A delete will never fail.
|
|
65
|
+
*/
|
|
66
|
+
export function deleteCache({ key }: {
|
|
67
|
+
key: any;
|
|
68
|
+
}): number;
|
|
69
|
+
/**
|
|
70
|
+
* Delete multiple keys. Returns the number of deleted entries. A delete will never fail.
|
|
71
|
+
*/
|
|
72
|
+
export function deleteMultiCache(list: any): number;
|
|
73
|
+
/**
|
|
74
|
+
* Flush all data, it will clear cache pool.
|
|
75
|
+
*/
|
|
76
|
+
export function flushAllCache(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the statistics.
|
|
79
|
+
*/
|
|
80
|
+
export function statisticsCache(): nodeCache.Stats;
|
|
81
|
+
export namespace cacheMountTarget {
|
|
82
|
+
const mountComplete: boolean;
|
|
83
|
+
const target: null;
|
|
84
|
+
}
|
|
85
|
+
import nodeCache from "node-cache";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check target is invalid
|
|
3
|
+
*/
|
|
4
|
+
export function isInvalid(target: any): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Check target is datetime
|
|
7
|
+
*/
|
|
8
|
+
export function isDatetime(target: any): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Check target is number
|
|
11
|
+
*/
|
|
12
|
+
export function isNumber(v: any): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Check target is money
|
|
15
|
+
*/
|
|
16
|
+
export function isMoney(target: any): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check both is equal by deep compare. Method supports comparison arrays, array buffers, booleans, date objects, error objects, maps, numbers, Object objects, regexes, sets, strings, symbols and typed arrays. Object values compare properties of the object itself, excluding inherited and enumerable properties. Comparisons between functions and DOM nodes are not supported.
|
|
19
|
+
*/
|
|
20
|
+
export function isEqual(target: any, compareData: any): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Check both is equal by serialize
|
|
23
|
+
*/
|
|
24
|
+
export function isEqualBySerialize(target: any, compareData: any): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Check target is function
|
|
27
|
+
*/
|
|
28
|
+
export function isFunction(target: any): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Check target is boolean
|
|
31
|
+
*/
|
|
32
|
+
export function isBoolean(target: any): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Check target is undefined
|
|
35
|
+
*/
|
|
36
|
+
export function isUndefined(target: any): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Check target is null
|
|
39
|
+
*/
|
|
40
|
+
export function isNull(target: any): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Check target is date
|
|
43
|
+
*/
|
|
44
|
+
export function isDate(target: any): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Check target is string
|
|
47
|
+
*/
|
|
48
|
+
export function isString(target: any): boolean;
|
|
49
|
+
export function isArray(value: any): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Check target is object
|
|
52
|
+
*/
|
|
53
|
+
export function isObject(target: any): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Check target is plain object
|
|
56
|
+
*/
|
|
57
|
+
export function isPlainObject(target: any): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Check target is promise
|
|
60
|
+
*/
|
|
61
|
+
export function isPromise(target: any): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Check target is url
|
|
64
|
+
*/
|
|
65
|
+
export function isUrl(target: any): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Check target is base64 image
|
|
68
|
+
*/
|
|
69
|
+
export function isImageBase4(target: any): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Check value is null or empty string
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
export function checkStringIsNullOrWhiteSpace(target: any): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Check value in the collection.
|
|
77
|
+
* @param {*} collection value collection
|
|
78
|
+
* @param {*} target the target value will be checked
|
|
79
|
+
* @returns boolean
|
|
80
|
+
*/
|
|
81
|
+
export function checkInCollection(collection: any, target: any): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build random hex color through configuration such as seeds
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @param {*} seed
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export function buildRandomHexColor({ seed }: any): string;
|
|
9
|
+
/**
|
|
10
|
+
* convert hex color to RGB color
|
|
11
|
+
* @param {*} color string -> hex color
|
|
12
|
+
* @param {*} symbol string -> default is 'RGB'
|
|
13
|
+
* @param {*} arrayMode bool -> whether return array type color like [255,255,255]
|
|
14
|
+
*/
|
|
15
|
+
export function buildRGBColorFromHexColor(color: any, symbol?: any, arrayMode?: any): any;
|
|
16
|
+
/**
|
|
17
|
+
* Build hex color like '#E564F2'
|
|
18
|
+
* @param {*} param0
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export function buildHexColor({ progress, startColor, endColor }: any): string;
|
|
22
|
+
/**
|
|
23
|
+
* Build linear gradient css color, direct number value will be converted like '15deg'
|
|
24
|
+
*/
|
|
25
|
+
export function buildLinearGradient({ direct, list }: {
|
|
26
|
+
direct: any;
|
|
27
|
+
list?: any[] | undefined;
|
|
28
|
+
}): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文本缩略
|
|
3
|
+
*/
|
|
4
|
+
export function ellipsis(value: any, length: any, symbol?: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Replace string with keep
|
|
7
|
+
*/
|
|
8
|
+
export function replaceWithKeep(text: any, replaceText: any, beforeKeepLength: any, afterKeepLength: any): string;
|
|
9
|
+
/**
|
|
10
|
+
* Sleep thread with ms
|
|
11
|
+
*/
|
|
12
|
+
export function sleep(n: any, callback: any): void;
|
|
13
|
+
/**
|
|
14
|
+
* Get value from object by path
|
|
15
|
+
*/
|
|
16
|
+
export function getPathValue(o: any, path: any, defaultValue?: null): any;
|
|
17
|
+
/**
|
|
18
|
+
* Remove end match string
|
|
19
|
+
*/
|
|
20
|
+
export function removeEndMatch(target: any, match: any): any;
|
|
21
|
+
/**
|
|
22
|
+
* Remove last match string
|
|
23
|
+
*/
|
|
24
|
+
export function removeLastMatch(target: any, match: any): any;
|
|
25
|
+
/**
|
|
26
|
+
* Get value with key from object, convert value taken from convertCollection, format value taken from formatCollection, convertBuilder priority greater than convert, formatBuilder priority greater than format,
|
|
27
|
+
*/
|
|
28
|
+
export function getValueByKey({ data, key, defaultValue, convert, convertBuilder, format, formatBuilder, }: {
|
|
29
|
+
data: any;
|
|
30
|
+
key: any;
|
|
31
|
+
defaultValue?: null | undefined;
|
|
32
|
+
convert?: null | undefined;
|
|
33
|
+
convertBuilder?: null | undefined;
|
|
34
|
+
format?: null | undefined;
|
|
35
|
+
formatBuilder?: null | undefined;
|
|
36
|
+
}): any;
|
|
37
|
+
/**
|
|
38
|
+
* Sort collection by key, the value must be number type, sortInitialValue mean begin sort if value greater than it.
|
|
39
|
+
*/
|
|
40
|
+
export function sortCollectionByKey({ operate, item, list, key: sortKey, sortInitialValue, }: {
|
|
41
|
+
operate: any;
|
|
42
|
+
item: any;
|
|
43
|
+
list: any;
|
|
44
|
+
key: any;
|
|
45
|
+
sortInitialValue?: number | undefined;
|
|
46
|
+
}): any;
|
|
47
|
+
/**
|
|
48
|
+
* Transform list data with convert
|
|
49
|
+
*/
|
|
50
|
+
export function transformListData({ list, convert, recursiveKey, }: {
|
|
51
|
+
list?: any[] | undefined;
|
|
52
|
+
convert?: null | undefined;
|
|
53
|
+
recursiveKey?: string | undefined;
|
|
54
|
+
}): any[];
|
|
55
|
+
/**
|
|
56
|
+
* Transform data with convert
|
|
57
|
+
*/
|
|
58
|
+
export function transformData({ data, convert, recursiveKey, }: {
|
|
59
|
+
data: any;
|
|
60
|
+
convert?: null | undefined;
|
|
61
|
+
recursiveKey?: string | undefined;
|
|
62
|
+
}): any;
|
|
63
|
+
export function checkExist(array: any, predicateFunction: any, fromIndex?: number): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge props
|
|
3
|
+
* @param {*} items iterated value -> the items will be merged
|
|
4
|
+
*/
|
|
5
|
+
export function mergeProps(...items: any): any;
|
|
6
|
+
/**
|
|
7
|
+
* Build style data to string
|
|
8
|
+
* @param {Object|String} style the style will be builded
|
|
9
|
+
*/
|
|
10
|
+
export function buildStringStyle(style: Object | string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Merge style
|
|
13
|
+
* @param {Object|String} target the target style will be merged
|
|
14
|
+
* @param {Object|String} style the other style will be merged
|
|
15
|
+
*/
|
|
16
|
+
export function mergeStyle(target: Object | string, style: Object | string): string | Object;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export namespace envCollection {
|
|
2
|
+
const WEAPP: string;
|
|
3
|
+
const WEB: string;
|
|
4
|
+
const RN: string;
|
|
5
|
+
const SWAN: string;
|
|
6
|
+
const ALIPAY: string;
|
|
7
|
+
const TT: string;
|
|
8
|
+
const QQ: string;
|
|
9
|
+
const JD: string;
|
|
10
|
+
const UNKNOWN: string;
|
|
11
|
+
}
|
|
12
|
+
export namespace underlyingState {
|
|
13
|
+
const loadApiPath: string;
|
|
14
|
+
const firstLoadSuccess: boolean;
|
|
15
|
+
const loadSuccess: boolean;
|
|
16
|
+
const registering: boolean;
|
|
17
|
+
const dataLoading: boolean;
|
|
18
|
+
const reloading: boolean;
|
|
19
|
+
const searching: boolean;
|
|
20
|
+
const refreshing: boolean;
|
|
21
|
+
const paging: boolean;
|
|
22
|
+
const processing: boolean;
|
|
23
|
+
const dispatchComplete: boolean;
|
|
24
|
+
const metaData: null;
|
|
25
|
+
const metaExtra: null;
|
|
26
|
+
const metaListData: never[];
|
|
27
|
+
const metaOriginalData: null;
|
|
28
|
+
const urlParams: null;
|
|
29
|
+
const externalData: null;
|
|
30
|
+
}
|
|
31
|
+
export namespace underlyingExtensionState {
|
|
32
|
+
const dataLoading_1: boolean;
|
|
33
|
+
export { dataLoading_1 as dataLoading };
|
|
34
|
+
}
|
|
35
|
+
export namespace requestMethod {
|
|
36
|
+
export const get: string;
|
|
37
|
+
export const post: string;
|
|
38
|
+
export const put: string;
|
|
39
|
+
const _delete: string;
|
|
40
|
+
export { _delete as delete };
|
|
41
|
+
export const trace: string;
|
|
42
|
+
export const connect: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* '0'
|
|
46
|
+
*/
|
|
47
|
+
export const zeroString: "0";
|
|
48
|
+
/**
|
|
49
|
+
* 0
|
|
50
|
+
*/
|
|
51
|
+
export const zeroInt: 0;
|
|
52
|
+
/**
|
|
53
|
+
* 1970-01-01 00:00
|
|
54
|
+
*/
|
|
55
|
+
export const emptyDatetime: "1970-01-01 00:00";
|
|
56
|
+
export namespace convertCollection {
|
|
57
|
+
const number: string;
|
|
58
|
+
const datetime: string;
|
|
59
|
+
const string: string;
|
|
60
|
+
const moment: string;
|
|
61
|
+
const money: string;
|
|
62
|
+
const array: string;
|
|
63
|
+
const boolean: string;
|
|
64
|
+
}
|
|
65
|
+
export namespace formatCollection {
|
|
66
|
+
const money_1: string;
|
|
67
|
+
export { money_1 as money };
|
|
68
|
+
const datetime_1: string;
|
|
69
|
+
export { datetime_1 as datetime };
|
|
70
|
+
export const chineseMoney: string;
|
|
71
|
+
export const percentage: string;
|
|
72
|
+
}
|
|
73
|
+
export namespace datetimeFormat {
|
|
74
|
+
const yearMonthDayHourMinuteSecond: string;
|
|
75
|
+
const yearMonthDayHourMinute: string;
|
|
76
|
+
const yearMonthDay: string;
|
|
77
|
+
const yearMonth: string;
|
|
78
|
+
const year: string;
|
|
79
|
+
const monthDayHourMinuteSecond: string;
|
|
80
|
+
const monthDayHourMinute: string;
|
|
81
|
+
const monthDay: string;
|
|
82
|
+
const hourMinute: string;
|
|
83
|
+
const hourMinuteSecond: string;
|
|
84
|
+
const month: string;
|
|
85
|
+
const day: string;
|
|
86
|
+
const hour: string;
|
|
87
|
+
const minute: string;
|
|
88
|
+
const second: string;
|
|
89
|
+
}
|
|
90
|
+
export namespace sortOperate {
|
|
91
|
+
const moveUp: string;
|
|
92
|
+
const moveDown: string;
|
|
93
|
+
}
|
|
94
|
+
export namespace whetherString {
|
|
95
|
+
const no: string;
|
|
96
|
+
const yes: string;
|
|
97
|
+
}
|
|
98
|
+
export namespace whetherNumber {
|
|
99
|
+
const no_1: number;
|
|
100
|
+
export { no_1 as no };
|
|
101
|
+
const yes_1: number;
|
|
102
|
+
export { yes_1 as yes };
|
|
103
|
+
}
|
|
104
|
+
export namespace logLevel {
|
|
105
|
+
const trace_1: string;
|
|
106
|
+
export { trace_1 as trace };
|
|
107
|
+
export const debug: string;
|
|
108
|
+
export const warn: string;
|
|
109
|
+
export const error: string;
|
|
110
|
+
export const info: string;
|
|
111
|
+
export const config: string;
|
|
112
|
+
export const execute: string;
|
|
113
|
+
}
|
|
114
|
+
export namespace logDisplay {
|
|
115
|
+
const auto: string;
|
|
116
|
+
const text: string;
|
|
117
|
+
const object: string;
|
|
118
|
+
}
|
|
119
|
+
export namespace notificationTypeCollection {
|
|
120
|
+
export const success: string;
|
|
121
|
+
const error_1: string;
|
|
122
|
+
export { error_1 as error };
|
|
123
|
+
const info_1: string;
|
|
124
|
+
export { info_1 as info };
|
|
125
|
+
export const warning: string;
|
|
126
|
+
const warn_1: string;
|
|
127
|
+
export { warn_1 as warn };
|
|
128
|
+
export const open: string;
|
|
129
|
+
}
|
|
130
|
+
export namespace messageTypeCollection { }
|
|
131
|
+
/**
|
|
132
|
+
* A simple transparent image
|
|
133
|
+
*/
|
|
134
|
+
export const transparentImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABLCAYAAACGGCK3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA0SURBVHhe7cExAQAAAMKg9U9tDQ8gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIA3NXV7AAHfw7zWAAAAAElFTkSuQmCC";
|
|
135
|
+
/**
|
|
136
|
+
* error transparent Image
|
|
137
|
+
*/
|
|
138
|
+
export const errorImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABLCAYAAACGGCK3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA0SURBVHhe7cExAQAAAMKg9U9tDQ8gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIA3NXV7AAHfw7zWAAAAAElFTkSuQmCC";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert target to Sha1 string
|
|
3
|
+
*/
|
|
4
|
+
export function toSha1(v: any): string;
|
|
5
|
+
export function toMd5(target: any): string;
|
|
6
|
+
/**
|
|
7
|
+
* Convert to number, precision default is null, it mean not set precision
|
|
8
|
+
*/
|
|
9
|
+
export function toNumber(value: any, precision?: null): number;
|
|
10
|
+
/**
|
|
11
|
+
* Check value in the bound and return result, if value not in the bound, return nearest boundary value
|
|
12
|
+
*/
|
|
13
|
+
export function toBoundary(value: any, min: any, max: any): number;
|
|
14
|
+
/**
|
|
15
|
+
* Convert to money
|
|
16
|
+
*/
|
|
17
|
+
export function toMoney(target: any): number;
|
|
18
|
+
/**
|
|
19
|
+
* Convert to percentage string, like '15%'
|
|
20
|
+
*/
|
|
21
|
+
export function toPercentage(val: any): string;
|
|
22
|
+
/**
|
|
23
|
+
* Convert to string
|
|
24
|
+
*/
|
|
25
|
+
export function toString(target: any): string;
|
|
26
|
+
/**
|
|
27
|
+
* Convert to boolean
|
|
28
|
+
*/
|
|
29
|
+
export function toBoolean(target: any): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Convert to upper
|
|
32
|
+
*/
|
|
33
|
+
export function toUpper(target: any): string;
|
|
34
|
+
/**
|
|
35
|
+
* Convert to lower
|
|
36
|
+
*/
|
|
37
|
+
export function toLower(target: any): string;
|
|
38
|
+
/**
|
|
39
|
+
* Convert to datetime
|
|
40
|
+
*/
|
|
41
|
+
export function toDatetime(target: any): any;
|
|
42
|
+
/**
|
|
43
|
+
* Convert to Promise
|
|
44
|
+
*/
|
|
45
|
+
export function toPromise(target: any): any;
|
|
46
|
+
/**
|
|
47
|
+
* Convert value to number with round mode
|
|
48
|
+
*/
|
|
49
|
+
export function toRound(target: any, decimalPlace: any): number;
|
|
50
|
+
/**
|
|
51
|
+
* Convert target use specified conversion, convert value taken from convertCollection.
|
|
52
|
+
*/
|
|
53
|
+
export function to({ target, convert }: {
|
|
54
|
+
target: any;
|
|
55
|
+
convert: any;
|
|
56
|
+
}): any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function addHour(datetime: any, value: any): any;
|
|
2
|
+
export function addMinute(datetime: any, value: any): any;
|
|
3
|
+
export function addSecond(datetime: any, value: any): any;
|
|
4
|
+
export function getNow(): Date;
|
|
5
|
+
/**
|
|
6
|
+
* Calculate time interval
|
|
7
|
+
*/
|
|
8
|
+
export function calculateTimeInterval(startTime: any, endTime: any): {
|
|
9
|
+
day: number;
|
|
10
|
+
hour: number;
|
|
11
|
+
minute: number;
|
|
12
|
+
second: number;
|
|
13
|
+
};
|
|
14
|
+
export function getDayOfWeek({ data: date }: {
|
|
15
|
+
data: any;
|
|
16
|
+
}): number;
|
|
17
|
+
/**
|
|
18
|
+
* Get today in week like '星期日' / '星期一' / '星期二' / '星期三' / '星期四' / '星期五' / '星期六'
|
|
19
|
+
*/
|
|
20
|
+
export function getTodayOfWeek(transferChinese?: boolean): string | number;
|
|
21
|
+
export function calculateDateInterval(date: any, nowDate: any, unit: any): number;
|
|
22
|
+
export function calculateMonthInterval(startMonth: any, endMonth: any): number;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format to decimal string like '3.25'
|
|
3
|
+
*/
|
|
4
|
+
export function formatDecimal({ data, places, thousand, decimal, }: {
|
|
5
|
+
data: any;
|
|
6
|
+
places?: number | undefined;
|
|
7
|
+
thousand?: string | undefined;
|
|
8
|
+
decimal?: string | undefined;
|
|
9
|
+
}): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format to money string like '$3.25'
|
|
12
|
+
*/
|
|
13
|
+
export function formatMoney({ data: numberSource, places: placesSource, symbol: symbolSource, thousand: thousandSource, decimal: decimalSource, }: {
|
|
14
|
+
data: any;
|
|
15
|
+
places?: number | undefined;
|
|
16
|
+
symbol?: string | undefined;
|
|
17
|
+
thousand?: string | undefined;
|
|
18
|
+
decimal?: string | undefined;
|
|
19
|
+
}): string;
|
|
20
|
+
/**
|
|
21
|
+
* Format to chinese Yuan like '叁千元整'
|
|
22
|
+
*/
|
|
23
|
+
export function formatMoneyToChinese({ target }: {
|
|
24
|
+
target: any;
|
|
25
|
+
}): string;
|
|
26
|
+
export function formatDatetime({ data: date, fmt, }: {
|
|
27
|
+
data: any;
|
|
28
|
+
fmt?: string | undefined;
|
|
29
|
+
}): string;
|
|
30
|
+
export function formatTarget({ target, format, option }: {
|
|
31
|
+
target: any;
|
|
32
|
+
format: any;
|
|
33
|
+
option?: {} | undefined;
|
|
34
|
+
}): any;
|
|
35
|
+
/**
|
|
36
|
+
* Format date interval
|
|
37
|
+
*/
|
|
38
|
+
export function formatDateInterval(startTime: any, endTime: any, options?: {}): any;
|
|
39
|
+
/**
|
|
40
|
+
* 格式化指定时间与当前时间的时间间隔
|
|
41
|
+
* @param {time} start 时间
|
|
42
|
+
* @param {Object} opts 配置参数
|
|
43
|
+
* @return {String} 文本内容
|
|
44
|
+
*/
|
|
45
|
+
export function formatDateIntervalWithNow(time: any, opts?: Object): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set local storage getter
|
|
3
|
+
*/
|
|
4
|
+
export function setStorageGetter(handler: any): void;
|
|
5
|
+
/**
|
|
6
|
+
* Set local storage setter
|
|
7
|
+
*/
|
|
8
|
+
export function setStorageSetter(handler: any): void;
|
|
9
|
+
/**
|
|
10
|
+
* Set local storage remover
|
|
11
|
+
*/
|
|
12
|
+
export function setStorageRemover(handler: any): void;
|
|
13
|
+
/**
|
|
14
|
+
* Get text to local storage with key
|
|
15
|
+
*/
|
|
16
|
+
export function getStringFromLocalStorage(key: any): void;
|
|
17
|
+
/**
|
|
18
|
+
* Get json to local storage with key
|
|
19
|
+
*/
|
|
20
|
+
export function getJsonFromLocalStorage(key: any): any;
|
|
21
|
+
/**
|
|
22
|
+
* Save text to local storage with key
|
|
23
|
+
*/
|
|
24
|
+
export function saveStringToLocalStorage(key: any, text: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Save json to local storage with key
|
|
27
|
+
*/
|
|
28
|
+
export function saveJsonToLocalStorage(key: any, json: any): void;
|
|
29
|
+
/**
|
|
30
|
+
* Remove local storage by key
|
|
31
|
+
*/
|
|
32
|
+
export function removeLocalStorage(key: any): void;
|
|
33
|
+
/**
|
|
34
|
+
* Flush local storage
|
|
35
|
+
* @export
|
|
36
|
+
* @param {*} key
|
|
37
|
+
*/
|
|
38
|
+
export function flushLocalStorage(): void;
|
|
39
|
+
export namespace localStorageAssist {
|
|
40
|
+
function getStorage(key: any): void;
|
|
41
|
+
function setStorage(key: any, value: any): void;
|
|
42
|
+
function removeStorage(key: any): void;
|
|
43
|
+
function flushStorage(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export function get(target: any, path: any, defaultValue?: null): any;
|
|
2
|
+
export function round(target: any, decimalPlace: any): number;
|
|
3
|
+
/**
|
|
4
|
+
* 检查字符串string是否以给定的target字符串结尾
|
|
5
|
+
*/
|
|
6
|
+
export function endsWith(source: any, target: any, position: any): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Remove duplicate data and sort (ascending order).
|
|
9
|
+
*/
|
|
10
|
+
export function sortedUnique(array: any): any[];
|
|
11
|
+
export function split(source: any, separator: any, limit?: number): string[];
|
|
12
|
+
export function assign(target: any, source: any): any;
|
|
13
|
+
export function assignWith(target: any, sources: any, customizer: any): any;
|
|
14
|
+
export function reverse(array: any): any;
|
|
15
|
+
export function forEach(collection: any, iteratee: any): any[];
|
|
16
|
+
export function gte(value: any, other: any): boolean;
|
|
17
|
+
export function memoize(fn: any): any;
|
|
18
|
+
export function floor(v: any, len: any): number;
|
|
19
|
+
export function first(array: any): any;
|
|
20
|
+
export function startsWith(source: any, target: any): boolean;
|
|
21
|
+
export function dropRight(array: any, n?: number): any[];
|
|
22
|
+
export function uniqBy(array: any, iterate: any): any[];
|
|
23
|
+
/**
|
|
24
|
+
* Trim value.
|
|
25
|
+
* @param {*} target the value will be trimmed
|
|
26
|
+
* @returns result
|
|
27
|
+
*/
|
|
28
|
+
export function trim(target: any): string;
|
|
29
|
+
/**
|
|
30
|
+
* Replace value.
|
|
31
|
+
* @param {*} target the target value will be replaced
|
|
32
|
+
* @param {*} pattern pattern mode
|
|
33
|
+
* @param {*} value replace value
|
|
34
|
+
* @returns result
|
|
35
|
+
*/
|
|
36
|
+
export function replace(target: any, pattern: any, value: any): string;
|
|
37
|
+
/**
|
|
38
|
+
* 移除数组中predicate(断言)返回为真值的所有元素, 并返回移除元素组成的数组. predicate(断言) 会传入3个参数: (value, index, array).
|
|
39
|
+
* @param {*} array
|
|
40
|
+
* @param {*} predicate (Array|Function|Object|string): 每次迭代调用的函数
|
|
41
|
+
*/
|
|
42
|
+
export function removeFromArray(array: any, predicate: any): any[];
|
|
43
|
+
export function map(collection: any, iteratee: any): any[];
|
|
44
|
+
export function set(object: any, path: any, value: any): any;
|
|
45
|
+
export function size(collection: any): number;
|
|
46
|
+
export function difference(array: any, values: any): any[];
|
|
47
|
+
/**
|
|
48
|
+
* 筛选需要的集合
|
|
49
|
+
* @param {collection} 可筛选的对象, 例如数组
|
|
50
|
+
* @param {predicateFunction} 每次迭代调用的筛选函数
|
|
51
|
+
*/
|
|
52
|
+
export function filter(collection: any, predicateFunction: any): string[];
|
|
53
|
+
/**
|
|
54
|
+
* 创建一个元素数组. 以 iteratee 处理的结果升序排序. 这个方法执行稳定排序, 也就是说相同元素会保持原始排序. iteratees 调用1个参数: (value).
|
|
55
|
+
* @param {collection} (Array|Object), 用来迭代的集合.
|
|
56
|
+
* @param {predicateFunction} 这个函数决定排序
|
|
57
|
+
*/
|
|
58
|
+
export function sortBy(collection: any, predicateFunction: any): any[];
|
|
59
|
+
/**
|
|
60
|
+
* 该方法返回第一个通过 predicateFunction 判断为真值的元素的索引值(index), 而不是元素本身.
|
|
61
|
+
* @param {array} (Array): 要搜索的数组.
|
|
62
|
+
* @param {predicateFunction} 这个函数会在每一次迭代调用
|
|
63
|
+
* @param {fromIndex} (number): The index to search from.
|
|
64
|
+
*/
|
|
65
|
+
export function findIndex(array: any, predicateFunction: any, fromIndex?: number): number;
|
|
66
|
+
/**
|
|
67
|
+
* 该方法返回第一个通过 predicateFunction 判断为真值的元素的索引值(index), 而不是元素本身,返回匹配元素, 否则返回 undefined. .
|
|
68
|
+
* @param {array} (Array): 要搜索的数组.
|
|
69
|
+
* @param {predicateFunction} 这个函数会在每一次迭代调用
|
|
70
|
+
* @param {fromIndex} (number): The index to search from.
|
|
71
|
+
*/
|
|
72
|
+
export function find(array: any, predicateFunction: any, fromIndex?: number): any;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log data message, default displayMode is logDisplay.auto, default level is logLevel.debug, default ancillaryInformation is ''
|
|
3
|
+
*/
|
|
4
|
+
export function logData(data: any, displayMode?: string, level?: string, ancillaryInformation?: string): void;
|
|
5
|
+
/**
|
|
6
|
+
* Log warn message, default ancillaryInformation is ''
|
|
7
|
+
*/
|
|
8
|
+
export function logWarn(data: any, ancillaryInformation?: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Log info message, default ancillaryInformation is ''
|
|
11
|
+
*/
|
|
12
|
+
export function logInfo(data: any, ancillaryInformation?: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Log config message, default ancillaryInformation is ''
|
|
15
|
+
*/
|
|
16
|
+
export function logConfig(data: any, ancillaryInformation?: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Log trace message, default ancillaryInformation is ''
|
|
19
|
+
*/
|
|
20
|
+
export function logTrace(data: any, ancillaryInformation?: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Log debug message, default ancillaryInformation is ''
|
|
23
|
+
*/
|
|
24
|
+
export function logDebug(data: any, ancillaryInformation?: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Log execute message, default ancillaryInformation is ''
|
|
27
|
+
*/
|
|
28
|
+
export function logExecute(data: any, ancillaryInformation?: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Log error message, default ancillaryInformation is ''
|
|
31
|
+
*/
|
|
32
|
+
export function logError(data: any, ancillaryInformation?: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Log text message, default level is logLevel.trace, default ancillaryInformation is ''
|
|
35
|
+
*/
|
|
36
|
+
export function logText(text: any, level?: string, ancillaryInformation?: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Log object message, default level is logLevel.trace, default ancillaryInformation is ''
|
|
39
|
+
*/
|
|
40
|
+
export function logObject(data: any, level?: string, ancillaryInformation?: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get logger display switch
|
|
43
|
+
*/
|
|
44
|
+
export function getLoggerDisplaySwitch(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Set logger display switch
|
|
47
|
+
*/
|
|
48
|
+
export function setLoggerDisplaySwitch(value: any): void;
|
|
49
|
+
export namespace loggerSwitch {
|
|
50
|
+
const loggerDisplaySwitchPromptSetInformationComplete: boolean;
|
|
51
|
+
const loggerDisplaySwitchSetComplete: boolean;
|
|
52
|
+
const display: boolean;
|
|
53
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set the open message display monitor
|
|
3
|
+
*/
|
|
4
|
+
export function setOpenMessageDisplayMonitor(callbackMonitor: any): void;
|
|
5
|
+
/**
|
|
6
|
+
* Set the info message display monitor
|
|
7
|
+
*/
|
|
8
|
+
export function setInfoMessageDisplayMonitor(callbackMonitor: any): void;
|
|
9
|
+
/**
|
|
10
|
+
* Set the warn message display monitor
|
|
11
|
+
*/
|
|
12
|
+
export function seSuccessMessageDisplayMonitor(callbackMonitor: any): void;
|
|
13
|
+
/**
|
|
14
|
+
* Set the warn message display monitor
|
|
15
|
+
*/
|
|
16
|
+
export function setWarnMessageDisplayMonitor(callbackMonitor: any): void;
|
|
17
|
+
/**
|
|
18
|
+
* Set the warning message display monitor
|
|
19
|
+
*/
|
|
20
|
+
export function setWarningMessageDisplayMonitor(callbackMonitor: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* Set the error message display monitor
|
|
23
|
+
*/
|
|
24
|
+
export function setErrorMessageDisplayMonitor(callbackMonitor: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Show open message with display monitor
|
|
27
|
+
*/
|
|
28
|
+
export function showOpenMessage({ text, duration, onClose }: {
|
|
29
|
+
text: any;
|
|
30
|
+
duration?: number | undefined;
|
|
31
|
+
onClose?: (() => void) | undefined;
|
|
32
|
+
}): void;
|
|
33
|
+
/**
|
|
34
|
+
* Show info message with display monitor
|
|
35
|
+
*/
|
|
36
|
+
export function showInfoMessage({ text, duration, onClose }: {
|
|
37
|
+
text: any;
|
|
38
|
+
duration?: number | undefined;
|
|
39
|
+
onClose?: (() => void) | undefined;
|
|
40
|
+
}): void;
|
|
41
|
+
/**
|
|
42
|
+
* Show success message with display monitor
|
|
43
|
+
*/
|
|
44
|
+
export function showSuccessMessage({ text, duration, onClose, }: {
|
|
45
|
+
text: any;
|
|
46
|
+
duration?: number | undefined;
|
|
47
|
+
onClose?: (() => void) | undefined;
|
|
48
|
+
}): void;
|
|
49
|
+
/**
|
|
50
|
+
* Show warn message with display monitor
|
|
51
|
+
*/
|
|
52
|
+
export function showWarnMessage({ text, duration, onClose }: {
|
|
53
|
+
text: any;
|
|
54
|
+
duration?: number | undefined;
|
|
55
|
+
onClose?: (() => void) | undefined;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* Show warning message with display monitor
|
|
59
|
+
*/
|
|
60
|
+
export function showWarningMessage({ text, duration, onClose, }: {
|
|
61
|
+
text: any;
|
|
62
|
+
duration?: number | undefined;
|
|
63
|
+
onClose?: (() => void) | undefined;
|
|
64
|
+
}): void;
|
|
65
|
+
/**
|
|
66
|
+
* Show error message with display monitor
|
|
67
|
+
*/
|
|
68
|
+
export function showErrorMessage({ text, duration, onClose, }: {
|
|
69
|
+
text: any;
|
|
70
|
+
duration?: number | undefined;
|
|
71
|
+
onClose?: (() => void) | undefined;
|
|
72
|
+
}): void;
|
|
73
|
+
export function showError(text: any): void;
|
|
74
|
+
/**
|
|
75
|
+
* Show runtime error
|
|
76
|
+
*/
|
|
77
|
+
export function showRuntimeError({ text, showStack }: {
|
|
78
|
+
text: any;
|
|
79
|
+
showStack?: boolean | undefined;
|
|
80
|
+
}): void;
|
|
81
|
+
export namespace messagePromptAssist {
|
|
82
|
+
function showOpenMessage({ text, duration, onClose }: {
|
|
83
|
+
text: any;
|
|
84
|
+
duration?: number | undefined;
|
|
85
|
+
onClose?: (() => void) | undefined;
|
|
86
|
+
}): void;
|
|
87
|
+
function showInfoMessage({ text, duration, onClose }: {
|
|
88
|
+
text: any;
|
|
89
|
+
duration?: number | undefined;
|
|
90
|
+
onClose?: (() => void) | undefined;
|
|
91
|
+
}): void;
|
|
92
|
+
function showSuccessMessage({ text, duration, onClose }: {
|
|
93
|
+
text: any;
|
|
94
|
+
duration?: number | undefined;
|
|
95
|
+
onClose?: (() => void) | undefined;
|
|
96
|
+
}): void;
|
|
97
|
+
function showWarnMessage({ text, duration, onClose }: {
|
|
98
|
+
text: any;
|
|
99
|
+
duration?: number | undefined;
|
|
100
|
+
onClose?: (() => void) | undefined;
|
|
101
|
+
}): void;
|
|
102
|
+
function showWarningMessage({ text, duration, onClose }: {
|
|
103
|
+
text: any;
|
|
104
|
+
duration?: number | undefined;
|
|
105
|
+
onClose?: (() => void) | undefined;
|
|
106
|
+
}): void;
|
|
107
|
+
function showErrorMessage({ text, duration, onClose }: {
|
|
108
|
+
text: any;
|
|
109
|
+
duration?: number | undefined;
|
|
110
|
+
onClose?: (() => void) | undefined;
|
|
111
|
+
}): void;
|
|
112
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build prompt module info
|
|
3
|
+
*/
|
|
4
|
+
export function buildPromptModuleInfo(moduleName: any): string;
|
|
5
|
+
/**
|
|
6
|
+
* Get browser version
|
|
7
|
+
*/
|
|
8
|
+
export function getBrowserVersion(): {
|
|
9
|
+
trident: boolean;
|
|
10
|
+
presto: boolean;
|
|
11
|
+
webKit: boolean;
|
|
12
|
+
gecko: boolean;
|
|
13
|
+
mobile: boolean;
|
|
14
|
+
ios: boolean;
|
|
15
|
+
android: boolean;
|
|
16
|
+
iPhone: boolean;
|
|
17
|
+
iPad: boolean;
|
|
18
|
+
webApp: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get browser info
|
|
22
|
+
*/
|
|
23
|
+
export function getBrowserInfo(): {
|
|
24
|
+
versions: {
|
|
25
|
+
trident: boolean;
|
|
26
|
+
presto: boolean;
|
|
27
|
+
webKit: boolean;
|
|
28
|
+
gecko: boolean;
|
|
29
|
+
mobile: boolean;
|
|
30
|
+
ios: boolean;
|
|
31
|
+
android: boolean;
|
|
32
|
+
iPhone: boolean;
|
|
33
|
+
iPad: boolean;
|
|
34
|
+
webApp: boolean;
|
|
35
|
+
};
|
|
36
|
+
language: any;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Get random seed
|
|
40
|
+
*/
|
|
41
|
+
export function seededRandom({ seed, min, max }: {
|
|
42
|
+
seed: any;
|
|
43
|
+
min: any;
|
|
44
|
+
max: any;
|
|
45
|
+
}): any;
|
|
46
|
+
export function cloneWithoutMethod(value: any): any;
|
|
47
|
+
/**
|
|
48
|
+
* Refit common data
|
|
49
|
+
*/
|
|
50
|
+
export function refitCommonData(listData: any, empty: any, otherListData: any): any[];
|
|
51
|
+
/**
|
|
52
|
+
* Refit field decorator option
|
|
53
|
+
*/
|
|
54
|
+
export function refitFieldDecoratorOption(v: any, justice: any, defaultValue: any, originalOption: any, convertCallback: any): any;
|
|
55
|
+
/**
|
|
56
|
+
* Search from list
|
|
57
|
+
*/
|
|
58
|
+
export function searchFromList(itemKey: any, itemValue: any, sourceData: any): null;
|
|
59
|
+
/**
|
|
60
|
+
* create Guid string, default len is 8, default radix is 16
|
|
61
|
+
*/
|
|
62
|
+
export function getGuid(len?: number, radix?: number): string;
|
|
63
|
+
/**
|
|
64
|
+
* Check if more data is available for paging scenarios
|
|
65
|
+
*/
|
|
66
|
+
export function checkHasMore({ pageNo, pageSize, total }: {
|
|
67
|
+
pageNo: any;
|
|
68
|
+
pageSize: any;
|
|
69
|
+
total: any;
|
|
70
|
+
}): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Check current runtime environment whether development environment
|
|
73
|
+
*/
|
|
74
|
+
export function checkWhetherDevelopmentEnvironment(): boolean;
|
|
75
|
+
export function getValue(obj: any): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function getNearestLocalhostNotifyCache(): any;
|
|
2
|
+
export function setNearestLocalhostNotifyCache(): void;
|
|
3
|
+
export function removeNearestLocalhostNotifyCache(): void;
|
|
4
|
+
/**
|
|
5
|
+
* 尝试发送最近一次本地调用通知(一般用于开发阶段, 提示调用的接口域)
|
|
6
|
+
*/
|
|
7
|
+
export function trySendNearestLocalhostNotify({ text }: {
|
|
8
|
+
text: any;
|
|
9
|
+
}): void;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set the open notification display monitor
|
|
3
|
+
*/
|
|
4
|
+
export function setOpenNotificationDisplayMonitor(callbackMonitor: any): void;
|
|
5
|
+
/**
|
|
6
|
+
* Set the info notification display monitor
|
|
7
|
+
*/
|
|
8
|
+
export function setInfoNotificationDisplayMonitor(callbackMonitor: any): void;
|
|
9
|
+
/**
|
|
10
|
+
* Set the warn notification display monitor
|
|
11
|
+
*/
|
|
12
|
+
export function seSuccessNotificationDisplayMonitor(callbackMonitor: any): void;
|
|
13
|
+
/**
|
|
14
|
+
* Set the warn notification display monitor
|
|
15
|
+
*/
|
|
16
|
+
export function setWarnNotificationDisplayMonitor(callbackMonitor: any): void;
|
|
17
|
+
/**
|
|
18
|
+
* Set the warning notification display monitor
|
|
19
|
+
*/
|
|
20
|
+
export function setWarningNotificationDisplayMonitor(callbackMonitor: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* Set the error notification display monitor
|
|
23
|
+
*/
|
|
24
|
+
export function setErrorNotificationDisplayMonitor(callbackMonitor: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Show open notification with display monitor
|
|
27
|
+
*/
|
|
28
|
+
export function showOpenNotification({ text, duration, onClose, }: {
|
|
29
|
+
text: any;
|
|
30
|
+
duration?: number | undefined;
|
|
31
|
+
onClose?: (() => void) | undefined;
|
|
32
|
+
}): void;
|
|
33
|
+
/**
|
|
34
|
+
* Show info notification with display monitor
|
|
35
|
+
*/
|
|
36
|
+
export function showInfoNotification({ text, duration, onClose, }: {
|
|
37
|
+
text: any;
|
|
38
|
+
duration?: number | undefined;
|
|
39
|
+
onClose?: (() => void) | undefined;
|
|
40
|
+
}): void;
|
|
41
|
+
/**
|
|
42
|
+
* Show success notification with display monitor
|
|
43
|
+
*/
|
|
44
|
+
export function showSuccessNotification({ text, duration, onClose, }: {
|
|
45
|
+
text: any;
|
|
46
|
+
duration?: number | undefined;
|
|
47
|
+
onClose?: (() => void) | undefined;
|
|
48
|
+
}): void;
|
|
49
|
+
/**
|
|
50
|
+
* Show warn notification with display monitor
|
|
51
|
+
*/
|
|
52
|
+
export function showWarnNotification({ text, duration, onClose, }: {
|
|
53
|
+
text: any;
|
|
54
|
+
duration?: number | undefined;
|
|
55
|
+
onClose?: (() => void) | undefined;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* Show warning notification with display monitor
|
|
59
|
+
*/
|
|
60
|
+
export function showWarningNotification({ text, duration, onClose, }: {
|
|
61
|
+
text: any;
|
|
62
|
+
duration?: number | undefined;
|
|
63
|
+
onClose?: (() => void) | undefined;
|
|
64
|
+
}): void;
|
|
65
|
+
/**
|
|
66
|
+
* Show error notification with display monitor
|
|
67
|
+
*/
|
|
68
|
+
export function showErrorNotification({ text, duration, onClose, }: {
|
|
69
|
+
text: any;
|
|
70
|
+
duration?: number | undefined;
|
|
71
|
+
onClose?: (() => void) | undefined;
|
|
72
|
+
}): void;
|
|
73
|
+
export namespace notificationPromptAssist {
|
|
74
|
+
function showOpenNotification({ text, duration, onClose }: {
|
|
75
|
+
text: any;
|
|
76
|
+
duration?: number | undefined;
|
|
77
|
+
onClose?: (() => void) | undefined;
|
|
78
|
+
}): void;
|
|
79
|
+
function showInfoNotification({ text, duration, onClose }: {
|
|
80
|
+
text: any;
|
|
81
|
+
duration?: number | undefined;
|
|
82
|
+
onClose?: (() => void) | undefined;
|
|
83
|
+
}): void;
|
|
84
|
+
function showSuccessNotification({ text, duration, onClose }: {
|
|
85
|
+
text: any;
|
|
86
|
+
duration?: number | undefined;
|
|
87
|
+
onClose?: (() => void) | undefined;
|
|
88
|
+
}): void;
|
|
89
|
+
function showWarnNotification({ text, duration, onClose }: {
|
|
90
|
+
text: any;
|
|
91
|
+
duration?: number | undefined;
|
|
92
|
+
onClose?: (() => void) | undefined;
|
|
93
|
+
}): void;
|
|
94
|
+
function showWarningNotification({ text, duration, onClose }: {
|
|
95
|
+
text: any;
|
|
96
|
+
duration?: number | undefined;
|
|
97
|
+
onClose?: (() => void) | undefined;
|
|
98
|
+
}): void;
|
|
99
|
+
function showErrorNotification({ text, duration, onClose }: {
|
|
100
|
+
text: any;
|
|
101
|
+
duration?: number | undefined;
|
|
102
|
+
onClose?: (() => void) | undefined;
|
|
103
|
+
}): void;
|
|
104
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build query string url,default path is '', result like 'https://www.a.com?userId=2'
|
|
3
|
+
*/
|
|
4
|
+
export function buildQueryStringify(data: any, path?: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Parse query string
|
|
7
|
+
*/
|
|
8
|
+
export function parseQueryString(data: any): import("qs").ParsedQs;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build field description like '请输入名称,以字母开头'
|
|
3
|
+
*/
|
|
4
|
+
export function buildFieldDescription(title: any, operation: any, ancillaryInformation?: string): string;
|
|
5
|
+
export function checkFromConfig({ label, name, helper }: {
|
|
6
|
+
label: any;
|
|
7
|
+
name: any;
|
|
8
|
+
helper: any;
|
|
9
|
+
}): {
|
|
10
|
+
label: string;
|
|
11
|
+
name: string;
|
|
12
|
+
helper: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Build field helper message
|
|
16
|
+
*/
|
|
17
|
+
export function buildFieldHelper(v: any, prefix?: string): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "easy-soft-utility",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "easy-soft-utility",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"easy-soft-utility"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/kityandhero/easy-soft-framework#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/kityandhero/easy-soft-framework/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/kityandhero/easy-soft-framework.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "卢志涛 <kityandhero@126.com>",
|
|
19
|
+
"main": "src/index.ts",
|
|
20
|
+
"directories": {
|
|
21
|
+
"es": "es"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"es"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "rimraf ./es && rollup --config rollup.config.compression.js --bundleConfigAsCjs && tsc -v && tsc -p ./tsconfig.types.json",
|
|
28
|
+
"build:skipCompression": "rimraf ./es && rollup --config rollup.config.skipCompression.js --bundleConfigAsCjs && tsc -v && tsc -p ./tsconfig.types.json",
|
|
29
|
+
"clean-file": "rimraf ./node_modules",
|
|
30
|
+
"dev": "rollup --config rollup.config.skipCompression.js --bundleConfigAsCjs --watch",
|
|
31
|
+
"lint": "npm run lint:js && npm run lint:style && npm run lint:prettier",
|
|
32
|
+
"lint-staged": "lint-staged",
|
|
33
|
+
"lint-staged:js": "npx eslint --ext .js,.jsx,.ts,.tsx ",
|
|
34
|
+
"lint:fix": "npx eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style",
|
|
35
|
+
"lint:js": "npx eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
|
|
36
|
+
"lint:prettier": "npx prettier --check \"**/*\" --end-of-line auto",
|
|
37
|
+
"lint:style": "npx stylelint --fix \"./src/**/*.less\"",
|
|
38
|
+
"precommit": "lint-staged",
|
|
39
|
+
"prettier": "npx prettier -c --write \"**/*\"",
|
|
40
|
+
"publish:compression": "npm run build && yarn publish",
|
|
41
|
+
"v:p": "npm version patch && yarn publish"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"dayjs": "^1.11.7",
|
|
45
|
+
"lodash": "^4.17.21",
|
|
46
|
+
"node-cache": "^5.1.2",
|
|
47
|
+
"object-hash": "^3.0.0",
|
|
48
|
+
"react": "^18.2.0",
|
|
49
|
+
"react-dom": "^18.2.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@babel/eslint-parser": "^7.19.1",
|
|
53
|
+
"@babel/plugin-external-helpers": "^7.18.6",
|
|
54
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
55
|
+
"@babel/plugin-proposal-decorators": "^7.20.7",
|
|
56
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
57
|
+
"@babel/preset-react": "^7.18.6",
|
|
58
|
+
"@babel/runtime": "^7.20.7",
|
|
59
|
+
"@commitlint/cli": "^17.4.2",
|
|
60
|
+
"@commitlint/config-conventional": "^17.4.2",
|
|
61
|
+
"@commitlint/config-lerna-scopes": "^17.4.2",
|
|
62
|
+
"@commitlint/cz-commitlint": "^17.4.2",
|
|
63
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
64
|
+
"@rollup/plugin-alias": "^4.0.2",
|
|
65
|
+
"@rollup/plugin-babel": "6.0.3",
|
|
66
|
+
"@rollup/plugin-buble": "^1.0.1",
|
|
67
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
68
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
69
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
70
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
71
|
+
"@rollup/plugin-url": "^8.0.1",
|
|
72
|
+
"@svgr/rollup": "^6.5.1",
|
|
73
|
+
"@types/lodash": "^4.14.191",
|
|
74
|
+
"@types/object-hash": "^3.0.2",
|
|
75
|
+
"@types/qs": "^6.9.7",
|
|
76
|
+
"@types/react": "^18.0.26",
|
|
77
|
+
"@types/webpack-env": "^1.18.0",
|
|
78
|
+
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
|
79
|
+
"autoprefixer": "^10.4.13",
|
|
80
|
+
"babel-cli": "^6.26.0",
|
|
81
|
+
"babel-plugin-import": "^1.13.6",
|
|
82
|
+
"babel-preset-env": "^1.7.0",
|
|
83
|
+
"babel-preset-taro": "^3.5.11",
|
|
84
|
+
"classnames": "^2.3.2",
|
|
85
|
+
"commitizen": "^4.2.6",
|
|
86
|
+
"cross-env": "^7.0.3",
|
|
87
|
+
"cssnano": "^5.1.14",
|
|
88
|
+
"eslint": "^8.31.0",
|
|
89
|
+
"eslint-config-prettier": "^8.6.0",
|
|
90
|
+
"eslint-config-taro": "^3.5.11",
|
|
91
|
+
"eslint-formatter-pretty": "^4.1.0",
|
|
92
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
93
|
+
"eslint-plugin-import": "^2.27.4",
|
|
94
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
95
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
96
|
+
"eslint-plugin-react": "^7.32.0",
|
|
97
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
98
|
+
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
99
|
+
"husky": "^8.0.3",
|
|
100
|
+
"postcss": "^8.4.21",
|
|
101
|
+
"postcss-less": "^6.0.0",
|
|
102
|
+
"postcss-pxtorem": "^6.0.0",
|
|
103
|
+
"prettier": "^2.8.3",
|
|
104
|
+
"prettier-plugin-organize-imports": "^3",
|
|
105
|
+
"prettier-plugin-packagejson": "^2",
|
|
106
|
+
"qs": "^6.11.0",
|
|
107
|
+
"react-refresh": "^0.14.0",
|
|
108
|
+
"rollup": "^3.10.0",
|
|
109
|
+
"rollup-plugin-livereload": "^2.0.5",
|
|
110
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
111
|
+
"rollup-plugin-serve": "^2.0.2",
|
|
112
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
113
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
114
|
+
"stylelint": "^14.16.1",
|
|
115
|
+
"stylelint-config-css-modules": "^4.1.0",
|
|
116
|
+
"stylelint-config-prettier": "^9.0.4",
|
|
117
|
+
"stylelint-config-standard": "^29.0.0",
|
|
118
|
+
"stylelint-declaration-block-no-ignored-properties": "^2.6.0",
|
|
119
|
+
"webpack": "^5.75.0"
|
|
120
|
+
}
|
|
121
|
+
}
|