native-fn 1.0.63 → 1.0.64
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 +2 -2
- package/dist/native.cjs +2 -2
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +2 -2
- package/dist/native.umd.js +2 -2
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +12 -7
- package/dist/plugin/app/index.d.ts +5 -0
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +12 -7
- package/dist/plugin/app/index.umd.js +12 -7
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/app/src/plugin/app/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +6 -1
- package/dist/plugin/app/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/app/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/app/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/app/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/app/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/app/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/app/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/app/src/plugin/theme/constants/index.d.ts +14 -0
- package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/theme/index.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +1 -1
- package/dist/plugin/appearance/index.cjs +764 -0
- package/dist/plugin/appearance/index.d.ts +100 -0
- package/dist/plugin/appearance/index.min.cjs +1 -0
- package/dist/plugin/appearance/index.min.mjs +1 -0
- package/dist/plugin/appearance/index.mjs +762 -0
- package/dist/plugin/appearance/index.umd.js +770 -0
- package/dist/plugin/appearance/index.umd.min.js +1 -0
- package/dist/plugin/appearance/src/constants/platform.d.ts +67 -0
- package/dist/plugin/appearance/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/appearance/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/appearance/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/appearance/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/appearance/src/plugin/app/utils/try-open-url.d.ts +16 -0
- package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/appearance/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/appearance/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/camera/index.d.ts +8 -0
- package/dist/plugin/appearance/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/plugin/appearance/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/appearance/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/appearance/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/appearance/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +17 -0
- package/dist/plugin/appearance/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/theme/constants/index.d.ts +14 -0
- package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/appearance/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/appearance/src/plugin/theme/index.d.ts +17 -0
- package/dist/plugin/appearance/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/appearance/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +23 -0
- package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +24 -0
- package/dist/plugin/appearance/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/appearance/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/appearance/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/appearance/src/types/index.d.ts +1 -0
- package/dist/plugin/appearance/src/types/native.d.ts +27 -0
- package/dist/plugin/appearance/src/types/platform.d.ts +16 -0
- package/dist/plugin/appearance/src/utils/assign.d.ts +1 -0
- package/dist/plugin/appearance/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/appearance/src/utils/create-custom-error.d.ts +6 -0
- package/dist/plugin/appearance/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/appearance/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/appearance/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/appearance/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/appearance/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/camera/index.cjs +3 -3
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +3 -3
- package/dist/plugin/camera/index.umd.js +3 -3
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/camera/src/plugin/app/cores/index.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/app/types/app.d.ts +6 -1
- package/dist/plugin/camera/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/camera/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/camera/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/camera/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/camera/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/camera/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/camera/src/plugin/theme/constants/index.d.ts +14 -0
- package/dist/plugin/camera/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/theme/index.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +1 -1
- package/dist/plugin/clipboard/index.cjs +3 -3
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +3 -3
- package/dist/plugin/clipboard/index.umd.js +3 -3
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +6 -1
- package/dist/plugin/clipboard/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/clipboard/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/clipboard/src/plugin/theme/constants/index.d.ts +14 -0
- package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +1 -1
- package/dist/plugin/fullscreen/index.cjs +322 -327
- package/dist/plugin/fullscreen/index.d.ts +10 -11
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +322 -327
- package/dist/plugin/fullscreen/index.umd.js +322 -327
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +6 -1
- package/dist/plugin/fullscreen/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/fullscreen/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/fullscreen/src/plugin/theme/constants/index.d.ts +14 -0
- package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +3 -3
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +3 -3
- package/dist/plugin/theme/index.umd.js +3 -3
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +6 -1
- package/dist/plugin/theme/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/theme/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/theme/src/plugin/theme/constants/index.d.ts +14 -0
- package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +1 -1
- package/dist/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/src/plugin/app/cores/index.d.ts +3 -0
- package/dist/src/plugin/app/index.d.ts +1 -1
- package/dist/src/plugin/app/types/app.d.ts +6 -1
- package/dist/src/plugin/app/types/index.d.ts +2 -2
- package/dist/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/src/plugin/appearance/index.d.ts +8 -0
- package/dist/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/src/plugin/camera/index.d.ts +1 -1
- package/dist/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/src/plugin/theme/constants/index.d.ts +14 -0
- package/dist/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/src/plugin/theme/index.d.ts +1 -1
- package/dist/src/plugin/theme/types/index.d.ts +1 -1
- package/dist/src/plugin/theme/types/theme.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Appearance=n()}(this,(function(){"use strict";var e;!function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(e||(e={}));var n,o,r,i,a=void 0!==globalThis.matchMedia?globalThis.matchMedia("(prefers-color-scheme: dark)"):{matches:!1,media:"not all",onchange:null,addListener:function(){},removeListener:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!1}},t="not all"!==a.media,s="document"in globalThis?globalThis.document.createElement("canvas").getContext("2d",{willReadFrequently:!0}):null,c=[];!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(n||(n={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(o||(o={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(i||(i={}));var d=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",m=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(d),u=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,f={device:o.Unknown,os:n.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:i.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var o=n.getExtension("WEBGL_debug_renderer_info");return null===o?n.getParameter(n.RENDERER):n.getParameter(o.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:d,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(d)},v=[[/windows nt (6\.[23]); arm/i,n.Windows,b],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,n.Windows,b],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,n.Windows,b],[/windows nt ?([\d.)]*)(?!.+xbox)/i,n.Windows,b],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,n.Windows,b],[/windows ce\/?([\d.]*)/i,n.Windows,b],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,n.iOS,h],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,n.iOS,h],[/cfnetwork\/.+darwin/i,n.iOS,h],[/mac os x ?([\w. ]*)/i,n.MacOS,h],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,n.MacOS,h],[/droid ([\w.]+)\b.+(android[- ]x86)/i,n.Android],[/android\w*[-\/.; ]?([\d.]*)/i,n.Android]],g=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],w=[[/\b(?:crmo|crios)\/([\w.]+)/i,i.Chrome],[/webview.+edge\/([\w.]+)/i,i.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,i.Edge],[/opera mini\/([-\w.]+)/i,i.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,i.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,i.Opera],[/opios[\/ ]+([\w.]+)/i,i.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,i.Opera],[/\bopr\/([\w.]+)/i,i.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,i.IE],[/(?:ms|\()ie ([\w.]+)/i,i.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,i.IE],[/\bfocus\/([\w.]+)/i,i.Firefox],[/\bopt\/([\w.]+)/i,i.Opera],[/coast\/([\w.]+)/i,i.Opera],[/fxios\/([\w.-]+)/i,i.Firefox],[/samsungbrowser\/([\w.]+)/i,i.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,i.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,i.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,i.Chrome],[/chrome\/([\w.]+) mobile/i,i.Chrome],[/chrome\/v?([\w.]+)/i,i.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,i.Safari],[/version\/([\w.,]+) .*safari/i,i.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,i.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,i.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,i.Firefox],[/firefox\/([\w.]+)/i,i.Firefox]];function b(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function h(e){return void 0===e?"":e.replace(/_/g,".")}function p(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function j(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function k(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var T=0;T<v.length;T++){var E=(y=v[T])[0],S=y[1],x=y[2];if(null!==(A=f.userAgent.match(E))){f.os=S,f.osVersion=j(A[1],x);break}}f.os===n.iOS&&0===function(e,n){for(var o=e.split("."),r=n.split("."),i=Math.max(o.length,r.length),a=0;a<i;a++){var t=void 0,s=void 0;if((t=a<o.length?parseInt(o[a],10):0)>(s=a<r.length?parseInt(r[a],10):0))return 1;if(t<s)return-1}return 0}(f.osVersion,"18.6")&&(null!==(M=/\) Version\/([\d.]+)/.exec(f.userAgent))&&parseInt(M[1].substring(0,2),10)>=26&&(f.osVersion=M[1]));for(T=0;T<g.length;T++){E=(y=g[T])[0];var L=y[1];x=y[2];if(null!==(A=f.userAgent.match(E))){f.engine=L,f.engineVersion=j(A[1],x);break}}for(T=0;T<w.length;T++){E=(y=w[T])[0];var y,A,I=y[1];x=y[2];if(null!==(A=f.userAgent.match(E))){f.browser=I,f.browserVersion=j(A[1],x);break}}if(u)try{S=(O=require("react-native").Platform).OS;var M=k(V=""+O.Version);switch(S){case"android":f.os=n.Android,f.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(M,V);break;case"ios":f.os=n.iOS,f.osVersion=V;break;case"windows":f.os=n.Windows,f.osVersion=p(M,V);break;case"macos":f.os=n.MacOS,f.osVersion=V}}catch(e){}if(m)try{var V,O=(S=require("os")).platform();M=k(V=S.release());switch(O){case"win32":f.os=n.Windows,f.osVersion=p(M,V);break;case"darwin":f.os=n.MacOS,f.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(M,V);break;case"android":f.os=n.Android,f.osVersion=V;break;case"linux":/android/i.test(V)&&(f.os=n.Android,f.osVersion=V)}}catch(e){}document.addEventListener("deviceready",(function(){if(f.os===n.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":f.os=n.Android;break;case"iOS":f.os=n.iOS}f.osVersion=globalThis.device.version}}),!1),void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(e){for(var o,r=e.fullVersionList||e.brands||[],i=e.platformVersion,a=0;a<r.length;a++){var t=null==(o=r[a])?{brand:"",version:""}:"string"==typeof o?{brand:o,version:""}:{brand:o.brand,version:o.version},s=t.brand,c=t.version;/not.a.brand/i.test(s)||"Chromium"===s&&(f.engineVersion=c)}"string"==typeof i&&(f.os===n.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?f.osVersion="11":f.osVersion=i)})),f.device=f.os===n.iOS||f.os===n.Android?o.Mobile:f.os===n.Windows||f.os===n.MacOS?o.Desktop:o.Unknown,f.isMobile=f.device===o.Mobile,f.isDesktop=f.device===o.Desktop,f.isStandalone=function(e){return"matchMedia"in globalThis&&(e===n.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(f.os);var W=null,N=null;function U(){return new Promise((function(n){var o=new Image;o.onload=function(){if(null===s)return n(e.Light);s.drawImage(o,0,0);var r=s.getImageData(0,0,1,1).data;(r[0]&r[1]&r[2])<255?n(e.Dark):n(e.Light)},o.onerror=function(){n(e.Unknown)},o.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function C(){return t?a.matches?e.Dark:e.Light:e.Unknown}function D(){try{return require("electron").nativeTheme.shouldUseDarkColors?e.Dark:e.Light}catch(n){return e.Unknown}}function P(n){var o;(o=n.matches?e.Dark:e.Light)!==W&&R(W=o)}function R(e){for(var n=0;n<c.length;n++){var o=c[n];o.fn(e),o.once&&F(o)}}function F(e){var n,o=H(e);-1!==o&&c.splice(o,1),0===c.length&&(f.browser===i.SamsungInternet?(W=null,null!==N&&(clearInterval(N),N=null)):(n=e.capture,W=null,"function"==typeof a.removeEventListener?a.removeEventListener("change",P,n):"function"==typeof a.removeListener&&a.removeListener(P)))}function H(e){for(var n=0;n<c.length;n++)if(c[n].fn===e.fn&&c[n].capture===e.capture)return n;return-1}return{installed:!1,name:"Appearance",module:{get value(){return u?new Promise((function(n){n(function(){try{return require("react-native").Appearance.getColorScheme()||e.Unknown}catch(n){return e.Unknown}}())})):l?new Promise((function(e){e(D())})):f.browser===i.SamsungInternet?U():new Promise((function(e){e(C())}))},set value(e){!function(e){if(u)try{return void require("react-native").Appearance.setColorScheme(e)}catch(e){}if(l)try{return void(require("electron").nativeTheme.themeSource=e||"system")}catch(e){}}(e)},onchange:function(n,o){void 0===o&&(o=!1);if(u)try{var r=require("react-native").Appearance.addChangeListener((function(o){n(o.colorScheme||e.Unknown)}));return function(){r.remove()}}catch(e){}if(l)try{var t=require("electron"),s=function(){n(D())};return void 0!==t.nativeTheme.on&&t.nativeTheme.on("updated",s),function(){void 0!==t.nativeTheme.removeListener&&t.nativeTheme.removeListener("updated",s)}}catch(e){}var d={fn:n,capture:!1,once:!1};"boolean"==typeof o&&(o={capture:o});void 0!==o.capture&&(d.capture=o.capture);void 0!==o.once&&(d.once=o.once);void 0!==o.signal&&(d.signal=o.signal);var m=H(d);-1===m?(c.push(d),1===c.length&&(f.browser===i.SamsungInternet?(U().then((function(e){W=e})),N=globalThis.setInterval((function(){U().then((function(e){e!==W&&(W=e,R(e))}))}),2e3)):(v=d.capture,W=C(),"function"==typeof a.addEventListener?a.addEventListener("change",P,v):"function"==typeof a.addListener&&a.addListener(P))),this.getAppearance().then(R)):c[m].once&&!d.once&&(c[m].once=!1);var v;void 0!==d.signal&&(d.signal.aborted?F(d):d.signal.addEventListener("abort",(function e(){void 0!==d.signal&&d.signal.removeEventListener("abort",e),F(d)})));return function(){F(d)}}},Constants:{Appearances:e},Errors:{}}}));
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PlatformInstance } from "../types/platform";
|
|
2
|
+
declare global {
|
|
3
|
+
var cordova: string | undefined;
|
|
4
|
+
var device: CordovaDevice | undefined;
|
|
5
|
+
interface Navigator {
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
userAgentData?: UserAgentData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface CordovaDevice {
|
|
11
|
+
platform: string;
|
|
12
|
+
version: string;
|
|
13
|
+
}
|
|
14
|
+
interface ModernUserAgentDataBrand {
|
|
15
|
+
brand: string;
|
|
16
|
+
version: string;
|
|
17
|
+
}
|
|
18
|
+
type UserAgentDataBrand = ModernUserAgentDataBrand | string | null | undefined;
|
|
19
|
+
interface UserAgentDataValues {
|
|
20
|
+
brands?: UserAgentDataBrand[];
|
|
21
|
+
fullVersionList?: UserAgentDataBrand[];
|
|
22
|
+
platformVersion?: string | null | undefined;
|
|
23
|
+
}
|
|
24
|
+
interface UserAgentData {
|
|
25
|
+
getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
|
|
26
|
+
}
|
|
27
|
+
export declare enum OS {
|
|
28
|
+
Unknown = "Unknown",
|
|
29
|
+
Android = "Android",
|
|
30
|
+
iOS = "iOS",
|
|
31
|
+
Windows = "Windows",
|
|
32
|
+
MacOS = "MacOS"
|
|
33
|
+
}
|
|
34
|
+
export declare enum Devices {
|
|
35
|
+
Unknown = "Unknown",
|
|
36
|
+
Mobile = "Mobile",
|
|
37
|
+
Desktop = "Desktop"
|
|
38
|
+
}
|
|
39
|
+
export declare enum Engines {
|
|
40
|
+
Unknown = "Unknown",
|
|
41
|
+
EdgeHTML = "EdgeHTML",
|
|
42
|
+
ArkWeb = "ArkWeb",
|
|
43
|
+
Blink = "Blink",
|
|
44
|
+
Presto = "Presto",
|
|
45
|
+
WebKit = "WebKit",
|
|
46
|
+
Trident = "Trident",
|
|
47
|
+
NetFront = "NetFront",
|
|
48
|
+
KHTML = "KHTML",
|
|
49
|
+
Tasman = "Tasman",
|
|
50
|
+
Gecko = "Gecko"
|
|
51
|
+
}
|
|
52
|
+
export declare enum Browsers {
|
|
53
|
+
Unknown = "Unknown",
|
|
54
|
+
Chrome = "Chrome",
|
|
55
|
+
Safari = "Safari",
|
|
56
|
+
Edge = "Edge",
|
|
57
|
+
Firefox = "Firefox",
|
|
58
|
+
Opera = "Opera",
|
|
59
|
+
IE = "IE",
|
|
60
|
+
SamsungInternet = "SamsungInternet"
|
|
61
|
+
}
|
|
62
|
+
export declare const IS_NODE_JS: boolean;
|
|
63
|
+
export declare const IS_ELECTRON: boolean;
|
|
64
|
+
export declare const IS_REACT_NATIVE: boolean;
|
|
65
|
+
export declare let IS_CORDOVA: boolean;
|
|
66
|
+
declare const Platform: PlatformInstance;
|
|
67
|
+
export default Platform;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NativePlugin } from "../../types";
|
|
2
|
+
import type { AppInstance } from "./types";
|
|
3
|
+
import { AppOpenState, MessengerType } from "./constants";
|
|
4
|
+
import { URLOpenError } from "./errors/url-open-error";
|
|
5
|
+
export * from "./types";
|
|
6
|
+
declare const NativeAppPlugin: NativePlugin<'App', AppInstance, {
|
|
7
|
+
AppOpenState: typeof AppOpenState;
|
|
8
|
+
Messengers: typeof MessengerType;
|
|
9
|
+
}, {
|
|
10
|
+
URLOpenError: typeof URLOpenError;
|
|
11
|
+
}>;
|
|
12
|
+
export default NativeAppPlugin;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { OS } from "../../../constants/platform";
|
|
2
|
+
import { AppOpenState, MessengerType } from "../constants";
|
|
3
|
+
export declare interface AppInfo {
|
|
4
|
+
scheme?: URLCandidate;
|
|
5
|
+
fallback?: URLCandidateOrFallback;
|
|
6
|
+
timeout?: number;
|
|
7
|
+
allowAppStore?: boolean;
|
|
8
|
+
allowWebStore?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare interface AndroidAppInfo extends AppInfo {
|
|
11
|
+
packageName?: string;
|
|
12
|
+
intent?: URLCandidate;
|
|
13
|
+
}
|
|
14
|
+
export declare interface IOSAppInfo extends MacOSAppInfo {
|
|
15
|
+
universal?: URLCandidate;
|
|
16
|
+
}
|
|
17
|
+
export declare interface WindowsAppInfo extends AppInfo {
|
|
18
|
+
productId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare interface MacOSAppInfo extends AppInfo {
|
|
21
|
+
bundleId?: string;
|
|
22
|
+
trackId?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare interface StoreInfo {
|
|
25
|
+
appStore?: string;
|
|
26
|
+
webStore?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare interface AppOpenOptions {
|
|
29
|
+
[OS.Android]?: AndroidAppInfo;
|
|
30
|
+
['android']?: AndroidAppInfo;
|
|
31
|
+
[OS.iOS]?: IOSAppInfo;
|
|
32
|
+
['ios']?: IOSAppInfo;
|
|
33
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
34
|
+
['windows']?: WindowsAppInfo;
|
|
35
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
36
|
+
['mac']?: MacOSAppInfo;
|
|
37
|
+
}
|
|
38
|
+
export declare type URLCandidate = URL | string;
|
|
39
|
+
export declare type URLCandidateOrFallback = URLCandidate | (() => any);
|
|
40
|
+
export declare type URLStringOrFallback = string | (() => any);
|
|
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<MessengerType, (options: MessengerOpenOptions) => Promise<void>>;
|
|
51
|
+
export declare interface AppInstance {
|
|
52
|
+
open(options: AppOpenOptions): Promise<AppOpenState>;
|
|
53
|
+
messenger: Messenger;
|
|
54
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./app";
|
|
2
|
+
import type { AppInstance } from "./";
|
|
3
|
+
import { AppOpenState, MessengerType } from "../constants";
|
|
4
|
+
import { URLOpenError } from "../errors/url-open-error";
|
|
5
|
+
declare module 'native-fn' {
|
|
6
|
+
interface NativePlugins {
|
|
7
|
+
App: AppInstance;
|
|
8
|
+
}
|
|
9
|
+
interface NativeConstants {
|
|
10
|
+
AppOpenState: typeof AppOpenState;
|
|
11
|
+
Messengers: typeof MessengerType;
|
|
12
|
+
}
|
|
13
|
+
interface NativeErrors {
|
|
14
|
+
URLOpenError: typeof URLOpenError;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var electronBridge: ElectronShell;
|
|
3
|
+
interface Document {
|
|
4
|
+
webkitVisibilityState?: 'hidden' | 'visible';
|
|
5
|
+
mozVisibilityState?: 'hidden' | 'visible';
|
|
6
|
+
msVisibilityState?: 'hidden' | 'visible';
|
|
7
|
+
webkitHidden?: boolean;
|
|
8
|
+
mozHidden?: boolean;
|
|
9
|
+
msHidden?: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
interface ElectronShell {
|
|
13
|
+
openExternal(url: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export default function tryOpenURL(url: string, index: number, timeout: number): Promise<void>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ListenerEntry } from "../../theme";
|
|
2
|
+
export declare enum Appearances {
|
|
3
|
+
Unknown = "unknown",
|
|
4
|
+
Light = "light",
|
|
5
|
+
Dark = "dark"
|
|
6
|
+
}
|
|
7
|
+
export declare const MEDIA_QUERY_LIST: MediaQueryList;
|
|
8
|
+
export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
|
|
9
|
+
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
10
|
+
export declare const SVG_PIXEL_DATA_URL: string;
|
|
11
|
+
export declare const ENTRIES: ListenerEntry[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NativePlugin } from "../../types";
|
|
2
|
+
import { AppearanceInstance } from "./types";
|
|
3
|
+
import { Appearances } from "./constants";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
declare const NativeAppearancePlugin: NativePlugin<'Appearance', AppearanceInstance, {
|
|
6
|
+
Appearances: typeof Appearances;
|
|
7
|
+
}, {}>;
|
|
8
|
+
export default NativeAppearancePlugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Appearances } from "../constants";
|
|
2
|
+
export declare interface AppearanceInstance {
|
|
3
|
+
get value(): Promise<Appearances>;
|
|
4
|
+
set value(appearances: Exclude<Appearances, Appearances.Unknown>);
|
|
5
|
+
onchange(listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./appearance";
|
|
2
|
+
import type { AppearanceInstance } from "./appearance";
|
|
3
|
+
import { Appearances } from "../constants";
|
|
4
|
+
declare module 'native-fn' {
|
|
5
|
+
interface NativePlugins {
|
|
6
|
+
Appearance: AppearanceInstance;
|
|
7
|
+
}
|
|
8
|
+
interface NativeConstants {
|
|
9
|
+
Appearances: typeof Appearances;
|
|
10
|
+
}
|
|
11
|
+
interface NativeErrors {
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NativePlugin } from "../../types";
|
|
2
|
+
import type { CameraInstance } from "./types";
|
|
3
|
+
import { CameraType } from "./constants/inedx";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
declare const NativeMediaPlugin: NativePlugin<'Camera', CameraInstance, {
|
|
6
|
+
CameraType: typeof CameraType;
|
|
7
|
+
}, {}>;
|
|
8
|
+
export default NativeMediaPlugin;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./camera";
|
|
2
|
+
import type { CameraInstance } from "./camera";
|
|
3
|
+
import { CameraType } from "../constants/inedx";
|
|
4
|
+
declare module 'native-fn' {
|
|
5
|
+
interface NativePlugins {
|
|
6
|
+
Camera: CameraInstance;
|
|
7
|
+
}
|
|
8
|
+
interface NativeConstants {
|
|
9
|
+
CameraType: CameraType;
|
|
10
|
+
}
|
|
11
|
+
interface NativeErrors {
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FullscreenInstance } from "../types";
|
|
2
|
+
declare const Index: FullscreenInstance;
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLVideoElement {
|
|
5
|
+
webkitEnterFullscreen?: () => void;
|
|
6
|
+
webkitExitFullscreen?: () => void;
|
|
7
|
+
webkitSupportsFullscreen?: boolean;
|
|
8
|
+
webkitDisplayingFullscreen?: boolean;
|
|
9
|
+
__fsBridged__?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface Document {
|
|
12
|
+
readonly fullscreenEnabled: boolean;
|
|
13
|
+
fullscreenElement?: Element | null;
|
|
14
|
+
exitFullscreen: () => Promise<void>;
|
|
15
|
+
readonly webkitFullscreenEnabled?: boolean;
|
|
16
|
+
webkitFullscreenElement?: Element | null;
|
|
17
|
+
webkitCurrentFullScreenElement?: Element | null;
|
|
18
|
+
webkitExitFullscreen?: () => Promise<void>;
|
|
19
|
+
webkitCancelFullScreen?: () => Promise<void>;
|
|
20
|
+
readonly mozFullScreenEnabled?: boolean;
|
|
21
|
+
mozFullScreenElement?: Element | null;
|
|
22
|
+
mozCancelFullScreen?: () => Promise<void>;
|
|
23
|
+
readonly msFullscreenEnabled?: boolean;
|
|
24
|
+
msFullscreenElement?: Element | null;
|
|
25
|
+
msExitFullscreen?: () => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
interface Element {
|
|
28
|
+
requestFullscreen: (options?: FullscreenOptions) => Promise<void>;
|
|
29
|
+
webkitRequestFullscreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
30
|
+
webkitRequestFullScreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
31
|
+
mozRequestFullScreen?: () => Promise<void>;
|
|
32
|
+
msRequestFullscreen?: () => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export default Index;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare interface FullscreenInstance {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
element: FullscreenTarget | null;
|
|
4
|
+
isFullscreen: boolean;
|
|
5
|
+
request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
6
|
+
exit(): Promise<void>;
|
|
7
|
+
toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
8
|
+
onchange(handler: (event: Event) => void): () => void;
|
|
9
|
+
onerror(handler: (event: Event) => void): () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare type BrowserWindow = import('electron').BrowserWindow;
|
|
12
|
+
export declare type IsElectron = typeof process extends {
|
|
13
|
+
versions: {
|
|
14
|
+
electron: string;
|
|
15
|
+
};
|
|
16
|
+
} ? true : false;
|
|
17
|
+
export declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ListenerEntry } from "../types";
|
|
2
|
+
export declare enum Appearances {
|
|
3
|
+
Unknown = "unknown",
|
|
4
|
+
Light = "light",
|
|
5
|
+
Dark = "dark"
|
|
6
|
+
}
|
|
7
|
+
export declare const MEDIA_QUERY_LIST: MediaQueryList;
|
|
8
|
+
export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
|
|
9
|
+
export declare const IS_FULL_SUPPORT_THEME_COLOR: boolean;
|
|
10
|
+
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
11
|
+
export declare const SVG_PIXEL_DATA_URL: string;
|
|
12
|
+
export declare const IS_IE_MOBILE: boolean;
|
|
13
|
+
export declare const IS_WINDOWS_PHONE: boolean;
|
|
14
|
+
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
|
+
import type { NativePlugin } from "../../types";
|
|
2
|
+
import type { ThemeInstance } from "./types";
|
|
3
|
+
import { Appearances } from "./constants";
|
|
4
|
+
import { EasingError, UnsupportedEasingFunctionError, StepSyntaxError, LinearSyntaxError, CubicBezierSyntaxError } from "./errors/easing-error";
|
|
5
|
+
import { UnsupportedColorError } from "./errors/unsupported-color-error";
|
|
6
|
+
export * from "./types";
|
|
7
|
+
declare const NativeThemePlugin: NativePlugin<'Theme', ThemeInstance, {
|
|
8
|
+
Appearances: typeof Appearances;
|
|
9
|
+
}, {
|
|
10
|
+
EasingError: typeof EasingError;
|
|
11
|
+
UnsupportedEasingFunctionError: typeof UnsupportedEasingFunctionError;
|
|
12
|
+
StepSyntaxError: typeof StepSyntaxError;
|
|
13
|
+
LinearSyntaxError: typeof LinearSyntaxError;
|
|
14
|
+
CubicBezierSyntaxError: typeof CubicBezierSyntaxError;
|
|
15
|
+
UnsupportedColorError: typeof UnsupportedColorError;
|
|
16
|
+
}>;
|
|
17
|
+
export default NativeThemePlugin;
|
|
@@ -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,23 @@
|
|
|
1
|
+
export * from "./color";
|
|
2
|
+
export * from "./easing-syntax";
|
|
3
|
+
export * from "./theme";
|
|
4
|
+
import type { ThemeInstance } from "./theme";
|
|
5
|
+
import { Appearances } from "../constants";
|
|
6
|
+
import { UnsupportedColorError } from "../errors/unsupported-color-error";
|
|
7
|
+
import { CubicBezierSyntaxError, EasingError, LinearSyntaxError, StepSyntaxError, UnsupportedEasingFunctionError } from "../errors/easing-error";
|
|
8
|
+
declare module 'native-fn' {
|
|
9
|
+
interface NativePlugins {
|
|
10
|
+
Theme: ThemeInstance;
|
|
11
|
+
}
|
|
12
|
+
interface NativeConstants {
|
|
13
|
+
Appearances: typeof Appearances;
|
|
14
|
+
}
|
|
15
|
+
interface NativeErrors {
|
|
16
|
+
EasingError: typeof EasingError;
|
|
17
|
+
UnsupportedEasingFunctionError: typeof UnsupportedEasingFunctionError;
|
|
18
|
+
StepSyntaxError: typeof StepSyntaxError;
|
|
19
|
+
LinearSyntaxError: typeof LinearSyntaxError;
|
|
20
|
+
CubicBezierSyntaxError: typeof CubicBezierSyntaxError;
|
|
21
|
+
UnsupportedColorError: typeof UnsupportedColorError;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Appearances } from "../constants";
|
|
2
|
+
import type { EasingKeyword, EasingSyntax, Color } from "../types";
|
|
3
|
+
export declare interface ListenerEntry {
|
|
4
|
+
fn: (appearance: Appearances) => any;
|
|
5
|
+
capture: boolean;
|
|
6
|
+
once: boolean;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
|
|
10
|
+
export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
|
|
11
|
+
export declare interface SetThemeColorOptions {
|
|
12
|
+
appearance?: ThemeColorMetaAppearanceKeys;
|
|
13
|
+
duration?: number;
|
|
14
|
+
easingFunction?: EasingSyntax | EasingKeyword;
|
|
15
|
+
defaultColor?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare interface ThemeInstance {
|
|
18
|
+
setThemeColor(color: Color, options?: SetThemeColorOptions): Promise<string | undefined>;
|
|
19
|
+
getThemeColor(): Color | undefined;
|
|
20
|
+
removeThemeColor(appearance?: ThemeColorMetaAppearanceKeys): void;
|
|
21
|
+
getAppearance(): Promise<Appearances>;
|
|
22
|
+
setAppearance(appearances?: Exclude<Appearances, Appearances.Unknown>): void;
|
|
23
|
+
onAppearanceChange(listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare interface EventListenerUtil {
|
|
2
|
+
useStd: boolean;
|
|
3
|
+
add<T extends EventTarget | undefined, E extends Event = Event>(target: T, eventListenerOptions: EventListenerOptions<NonNullable<T>, E>): void;
|
|
4
|
+
remove<T extends EventTarget | undefined, E extends Event = Event>(target: T, eventListenerOptions: EventListenerOptions<NonNullable<T>, E>): void;
|
|
5
|
+
withVender(target: any, type?: string): string;
|
|
6
|
+
}
|
|
7
|
+
export declare interface EventListenerOptions<T extends EventTarget = EventTarget, E extends Event = Event> {
|
|
8
|
+
type?: string | undefined;
|
|
9
|
+
callback: ((this: T, event: E) => void) | EventListenerObject | null;
|
|
10
|
+
options?: AddEventListenerOptions | boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./native";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PluginNotExtendedError } from "../errors/plugin-not-extended-error";
|
|
2
|
+
export interface NativePlugins {
|
|
3
|
+
}
|
|
4
|
+
export interface NativeConstants extends Record<string, any> {
|
|
5
|
+
}
|
|
6
|
+
export interface NativeErrors extends Record<string, ErrorConstructor> {
|
|
7
|
+
PluginNotExtendedError: typeof PluginNotExtendedError;
|
|
8
|
+
}
|
|
9
|
+
export declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
|
|
10
|
+
installed: boolean;
|
|
11
|
+
name: Key;
|
|
12
|
+
module: Module;
|
|
13
|
+
Constants: Constants;
|
|
14
|
+
Errors: Errors;
|
|
15
|
+
}
|
|
16
|
+
export type ExtendedNativeBase<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = NativeBase<NativePlugins & {
|
|
17
|
+
[Plugin in Key]: Module;
|
|
18
|
+
}, NativeConstants & Constants, NativeErrors & Errors>;
|
|
19
|
+
export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
|
|
20
|
+
Version: string;
|
|
21
|
+
Constants: AssignedConstants;
|
|
22
|
+
Errors: AssignedErrors;
|
|
23
|
+
extends: <Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(this: NativeBase<Plugins, AssignedConstants, AssignedErrors>, plugin: NativePlugin<Key, Module, Constants, Errors>) => NativeBase<Plugins & {
|
|
24
|
+
[Plugin in Key]: Module;
|
|
25
|
+
}, AssignedConstants & Constants, AssignedErrors & Errors>;
|
|
26
|
+
} & NativePlugins;
|
|
27
|
+
export type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
|