native-fn 1.0.26 → 1.0.28
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 +22 -192
- package/dist/index.d.ts +18 -27
- package/dist/native.cjs +27 -1400
- package/dist/native.min.cjs +1 -0
- package/dist/native.min.mjs +1 -0
- package/dist/native.mjs +27 -1400
- package/dist/native.umd.js +27 -1400
- package/dist/native.umd.min.js +1 -0
- package/dist/plugin/app/index.cjs +1025 -0
- package/dist/plugin/app/index.d.ts +86 -0
- package/dist/plugin/app/index.min.cjs +1 -0
- package/dist/plugin/app/index.min.mjs +1 -0
- package/dist/plugin/app/index.mjs +1023 -0
- package/dist/plugin/app/index.umd.js +1031 -0
- package/dist/plugin/app/index.umd.min.js +1 -0
- package/dist/plugin/app/src/constants/platform.d.ts +35 -0
- package/dist/plugin/app/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/app/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/app/src/plugin/app/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/app/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/plugin/app/src/plugin/app/types/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/app/src/plugin/platform/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/{src → plugin/app/src/plugin/platform}/types/platform.d.ts +1 -1
- package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/{src → plugin/app/src/plugin/theme}/constants/theme.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/app/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/{src → plugin/app/src/plugin/theme}/types/easing-syntax.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/{src → plugin/app/src/plugin/theme}/types/theme.d.ts +4 -4
- package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-color.d.ts +1 -1
- package/dist/{src → plugin/app/src/plugin/theme}/utils/parse-easing-function.d.ts +1 -1
- package/dist/plugin/app/src/types/index.d.ts +1 -0
- package/dist/plugin/app/src/types/native.d.ts +14 -0
- package/dist/plugin/app/src/utils/assign.d.ts +1 -0
- package/dist/plugin/app/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +171 -0
- package/dist/plugin/platform/index.d.ts +51 -0
- package/dist/plugin/platform/index.min.cjs +1 -0
- package/dist/plugin/platform/index.min.mjs +1 -0
- package/dist/plugin/platform/index.mjs +169 -0
- package/dist/plugin/platform/index.umd.js +177 -0
- package/dist/plugin/platform/index.umd.min.js +1 -0
- package/dist/plugin/platform/src/constants/platform.d.ts +35 -0
- package/dist/plugin/platform/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/app/constants/app.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/app/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/platform/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/plugin/platform/src/plugin/app/types/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +16 -0
- package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/platform/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/platform/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +24 -0
- package/dist/plugin/platform/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/plugin/platform/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/platform/src/types/index.d.ts +1 -0
- package/dist/plugin/platform/src/types/native.d.ts +14 -0
- package/dist/plugin/platform/src/utils/assign.d.ts +1 -0
- package/dist/plugin/platform/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +810 -0
- package/dist/plugin/theme/index.d.ts +75 -0
- package/dist/plugin/theme/index.min.cjs +1 -0
- package/dist/plugin/theme/index.min.mjs +1 -0
- package/dist/plugin/theme/index.mjs +808 -0
- package/dist/plugin/theme/index.umd.js +816 -0
- package/dist/plugin/theme/index.umd.min.js +1 -0
- package/dist/plugin/theme/src/constants/platform.d.ts +35 -0
- package/dist/plugin/theme/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/app/constants/app.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/app/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/theme/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/plugin/theme/src/plugin/app/types/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +16 -0
- package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/theme/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/theme/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +24 -0
- package/dist/plugin/theme/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/plugin/theme/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/theme/src/types/index.d.ts +1 -0
- package/dist/plugin/theme/src/types/native.d.ts +14 -0
- package/dist/plugin/theme/src/utils/assign.d.ts +1 -0
- package/dist/plugin/theme/src/utils/create-custom-error.d.ts +1 -0
- package/dist/src/plugin/app/constants/app.d.ts +13 -0
- package/dist/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/src/plugin/app/index.d.ts +5 -0
- package/dist/src/plugin/app/types/app.d.ts +54 -0
- package/dist/src/plugin/app/types/appModule.d.ts +54 -0
- package/dist/src/plugin/app/types/index.d.ts +1 -0
- package/dist/src/plugin/app/utils/event-listener-utils.d.ts +3 -0
- package/dist/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/src/plugin/platform/index.d.ts +5 -0
- package/dist/src/plugin/platform/types/index.d.ts +1 -0
- package/dist/src/plugin/platform/types/platform.d.ts +13 -0
- package/dist/src/plugin/platform/types/platformModule.d.ts +13 -0
- package/dist/src/plugin/theme/constants/theme.d.ts +16 -0
- package/dist/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/src/plugin/theme/index.d.ts +5 -0
- package/dist/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/src/plugin/theme/types/index.d.ts +3 -0
- package/dist/src/plugin/theme/types/theme.d.ts +24 -0
- package/dist/src/plugin/theme/types/themeModule.d.ts +24 -0
- package/dist/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/src/types/index.d.ts +1 -5
- package/dist/src/types/native.d.ts +14 -0
- package/dist/src/utils/assign.d.ts +1 -0
- package/package.json +8 -5
- package/dist/src/cores/app.d.ts +0 -3
- package/dist/src/cores/platform.d.ts +0 -3
- package/dist/src/cores/theme.d.ts +0 -3
- package/dist/src/types/app.d.ts +0 -44
- package/dist/src/types/color.d.ts +0 -17
- package/dist/src/utils/freeze-deep.d.ts +0 -1
- /package/dist/{src → plugin/app/src/plugin/app}/constants/app.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/app}/errors/url-open-error.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/app}/utils/try-open-url.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/theme}/errors/easing-error.d.ts +0 -0
- /package/dist/{src → plugin/app/src/plugin/theme}/errors/unsupported-color-error.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Theme=t()}(this,(function(){"use strict";var e,t=navigator.userAgent;!function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(e||(e={}));var r=function(){var e=t.match(/chrome\/([\w.]+) mobile/i);if(null===e)return NaN;var r=parseInt(e[1]);return isNaN(r)?NaN:r}(),n=window.matchMedia("(prefers-color-scheme: dark)"),o="not all"!==n.media,a=isNaN(r)||r>=92,i=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),u=/Samsung/i.test(t),l=/iemobile/i.test(t),s=/windows phone/i.test(t),c=[];function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){function r(n){if(!(this instanceof r))return new r(n);var o=new t(n||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(o,r.prototype):o.__proto__=r.prototype,o.name=e,void 0!==n&&(o.message=n),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(o,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(o,r);else if(t.captureStackTrace&&"function"==typeof t.captureStackTrace)t.captureStackTrace(o,r);else try{var a=new t;a.stack&&(o.stack=a.stack)}catch(e){}return o}void 0===t&&(t=Error),r.prototype=Object.create(t.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(t){try{r.prototype.name=e}catch(e){}}try{Object.defineProperty(r,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return r}"function"==typeof SuppressedError&&SuppressedError;var p=d("EasingError"),m=d("CubicBezierSyntaxError",p),v=d("LinearSyntaxError",p),h=d("StepSyntaxError",p),b=d("UnsupportedEasingFunctionError",p),g={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function y(e,t,r){return e<t?t:e>r?r:e}function w(e){var t=function(e){var t=e.match(/cubic-bezier\((.*)\)/);if(null===t)throw new m("Invalid cubic-bezier syntax");var r=t[1].trim().split(","),n=[];if(4!==r.length)throw new m("Cubic-bezier must have exactly 4 numeric values");for(var o=0;o<4;o++){var a=parseFloat(r[o]);if(isNaN(a))throw new m("Cubic-bezier must have exactly 4 numeric values");if(o%2==0&&(a<0||a>1))throw new m("x1 and x2 must be between 0 and 1");n.push(a)}return{x1:n[0],y1:n[1],x2:n[2],y2:n[3]}}(e),r=t.x1,n=t.x2,o=t.y1,a=t.y2;return function(e){if(0===(e=y(e,0,1))||1===e)return e;var t=function(e,t,o){if(void 0===t&&(t=1e-6),void 0===o&&(o=50),e<=0)return 0;if(e>=1)return 1;for(var a=e,i=0;i<o;i++){var u=3*(1-a)*(1-a)*a*r+3*(1-a)*a*a*n+a*a*a,l=3*(1-a)*(1-a)*r+6*(1-a)*a*(n-r)+3*a*a*(1-n);if(Math.abs(l)<t)break;var s=a-(u-e)/l;if(Math.abs(s-a)<t){a=s;break}a=Math.max(0,Math.min(1,s))}return a}(e);return 3*(1-t)*(1-t)*t*o+3*(1-t)*t*t*a+t*t*t}}function S(e){var t=function(e){var t,r,n=e.match(/linear\((.*)\)/);if(null===n)throw new v("Invalid linear syntax");var o=n[1].trim();if(""===o)throw new v("Linear function must have at least one point");for(var a=o.split(","),i=[],u=0;u<a.length;u++){var l=a[u].trim(),s=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===s){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new v('Invalid linear point format: "'+l+'"');i.push({position:1===a.length?0:u/(a.length-1),value:parseFloat(d[1])})}else i.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var p=parseFloat(s[1]),m=s[2].trim().split(/\s+/);try{for(var h=(t=void 0,f(m)),b=h.next();!b.done;b=h.next()){var g=b.value;i.push({value:p,position:parseFloat(g)/100})}}catch(e){t={error:e}}finally{try{b&&!b.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}}if(0===i.length)throw new v("No valid points found in linear function");return i.sort((function(e,t){return e.position-t.position})),i[0].position>0&&i.unshift({position:0,value:0}),i[i.length-1].position<1&&i.push({position:1,value:1}),i}(e);return function(e){if((e=y(e,0,1))<=t[0].position)return t[0].value;if(e>=t[t.length-1].position)return t[t.length-1].value;for(var r=0;r<t.length-1;r++){var n=t[r],o=t[r+1];if(e>=n.position&&e<=o.position){if(n.position===o.position)return o.value;var a=(e-n.position)/(o.position-n.position);return n.value+(o.value-n.value)*a}}return t[t.length-1].value}}function x(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=g[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return w(e);if(function(e){return/linear\(/.test(e)}(e))return S(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var t=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===t)throw new h("Invalid steps syntax");var r=parseInt(t[1],10),n=t[2];if(r<=0)throw new h("Steps count must be a positive integer");if("jump-none"===n&&r<2)throw new h("jump-none requires at least 2 steps");return function(e){switch(e=y(e,0,1),n){case"start":case"jump-start":return 0===e?1/r:1===e?1:Math.ceil(e*r)/r;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*r)/r;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(r+1))/(r+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(r-1))/(r-1);default:throw new h('Unsupported step position: "'+n+'"')}}}(e);throw new b('Unsupported easing function: "'+e+'"')}var E=d("UnsupportedColorError");function k(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new E('Unsupported color: "'+e+'".');if(null!==i)try{i.clearRect(0,0,1,1),i.fillStyle=e,i.fillRect(0,0,1,1);var t=i.getImageData(0,0,1,1).data;return{red:t[0],green:t[1],blue:t[2],alpha:parseFloat((t[3]/255).toFixed(2))}}catch(e){}var r=document.createElement("div");r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.color=e,document.body.appendChild(r);try{var n=window.getComputedStyle(r).color,o=n.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),a=n.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),u=o||a;if(null===u)throw new E('Unsupported color: "'+e+'".');var l=parseInt(u[1],10),s=parseInt(u[2],10),c=parseInt(u[3],10),f=1;if(void 0!==u[4]){var d=u[4];f="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(l)||isNaN(s)||isNaN(c)||isNaN(f))throw new E('Failed to parse color values from: "'+e+'".');return{red:l,green:s,blue:c,alpha:f}}finally{document.body.removeChild(r)}}var j,C={},L=null,I=null,F=null,M=null,N={setThemeColor:function(t,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,i=x(r.easingFunction),u=r.appearance;null!==L&&(window.cancelAnimationFrame(L),L=null,null!==I&&(I(R()),I=null));var c=R();void 0===c&&(c=void 0!==r.defaultColor?r.defaultColor:P()===e.Dark?"#181818ff":"#dcdcdcff");var f=k(c),d=k(t);return new Promise((function(e){I=e;var t=null;L=window.requestAnimationFrame((function r(c){null===t&&(t=c);var p,m=c-t;p=0===n?1:Math.min(m/n,1);var v=i(p),h={red:Math.round(f.red+(d.red-f.red)*v),green:Math.round(f.green+(d.green-f.green)*v),blue:Math.round(f.blue+(d.blue-f.blue)*v),alpha:+(f.alpha+(d.alpha-f.alpha)*v).toFixed(2)};(function(e){void 0===e&&(e="default");var t;t=!a||!o||l||s?"default":e;var r=C[t];if(void 0!==r)return r;r=document.createElement("meta"),l?r.setAttribute("name","msapplication-navbutton-color"):s?r.setAttribute("name","msapplication-TileColor"):r.setAttribute("name","theme-color");"default"!==e&&r.setAttribute("media","(prefers-color-scheme: "+t+")");return document.head.prepend(r),C[e]=r})(u).setAttribute("content",T(h)),p<1?L=window.requestAnimationFrame(r):(L=null,null!==I&&(e(R()),L=null))}))}))},getThemeColor:R,removeThemeColor:function(e){void 0===e&&(e="default");var t=C[e];void 0!==t&&t.remove();C[e]=void 0},detectAppearance:function(){return u?z():Promise.resolve(P())},onAppearanceChange:function(e,t){void 0===t&&(t=!1);var r={fn:e,capture:!1,once:!1};"boolean"==typeof t&&(t={capture:t});void 0!==t.capture&&(r.capture=t.capture);void 0!==t.once&&(r.once=t.once);void 0!==t.signal&&(r.signal=t.signal);var o=q(r);-1===o?(c.push(r),1===c.length&&(u?(z().then((function(e){F=e})),M=window.setInterval((function(){z().then((function(e){e!==F&&(F=e,U(e))}))}),2e3)):(a=r.capture,F=P(),"function"==typeof n.addEventListener?n.addEventListener("change",D,a):"function"==typeof n.addListener&&n.addListener(D))),this.detectAppearance().then(U)):c[o].once&&!r.once&&(c[o].once=!1);var a;void 0!==r.signal&&(r.signal.aborted?O(r):r.signal.addEventListener("abort",(function e(){void 0!==r.signal&&r.signal.removeEventListener("abort",e),O(r)})));return function(){O(r)}}};function A(e){var t=e.toString(16);switch(t.length){case 0:return"00";case 1:return"0"+t;default:return t}}function T(e){return"#"+A(e.red)+A(e.green)+A(e.blue)+A(Math.round(255*e.alpha))}function z(){return new Promise((function(t){var r=new Image;r.onload=function(){if(null===i)return t(e.Light);i.drawImage(r,0,0);var n=i.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?t(e.Dark):t(e.Light)},r.onerror=function(){t(e.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function P(){return o?n.matches?e.Dark:e.Light:e.Unknown}function D(t){var r;(r=t.matches?e.Dark:e.Light)!==F&&U(F=r)}function U(e){for(var t=0;t<c.length;t++){var r=c[t];r.fn(e),r.once&&O(r)}}function O(e){var t,r=q(e);-1!==r&&c.splice(r,1),0===c.length&&(u?(F=null,null!==M&&(clearInterval(M),M=null)):(t=e.capture,F=null,"function"==typeof n.removeEventListener?n.removeEventListener("change",D,t):"function"==typeof n.removeListener&&n.removeListener(D)))}function q(e){for(var t=0;t<c.length;t++)if(c[t].fn===e.fn&&c[t].capture===e.capture)return t;return-1}function H(){var e;C={},e=l?'meta[name="msapplication-navbutton-color"]':s?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var t=document.querySelectorAll(e);if(a&&o&&!l&&!s)for(var r=0;r<t.length;r++){var n=t.item(r),i=n.getAttribute("media");if("(prefers-color-scheme: dark)"===i&&void 0===C.dark?C.dark=n:"(prefers-color-scheme: light)"===i&&void 0===C.light?C.light=n:null===i&&void 0===C.default&&(C.default=n),void 0!==C.dark&&void 0!==C.light&&void 0!==C.default)return}else C.default=t[0]}function R(){var r=function(){if(l)return document.querySelector('meta[name="msapplication-navbutton-color"]');if(s)return document.querySelector('meta[name="msapplication-TileColor"]');if(!a||!o)return document.querySelector('meta[name="theme-color"]');var t,r=document.querySelectorAll('meta[name="theme-color"]');t=P()===e.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var i=r.item(n);if(i.hasAttribute("content")){var u=i.getAttribute("media");if(null===u||u===t)return i}}return null}();return null!==r?r.getAttribute("content"):/version\/[\w.,]+ .*safari/i.test(t)?navigator.standalone?P()===e.Dark?"#ffffffff":"#000000ff":T(k(window.getComputedStyle(document.body).backgroundColor)):/\b(?:crmo|crios)\/[\w.]+/i.test(t)||/chrome\/[\w.]+ mobile/i.test(t)?P()===e.Dark?"#28292cff":"#ffffffff":void 0}return j=new MutationObserver((function(e){for(var t=0;t<e.length;t++){for(var r=e[t],n=r.addedNodes,o=r.removedNodes,a=0;a<n.length;a++)if(n[a]instanceof HTMLMetaElement)return H();for(a=0;a<o.length;a++)if(o[a]instanceof HTMLMetaElement)return H()}})),"function"==typeof n.addEventListener?n.addEventListener("change",H):"function"==typeof n.addListener&&n.addListener(H),j.observe(document.head,{childList:!0}),H(),{installed:!1,name:"Theme",module:N,constants:{Appearances:e},errors:{EasingError:p,UnsupportedEasingFunctionError:b,StepSyntaxError:h,LinearSyntaxError:v,CubicBezierSyntaxError:m,UnsupportedColorError:E}}}));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare enum OS {
|
|
2
|
+
Unknown = "Unknown",
|
|
3
|
+
Android = "Android",
|
|
4
|
+
iOS = "iOS",
|
|
5
|
+
Windows = "Windows",
|
|
6
|
+
MacOS = "MacOS"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Devices {
|
|
9
|
+
Unknown = "Unknown",
|
|
10
|
+
Mobile = "Mobile",
|
|
11
|
+
Desktop = "Desktop"
|
|
12
|
+
}
|
|
13
|
+
export declare enum Engines {
|
|
14
|
+
Unknown = "Unknown",
|
|
15
|
+
EdgeHTML = "EdgeHTML",
|
|
16
|
+
ArkWeb = "ArkWeb",
|
|
17
|
+
Blink = "Blink",
|
|
18
|
+
Presto = "Presto",
|
|
19
|
+
WebKit = "WebKit",
|
|
20
|
+
Trident = "Trident",
|
|
21
|
+
NetFront = "NetFront",
|
|
22
|
+
KHTML = "KHTML",
|
|
23
|
+
Tasman = "Tasman",
|
|
24
|
+
Gecko = "Gecko"
|
|
25
|
+
}
|
|
26
|
+
export declare let OS_NAME: OS;
|
|
27
|
+
export declare let OS_VERSION: string;
|
|
28
|
+
export declare let DEVICE_NAME: Devices;
|
|
29
|
+
export declare let ENGINE_NAME: Engines;
|
|
30
|
+
export declare let ENGINE_VERSION: string;
|
|
31
|
+
export declare const RENDERER: string;
|
|
32
|
+
export declare const IS_MOBILE: boolean;
|
|
33
|
+
export declare const IS_DESKTOP: boolean;
|
|
34
|
+
export declare const IS_STANDALONE: boolean;
|
|
35
|
+
export declare const IS_WEBVIEW: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const USER_AGENT: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum AppOpenState {
|
|
2
|
+
Scheme = 0,
|
|
3
|
+
Universal = 1,
|
|
4
|
+
Intent = 2,
|
|
5
|
+
Fallback = 3,
|
|
6
|
+
Store = 4
|
|
7
|
+
}
|
|
8
|
+
export declare enum Messengers {
|
|
9
|
+
Telephone = "telephone",
|
|
10
|
+
Message = "message",
|
|
11
|
+
Mail = "mail"
|
|
12
|
+
}
|
|
13
|
+
export declare const IS_SUPPORT_INTENT: boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OS } from '../../../constants/platform';
|
|
2
|
+
import { AppOpenState, Messengers } from '../constants/app';
|
|
3
|
+
export declare interface EventListenerUtil {
|
|
4
|
+
useStd: boolean;
|
|
5
|
+
add: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
6
|
+
remove: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
7
|
+
withVender: (target: any, type?: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare interface EventListenerOptions {
|
|
10
|
+
type?: string;
|
|
11
|
+
callback: EventListenerOrEventListenerObject | null;
|
|
12
|
+
options?: AddEventListenerOptions | boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare interface AppInfo {
|
|
15
|
+
scheme?: URLCandidate;
|
|
16
|
+
fallback?: URLCandidate | (() => any);
|
|
17
|
+
timeout?: number;
|
|
18
|
+
allowWebStore?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
21
|
+
packageName?: string;
|
|
22
|
+
intent?: URLCandidate;
|
|
23
|
+
}
|
|
24
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
25
|
+
universal?: URLCandidate;
|
|
26
|
+
}
|
|
27
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
28
|
+
productId?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
31
|
+
bundleId?: string;
|
|
32
|
+
trackId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare interface AppOpenOptions {
|
|
35
|
+
[OS.Android]?: AndroidAppInfo;
|
|
36
|
+
[OS.iOS]?: IOSAppInfo;
|
|
37
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
38
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
39
|
+
}
|
|
40
|
+
export declare type URLCandidate = URL | string;
|
|
41
|
+
export declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
|
|
42
|
+
export declare type StringifiableSequence = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
|
|
43
|
+
export declare type MessengerOpenOptions = {
|
|
44
|
+
to?: Stringifiable | StringifiableSequence;
|
|
45
|
+
cc?: Stringifiable | StringifiableSequence;
|
|
46
|
+
bcc?: Stringifiable | StringifiableSequence;
|
|
47
|
+
subject?: Stringifiable;
|
|
48
|
+
body?: Stringifiable;
|
|
49
|
+
} | HTMLFormElement | FormData;
|
|
50
|
+
export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
|
|
51
|
+
export declare interface App {
|
|
52
|
+
open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OS } from '../../../constants/platform';
|
|
2
|
+
import { AppOpenState, Messengers } from '../constants/app';
|
|
3
|
+
export declare interface EventListenerUtil {
|
|
4
|
+
useStd: boolean;
|
|
5
|
+
add: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
6
|
+
remove: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
7
|
+
withVender: (target: any, type?: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare interface EventListenerOptions {
|
|
10
|
+
type?: string;
|
|
11
|
+
callback: EventListenerOrEventListenerObject | null;
|
|
12
|
+
options?: AddEventListenerOptions | boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare interface AppInfo {
|
|
15
|
+
scheme?: URLCandidate;
|
|
16
|
+
fallback?: URLCandidate | (() => any);
|
|
17
|
+
timeout?: number;
|
|
18
|
+
allowWebStore?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
21
|
+
packageName?: string;
|
|
22
|
+
intent?: URLCandidate;
|
|
23
|
+
}
|
|
24
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
25
|
+
universal?: URLCandidate;
|
|
26
|
+
}
|
|
27
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
28
|
+
productId?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
31
|
+
bundleId?: string;
|
|
32
|
+
trackId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare interface AppOpenOptions {
|
|
35
|
+
[OS.Android]?: AndroidAppInfo;
|
|
36
|
+
[OS.iOS]?: IOSAppInfo;
|
|
37
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
38
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
39
|
+
}
|
|
40
|
+
export declare type URLCandidate = URL | string;
|
|
41
|
+
export declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
|
|
42
|
+
export declare type StringifiableSequence = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
|
|
43
|
+
export declare type MessengerOpenOptions = {
|
|
44
|
+
to?: Stringifiable | StringifiableSequence;
|
|
45
|
+
cc?: Stringifiable | StringifiableSequence;
|
|
46
|
+
bcc?: Stringifiable | StringifiableSequence;
|
|
47
|
+
subject?: Stringifiable;
|
|
48
|
+
body?: Stringifiable;
|
|
49
|
+
} | HTMLFormElement | FormData;
|
|
50
|
+
export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
|
|
51
|
+
export declare interface AppModule {
|
|
52
|
+
open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './appModule';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function tryOpenUrl(url: string, index: number, timeout: number): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './platformModule';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Devices, Engines, OS } from '../../../constants/platform';
|
|
2
|
+
export declare interface Platform {
|
|
3
|
+
os: OS;
|
|
4
|
+
device: Devices;
|
|
5
|
+
engine: Engines;
|
|
6
|
+
osVersion: string;
|
|
7
|
+
engineVersion: string;
|
|
8
|
+
renderer: string;
|
|
9
|
+
isWebview: boolean;
|
|
10
|
+
isStandalone: boolean;
|
|
11
|
+
isMobile: boolean;
|
|
12
|
+
isDesktop: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Devices, Engines, OS } from '../../../constants/platform';
|
|
2
|
+
export declare interface PlatformModule {
|
|
3
|
+
os: OS;
|
|
4
|
+
device: Devices;
|
|
5
|
+
engine: Engines;
|
|
6
|
+
osVersion: string;
|
|
7
|
+
engineVersion: string;
|
|
8
|
+
renderer: string;
|
|
9
|
+
isWebview: boolean;
|
|
10
|
+
isStandalone: boolean;
|
|
11
|
+
isMobile: boolean;
|
|
12
|
+
isDesktop: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ListenerEntry } from '../types/themeModule';
|
|
2
|
+
export declare enum Appearances {
|
|
3
|
+
Unknown = "unknown",
|
|
4
|
+
Light = "light",
|
|
5
|
+
Dark = "dark"
|
|
6
|
+
}
|
|
7
|
+
export declare const CHROME_VERSION: number;
|
|
8
|
+
export declare const MEDIA_QUERY_LIST: MediaQueryList;
|
|
9
|
+
export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
|
|
10
|
+
export declare const IS_FULL_SUPPORT_THEME_COLOR: boolean;
|
|
11
|
+
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
12
|
+
export declare const SVG_PIXEL_DATA_URL: string;
|
|
13
|
+
export declare const IS_SAMSUNG: boolean;
|
|
14
|
+
export declare const IS_IE_MOBILE: boolean;
|
|
15
|
+
export declare const IS_WINDOWS_PHONE: boolean;
|
|
16
|
+
export declare const ENTRIES: ListenerEntry[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const EasingError: ErrorConstructor;
|
|
2
|
+
declare const CubicBezierSyntaxError: ErrorConstructor;
|
|
3
|
+
declare const LinearSyntaxError: ErrorConstructor;
|
|
4
|
+
declare const StepSyntaxError: ErrorConstructor;
|
|
5
|
+
declare const UnsupportedEasingFunctionError: ErrorConstructor;
|
|
6
|
+
export { EasingError, CubicBezierSyntaxError, LinearSyntaxError, StepSyntaxError, UnsupportedEasingFunctionError, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type SystemColor = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonHighlight' | 'ButtonShadow' | 'CaptionText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
|
|
2
|
+
export type DeprecatedSystemColor = 'ActiveText' | 'ButtonBorder' | 'ButtonFace' | 'ButtonText' | 'Canvas' | 'CanvasText' | 'Field' | 'FieldText' | 'GrayText' | 'Highlight' | 'HighlightText' | 'LinkText' | 'Mark' | 'MarkText' | 'SelectedItem' | 'SelectedItemText' | 'VisitedText';
|
|
3
|
+
export type NamedColor = 'aliceblue' | 'antiquewhite' | 'aqua' | 'aquamarine' | 'azure' | 'beige' | 'bisque' | 'black' | 'blanchedalmond' | 'blue' | 'blueviolet' | 'brown' | 'burlywood' | 'cadetblue' | 'chartreuse' | 'chocolate' | 'coral' | 'cornflowerblue' | 'cornsilk' | 'crimson' | 'cyan' | 'darkblue' | 'darkcyan' | 'darkgoldenrod' | 'darkgray' | 'darkgreen' | 'darkgrey' | 'darkkhaki' | 'darkmagenta' | 'darkolivegreen' | 'darkorange' | 'darkorchid' | 'darkred' | 'darksalmon' | 'darkseagreen' | 'darkslateblue' | 'darkslategray' | 'darkslategrey' | 'darkturquoise' | 'darkviolet' | 'deeppink' | 'deepskyblue' | 'dimgray' | 'dimgrey' | 'dodgerblue' | 'firebrick' | 'floralwhite' | 'forestgreen' | 'fuchsia' | 'gainsboro' | 'ghostwhite' | 'gold' | 'goldenrod' | 'gray' | 'green' | 'greenyellow' | 'grey' | 'honeydew' | 'hotpink' | 'indianred' | 'indigo' | 'ivory' | 'khaki' | 'lavender' | 'lavenderblush' | 'lawngreen' | 'lemonchiffon' | 'lightblue' | 'lightcoral' | 'lightcyan' | 'lightgoldenrodyellow' | 'lightgray' | 'lightgreen' | 'lightgrey' | 'lightpink' | 'lightsalmon' | 'lightseagreen' | 'lightskyblue' | 'lightslategray' | 'lightslategrey' | 'lightsteelblue' | 'lightyellow' | 'lime' | 'limegreen' | 'linen' | 'magenta' | 'maroon' | 'mediumaquamarine' | 'mediumblue' | 'mediumorchid' | 'mediumpurple' | 'mediumseagreen' | 'mediumslateblue' | 'mediumspringgreen' | 'mediumturquoise' | 'mediumvioletred' | 'midnightblue' | 'mintcream' | 'mistyrose' | 'moccasin' | 'navajowhite' | 'navy' | 'oldlace' | 'olive' | 'olivedrab' | 'orange' | 'orangered' | 'orchid' | 'palegoldenrod' | 'palegreen' | 'paleturquoise' | 'palevioletred' | 'papayawhip' | 'peachpuff' | 'peru' | 'pink' | 'plum' | 'powderblue' | 'purple' | 'rebeccapurple' | 'red' | 'rosybrown' | 'royalblue' | 'saddlebrown' | 'salmon' | 'sandybrown' | 'seagreen' | 'seashell' | 'sienna' | 'silver' | 'skyblue' | 'slateblue' | 'slategray' | 'slategrey' | 'snow' | 'springgreen' | 'steelblue' | 'tan' | 'teal' | 'thistle' | 'tomato' | 'turquoise' | 'violet' | 'wheat' | 'white' | 'whitesmoke' | 'yellow' | 'yellowgreen';
|
|
4
|
+
export type RGBColor = `rgb(${string})`;
|
|
5
|
+
export type RGBAColor = `rgba(${string})`;
|
|
6
|
+
export type HSLColor = `hsl(${string})`;
|
|
7
|
+
export type HSLAColor = `hsla(${string})`;
|
|
8
|
+
export type HEXColor = `#${string}`;
|
|
9
|
+
export type Color = 'currentColor' | 'transparent' | SystemColor | DeprecatedSystemColor | NamedColor | RGBColor | RGBAColor | HSLColor | HSLAColor | HEXColor | string;
|
|
10
|
+
export declare interface RGB {
|
|
11
|
+
red: number;
|
|
12
|
+
green: number;
|
|
13
|
+
blue: number;
|
|
14
|
+
}
|
|
15
|
+
export declare interface RGBA extends RGB {
|
|
16
|
+
alpha: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare interface CubicBezierParams {
|
|
2
|
+
x1: number;
|
|
3
|
+
y1: number;
|
|
4
|
+
x2: number;
|
|
5
|
+
y2: number;
|
|
6
|
+
}
|
|
7
|
+
export declare interface LinearPoint {
|
|
8
|
+
position: number;
|
|
9
|
+
value: number;
|
|
10
|
+
}
|
|
11
|
+
export declare type CubicBezierSyntax = `cubic-bezier(${string})`;
|
|
12
|
+
export declare type LinearSyntax = `linear(${string})`;
|
|
13
|
+
export declare type StepSyntax = `steps(${string})`;
|
|
14
|
+
export declare type EasingSyntax = CubicBezierSyntax | LinearSyntax | StepSyntax;
|
|
15
|
+
export declare type EasingFunction = (t: number) => number;
|
|
16
|
+
export declare type EasingKeyword = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'step-start' | 'step-end';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Appearances } from '../constants/theme';
|
|
2
|
+
import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
+
import type { Color } from '../types/color';
|
|
4
|
+
export declare interface ListenerEntry {
|
|
5
|
+
fn: (appearance: Appearances) => any;
|
|
6
|
+
capture: boolean;
|
|
7
|
+
once: boolean;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export declare interface Theme {
|
|
11
|
+
setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
|
|
12
|
+
getThemeColor: () => Color | undefined;
|
|
13
|
+
removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
|
|
14
|
+
detectAppearance: () => Promise<Appearances>;
|
|
15
|
+
onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
|
|
18
|
+
export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
|
|
19
|
+
export declare interface SetThemeColorOptions {
|
|
20
|
+
appearance?: ThemeColorMetaAppearanceKeys;
|
|
21
|
+
duration?: number;
|
|
22
|
+
easingFunction?: EasingSyntax | EasingKeyword;
|
|
23
|
+
defaultColor?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Appearances } from '../constants/theme';
|
|
2
|
+
import type { EasingKeyword, EasingSyntax } from '../types/easing-syntax';
|
|
3
|
+
import type { Color } from '../types/color';
|
|
4
|
+
export declare interface ListenerEntry {
|
|
5
|
+
fn: (appearance: Appearances) => any;
|
|
6
|
+
capture: boolean;
|
|
7
|
+
once: boolean;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
|
|
11
|
+
export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
|
|
12
|
+
export declare interface SetThemeColorOptions {
|
|
13
|
+
appearance?: ThemeColorMetaAppearanceKeys;
|
|
14
|
+
duration?: number;
|
|
15
|
+
easingFunction?: EasingSyntax | EasingKeyword;
|
|
16
|
+
defaultColor?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare interface ThemeModule {
|
|
19
|
+
setThemeColor: (color: Color, options?: SetThemeColorOptions) => Promise<string | undefined>;
|
|
20
|
+
getThemeColor: () => Color | undefined;
|
|
21
|
+
removeThemeColor: (appearance?: ThemeColorMetaAppearanceKeys) => void;
|
|
22
|
+
detectAppearance: () => Promise<Appearances>;
|
|
23
|
+
onAppearanceChange: (listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions) => () => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './native';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare interface NativePlugin<T> {
|
|
2
|
+
installed: boolean;
|
|
3
|
+
name: string;
|
|
4
|
+
module: T;
|
|
5
|
+
constants: Record<string, any>;
|
|
6
|
+
errors: Record<string, ErrorConstructor>;
|
|
7
|
+
}
|
|
8
|
+
export declare interface NativeBase {
|
|
9
|
+
Version: string;
|
|
10
|
+
Constants: Record<string, any>;
|
|
11
|
+
Errors: Record<string, ErrorConstructor>;
|
|
12
|
+
extends: <T>(plugin: NativePlugin<T>) => Native;
|
|
13
|
+
}
|
|
14
|
+
export declare type Native = NativeBase & Record<Exclude<string, keyof NativeBase>, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function assign(...args: any[]): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createCustomError(name: string, Base?: ErrorConstructor): ErrorConstructor;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum AppOpenState {
|
|
2
|
+
Scheme = 0,
|
|
3
|
+
Universal = 1,
|
|
4
|
+
Intent = 2,
|
|
5
|
+
Fallback = 3,
|
|
6
|
+
Store = 4
|
|
7
|
+
}
|
|
8
|
+
export declare enum Messengers {
|
|
9
|
+
Telephone = "telephone",
|
|
10
|
+
Message = "message",
|
|
11
|
+
Mail = "mail"
|
|
12
|
+
}
|
|
13
|
+
export declare const IS_SUPPORT_INTENT: boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OS } from '../../../constants/platform';
|
|
2
|
+
import { AppOpenState, Messengers } from '../constants/app';
|
|
3
|
+
export declare interface EventListenerUtil {
|
|
4
|
+
useStd: boolean;
|
|
5
|
+
add: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
6
|
+
remove: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
7
|
+
withVender: (target: any, type?: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare interface EventListenerOptions {
|
|
10
|
+
type?: string;
|
|
11
|
+
callback: EventListenerOrEventListenerObject | null;
|
|
12
|
+
options?: AddEventListenerOptions | boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare interface AppInfo {
|
|
15
|
+
scheme?: URLCandidate;
|
|
16
|
+
fallback?: URLCandidate | (() => any);
|
|
17
|
+
timeout?: number;
|
|
18
|
+
allowWebStore?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
21
|
+
packageName?: string;
|
|
22
|
+
intent?: URLCandidate;
|
|
23
|
+
}
|
|
24
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
25
|
+
universal?: URLCandidate;
|
|
26
|
+
}
|
|
27
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
28
|
+
productId?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
31
|
+
bundleId?: string;
|
|
32
|
+
trackId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare interface AppOpenOptions {
|
|
35
|
+
[OS.Android]?: AndroidAppInfo;
|
|
36
|
+
[OS.iOS]?: IOSAppInfo;
|
|
37
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
38
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
39
|
+
}
|
|
40
|
+
export declare type URLCandidate = URL | string;
|
|
41
|
+
export declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
|
|
42
|
+
export declare type StringifiableSequence = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
|
|
43
|
+
export declare type MessengerOpenOptions = {
|
|
44
|
+
to?: Stringifiable | StringifiableSequence;
|
|
45
|
+
cc?: Stringifiable | StringifiableSequence;
|
|
46
|
+
bcc?: Stringifiable | StringifiableSequence;
|
|
47
|
+
subject?: Stringifiable;
|
|
48
|
+
body?: Stringifiable;
|
|
49
|
+
} | HTMLFormElement | FormData;
|
|
50
|
+
export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
|
|
51
|
+
export declare interface App {
|
|
52
|
+
open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OS } from '../../../constants/platform';
|
|
2
|
+
import { AppOpenState, Messengers } from '../constants/app';
|
|
3
|
+
export declare interface EventListenerUtil {
|
|
4
|
+
useStd: boolean;
|
|
5
|
+
add: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
6
|
+
remove: (target: any, eventListenerOptions: EventListenerOptions) => void;
|
|
7
|
+
withVender: (target: any, type?: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare interface EventListenerOptions {
|
|
10
|
+
type?: string;
|
|
11
|
+
callback: EventListenerOrEventListenerObject | null;
|
|
12
|
+
options?: AddEventListenerOptions | boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare interface AppInfo {
|
|
15
|
+
scheme?: URLCandidate;
|
|
16
|
+
fallback?: URLCandidate | (() => any);
|
|
17
|
+
timeout?: number;
|
|
18
|
+
allowWebStore?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
21
|
+
packageName?: string;
|
|
22
|
+
intent?: URLCandidate;
|
|
23
|
+
}
|
|
24
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
25
|
+
universal?: URLCandidate;
|
|
26
|
+
}
|
|
27
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
28
|
+
productId?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
31
|
+
bundleId?: string;
|
|
32
|
+
trackId?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare interface AppOpenOptions {
|
|
35
|
+
[OS.Android]?: AndroidAppInfo;
|
|
36
|
+
[OS.iOS]?: IOSAppInfo;
|
|
37
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
38
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
39
|
+
}
|
|
40
|
+
export declare type URLCandidate = URL | string;
|
|
41
|
+
export declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
|
|
42
|
+
export declare type StringifiableSequence = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
|
|
43
|
+
export declare type MessengerOpenOptions = {
|
|
44
|
+
to?: Stringifiable | StringifiableSequence;
|
|
45
|
+
cc?: Stringifiable | StringifiableSequence;
|
|
46
|
+
bcc?: Stringifiable | StringifiableSequence;
|
|
47
|
+
subject?: Stringifiable;
|
|
48
|
+
body?: Stringifiable;
|
|
49
|
+
} | HTMLFormElement | FormData;
|
|
50
|
+
export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
|
|
51
|
+
export declare interface AppModule {
|
|
52
|
+
open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './appModule';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function tryOpenUrl(url: string, index: number, timeout: number): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './platformModule';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Devices, Engines, OS } from '../../../constants/platform';
|
|
2
|
+
export declare interface Platform {
|
|
3
|
+
os: OS;
|
|
4
|
+
device: Devices;
|
|
5
|
+
engine: Engines;
|
|
6
|
+
osVersion: string;
|
|
7
|
+
engineVersion: string;
|
|
8
|
+
renderer: string;
|
|
9
|
+
isWebview: boolean;
|
|
10
|
+
isStandalone: boolean;
|
|
11
|
+
isMobile: boolean;
|
|
12
|
+
isDesktop: boolean;
|
|
13
|
+
}
|