@utsp/types 0.13.0 → 0.14.0-nightly.20251221141916.9580af2
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/dist/index.cjs +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var ii=(t,e,c)=>e in t?A(t,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[e]=c;var o=(t,e)=>A(t,"name",{value:e,configurable:!0});var ei=(t,e)=>{for(var c in e)A(t,c,{get:e[c],enumerable:!0})},ri=(t,e,c,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of K(e))!I.call(t,m)&&m!==c&&A(t,m,{get:()=>e[m],enumerable:!(f=p(e,m))||f.enumerable});return t};var ti=t=>ri(A({},"__esModule",{value:!0}),t);var w=(t,e,c)=>(ii(t,typeof e!="symbol"?e+"":e,c),c);var hi={};ei(hi,{GRID_DEFAULTS:()=>ni,GamepadInput:()=>z,InputDeviceType:()=>u,KeyboardInput:()=>D,MouseInput:()=>S,NetworkState:()=>b,POST_PROCESS_DEFAULTS:()=>si,ScalingMode:()=>T,ScalingModeValue:()=>_,TVRemoteInput:()=>B,TouchInput:()=>P,Vector2:()=>k,Vector3:()=>C,createInputDescriptor:()=>j,deserializeInputDescriptor:()=>G,gamepadAxisIndexToInput:()=>H,gamepadButtonIndexToInput:()=>F,getTouchXAxis:()=>$,getTouchYAxis:()=>O,inputDescriptorToString:()=>y,isAxis:()=>J,isButton:()=>E,isGamepadAxis:()=>X,isGamepadButton:()=>v,isMouseAxis:()=>Y,isMouseButton:()=>N,isTVRemoteAxis:()=>Z,isTVRemoteButton:()=>W,isTouchButton:()=>q,isTouchGesture:()=>Q,isTouchPosition:()=>U,keyCodeToKeyboardInput:()=>M,keyboardInputToKeyCode:()=>L,parseInputDescriptor:()=>V,scalingModeToValue:()=>ci,serializeInputDescriptor:()=>d,valueToScalingMode:()=>oi});module.exports=ti(hi);var u=(a=>(a[a.Keyboard=0]="Keyboard",a[a.Mouse=1]="Mouse",a[a.Gamepad=2]="Gamepad",a[a.Touch=3]="Touch",a[a.TVRemote=4]="TVRemote",a[a.TextInput=5]="TextInput",a[a.Motion=6]="Motion",a))(u||{});var D=(i=>(i[i.KeyA=0]="KeyA",i[i.KeyB=1]="KeyB",i[i.KeyC=2]="KeyC",i[i.KeyD=3]="KeyD",i[i.KeyE=4]="KeyE",i[i.KeyF=5]="KeyF",i[i.KeyG=6]="KeyG",i[i.KeyH=7]="KeyH",i[i.KeyI=8]="KeyI",i[i.KeyJ=9]="KeyJ",i[i.KeyK=10]="KeyK",i[i.KeyL=11]="KeyL",i[i.KeyM=12]="KeyM",i[i.KeyN=13]="KeyN",i[i.KeyO=14]="KeyO",i[i.KeyP=15]="KeyP",i[i.KeyQ=16]="KeyQ",i[i.KeyR=17]="KeyR",i[i.KeyS=18]="KeyS",i[i.KeyT=19]="KeyT",i[i.KeyU=20]="KeyU",i[i.KeyV=21]="KeyV",i[i.KeyW=22]="KeyW",i[i.KeyX=23]="KeyX",i[i.KeyY=24]="KeyY",i[i.KeyZ=25]="KeyZ",i[i.Digit0=26]="Digit0",i[i.Digit1=27]="Digit1",i[i.Digit2=28]="Digit2",i[i.Digit3=29]="Digit3",i[i.Digit4=30]="Digit4",i[i.Digit5=31]="Digit5",i[i.Digit6=32]="Digit6",i[i.Digit7=33]="Digit7",i[i.Digit8=34]="Digit8",i[i.Digit9=35]="Digit9",i[i.ArrowUp=36]="ArrowUp",i[i.ArrowDown=37]="ArrowDown",i[i.ArrowLeft=38]="ArrowLeft",i[i.ArrowRight=39]="ArrowRight",i[i.Space=40]="Space",i[i.Enter=41]="Enter",i[i.Escape=42]="Escape",i[i.Backspace=43]="Backspace",i[i.Tab=44]="Tab",i[i.ShiftLeft=45]="ShiftLeft",i[i.ShiftRight=46]="ShiftRight",i[i.ControlLeft=47]="ControlLeft",i[i.ControlRight=48]="ControlRight",i[i.AltLeft=49]="AltLeft",i[i.AltRight=50]="AltRight",i[i.MetaLeft=51]="MetaLeft",i[i.MetaRight=52]="MetaRight",i[i.CapsLock=53]="CapsLock",i[i.Delete=54]="Delete",i[i.Insert=55]="Insert",i[i.Home=56]="Home",i[i.End=57]="End",i[i.PageUp=58]="PageUp",i[i.PageDown=59]="PageDown",i[i.F1=60]="F1",i[i.F2=61]="F2",i[i.F3=62]="F3",i[i.F4=63]="F4",i[i.F5=64]="F5",i[i.F6=65]="F6",i[i.F7=66]="F7",i[i.F8=67]="F8",i[i.F9=68]="F9",i[i.F10=69]="F10",i[i.F11=70]="F11",i[i.F12=71]="F12",i[i.Minus=72]="Minus",i[i.Equal=73]="Equal",i[i.BracketLeft=74]="BracketLeft",i[i.BracketRight=75]="BracketRight",i[i.Backslash=76]="Backslash",i[i.Semicolon=77]="Semicolon",i[i.Quote=78]="Quote",i[i.Comma=79]="Comma",i[i.Period=80]="Period",i[i.Slash=81]="Slash",i[i.Backquote=82]="Backquote",i[i.Numpad0=91]="Numpad0",i[i.Numpad1=92]="Numpad1",i[i.Numpad2=93]="Numpad2",i[i.Numpad3=94]="Numpad3",i[i.Numpad4=95]="Numpad4",i[i.Numpad5=96]="Numpad5",i[i.Numpad6=97]="Numpad6",i[i.Numpad7=98]="Numpad7",i[i.Numpad8=99]="Numpad8",i[i.Numpad9=100]="Numpad9",i[i.NumpadAdd=101]="NumpadAdd",i[i.NumpadSubtract=102]="NumpadSubtract",i[i.NumpadMultiply=103]="NumpadMultiply",i[i.NumpadDivide=104]="NumpadDivide",i[i.NumpadDecimal=105]="NumpadDecimal",i[i.NumpadEnter=106]="NumpadEnter",i[i.NumLock=107]="NumLock",i[i.PrintScreen=111]="PrintScreen",i[i.ScrollLock=112]="ScrollLock",i[i.Pause=113]="Pause",i[i.ContextMenu=114]="ContextMenu",i))(D||{});function M(t){let e=D[t];return e!==void 0?e:null}o(M,"keyCodeToKeyboardInput");function L(t){return D[t]}o(L,"keyboardInputToKeyCode");var S=(l=>(l[l.LeftButton=0]="LeftButton",l[l.MiddleButton=1]="MiddleButton",l[l.RightButton=2]="RightButton",l[l.Button4=3]="Button4",l[l.Button5=4]="Button5",l[l.PositionX=100]="PositionX",l[l.PositionY=101]="PositionY",l[l.DeltaX=102]="DeltaX",l[l.DeltaY=103]="DeltaY",l[l.WheelDeltaY=104]="WheelDeltaY",l[l.WheelDeltaX=105]="WheelDeltaX",l))(S||{});function N(t){return t<100}o(N,"isMouseButton");function Y(t){return t>=100}o(Y,"isMouseAxis");var z=(n=>(n[n.ButtonA=0]="ButtonA",n[n.ButtonB=1]="ButtonB",n[n.ButtonX=2]="ButtonX",n[n.ButtonY=3]="ButtonY",n[n.LeftShoulder=4]="LeftShoulder",n[n.RightShoulder=5]="RightShoulder",n[n.LeftTrigger=6]="LeftTrigger",n[n.RightTrigger=7]="RightTrigger",n[n.Select=8]="Select",n[n.Start=9]="Start",n[n.LeftStick=10]="LeftStick",n[n.RightStick=11]="RightStick",n[n.DPadUp=12]="DPadUp",n[n.DPadDown=13]="DPadDown",n[n.DPadLeft=14]="DPadLeft",n[n.DPadRight=15]="DPadRight",n[n.Home=16]="Home",n[n.Touchpad=17]="Touchpad",n[n.LeftStickX=100]="LeftStickX",n[n.LeftStickY=101]="LeftStickY",n[n.RightStickX=102]="RightStickX",n[n.RightStickY=103]="RightStickY",n[n.LeftTriggerAxis=104]="LeftTriggerAxis",n[n.RightTriggerAxis=105]="RightTriggerAxis",n))(z||{});function v(t){return t<100}o(v,"isGamepadButton");function X(t){return t>=100}o(X,"isGamepadAxis");function F(t){return t>=0&&t<=19?t:null}o(F,"gamepadButtonIndexToInput");function H(t){return{0:100,1:101,2:102,3:103}[t]??null}o(H,"gamepadAxisIndexToInput");var P=(s=>(s[s.Touch0=0]="Touch0",s[s.Touch1=1]="Touch1",s[s.Touch2=2]="Touch2",s[s.Touch3=3]="Touch3",s[s.Touch4=4]="Touch4",s[s.Touch5=5]="Touch5",s[s.Touch6=6]="Touch6",s[s.Touch7=7]="Touch7",s[s.Touch8=8]="Touch8",s[s.Touch9=9]="Touch9",s[s.Touch0X=100]="Touch0X",s[s.Touch0Y=101]="Touch0Y",s[s.Touch1X=102]="Touch1X",s[s.Touch1Y=103]="Touch1Y",s[s.Touch2X=104]="Touch2X",s[s.Touch2Y=105]="Touch2Y",s[s.Touch3X=106]="Touch3X",s[s.Touch3Y=107]="Touch3Y",s[s.Touch4X=108]="Touch4X",s[s.Touch4Y=109]="Touch4Y",s[s.Touch5X=110]="Touch5X",s[s.Touch5Y=111]="Touch5Y",s[s.Touch6X=112]="Touch6X",s[s.Touch6Y=113]="Touch6Y",s[s.Touch7X=114]="Touch7X",s[s.Touch7Y=115]="Touch7Y",s[s.Touch8X=116]="Touch8X",s[s.Touch8Y=117]="Touch8Y",s[s.Touch9X=118]="Touch9X",s[s.Touch9Y=119]="Touch9Y",s[s.PinchScale=200]="PinchScale",s[s.RotationAngle=201]="RotationAngle",s[s.SwipeVelocityX=202]="SwipeVelocityX",s[s.SwipeVelocityY=203]="SwipeVelocityY",s))(P||{});function q(t){return t<100}o(q,"isTouchButton");function U(t){return t>=100&&t<200}o(U,"isTouchPosition");function Q(t){return t>=200}o(Q,"isTouchGesture");function $(t){return t<0||t>9?null:100+t*2}o($,"getTouchXAxis");function O(t){return t<0||t>9?null:101+t*2}o(O,"getTouchYAxis");var B=(r=>(r[r.DPadUp=0]="DPadUp",r[r.DPadDown=1]="DPadDown",r[r.DPadLeft=2]="DPadLeft",r[r.DPadRight=3]="DPadRight",r[r.DPadCenter=4]="DPadCenter",r[r.Play=5]="Play",r[r.Pause=6]="Pause",r[r.PlayPause=7]="PlayPause",r[r.Stop=8]="Stop",r[r.Rewind=9]="Rewind",r[r.FastForward=10]="FastForward",r[r.Previous=11]="Previous",r[r.Next=12]="Next",r[r.Record=13]="Record",r[r.VolumeUp=15]="VolumeUp",r[r.VolumeDown=16]="VolumeDown",r[r.Mute=17]="Mute",r[r.ChannelUp=18]="ChannelUp",r[r.ChannelDown=19]="ChannelDown",r[r.Back=20]="Back",r[r.Home=21]="Home",r[r.Menu=22]="Menu",r[r.Info=23]="Info",r[r.Guide=24]="Guide",r[r.Exit=25]="Exit",r[r.Red=30]="Red",r[r.Green=31]="Green",r[r.Yellow=32]="Yellow",r[r.Blue=33]="Blue",r[r.Digit0=40]="Digit0",r[r.Digit1=41]="Digit1",r[r.Digit2=42]="Digit2",r[r.Digit3=43]="Digit3",r[r.Digit4=44]="Digit4",r[r.Digit5=45]="Digit5",r[r.Digit6=46]="Digit6",r[r.Digit7=47]="Digit7",r[r.Digit8=48]="Digit8",r[r.Digit9=49]="Digit9",r[r.Input=50]="Input",r[r.Settings=51]="Settings",r[r.Subtitle=52]="Subtitle",r[r.Audio=53]="Audio",r[r.Power=54]="Power",r[r.PointerX=100]="PointerX",r[r.PointerY=101]="PointerY",r[r.GyroX=102]="GyroX",r[r.GyroY=103]="GyroY",r[r.GyroZ=104]="GyroZ",r))(B||{});function W(t){return t<100}o(W,"isTVRemoteButton");function Z(t){return t>=100}o(Z,"isTVRemoteAxis");function j(t,e){return{device:t,input:e}}o(j,"createInputDescriptor");function E(t){switch(t.device){case 0:return!0;case 1:return t.input<100;case 2:return t.input<100;case 3:return t.input<100;case 4:return t.input<100;default:return!1}}o(E,"isButton");function J(t){return!E(t)}o(J,"isAxis");function d(t){let e=new Uint8Array(3);return e[0]=t.device,e[1]=t.input&255,e[2]=t.input>>8&255,e}o(d,"serializeInputDescriptor");function G(t,e=0){let c=t[e],f=t[e+1]|t[e+2]<<8;return{device:c,input:f}}o(G,"deserializeInputDescriptor");function y(t){let e=u[t.device],c;switch(t.device){case 0:c=D[t.input];break;case 1:c=S[t.input];break;case 2:c=z[t.input];break;case 3:c=P[t.input];break;case 4:c=B[t.input];break;default:c="Unknown"}return`${e}:${c}`}o(y,"inputDescriptorToString");function V(t){let[e,c]=t.split(":");if(!e||!c)return null;let f=Object.entries(u).find(([h,R])=>h.toLowerCase()===e.toLowerCase()&&typeof R=="number")?.[1];if(f===void 0)return null;let m;switch(f){case 0:m=D[c];break;case 1:m=S[c];break;case 2:m=z[c];break;case 3:m=P[c];break;case 4:m=B[c];break}return m===void 0?null:{device:f,input:m}}o(V,"parseInputDescriptor");var g=class g{constructor(e=0,c=0){w(this,"x");w(this,"y");this.x=e,this.y=c}static zero(){return new g(0,0)}static one(){return new g(1,1)}static up(){return new g(0,-1)}static down(){return new g(0,1)}static left(){return new g(-1,0)}static right(){return new g(1,0)}add(e){return new g(this.x+e.x,this.y+e.y)}subtract(e){return new g(this.x-e.x,this.y-e.y)}multiply(e){return new g(this.x*e,this.y*e)}divide(e){if(e===0)throw new Error("Division by zero");return new g(this.x/e,this.y/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){let e=this.length();return e===0?g.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}angle(){return Math.atan2(this.y,this.x)}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}rotate(e){let c=Math.cos(e),f=Math.sin(e);return new g(this.x*c-this.y*f,this.x*f+this.y*c)}lerp(e,c){return new g(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c)}clone(){return new g(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}toString(){return`Vector2(${this.x}, ${this.y})`}toArray(){return[this.x,this.y]}set(e,c){return this.x=e,this.y=c,this}copy(e){return this.x=e.x,this.y=e.y,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0):(this.x/=e,this.y/=e),this}};o(g,"Vector2");var k=g;var x=class x{constructor(e=0,c=0,f=0){w(this,"x");w(this,"y");w(this,"z");this.x=e,this.y=c,this.z=f}static zero(){return new x(0,0,0)}static one(){return new x(1,1,1)}static up(){return new x(0,1,0)}static down(){return new x(0,-1,0)}static left(){return new x(-1,0,0)}static right(){return new x(1,0,0)}static forward(){return new x(0,0,1)}static back(){return new x(0,0,-1)}add(e){return new x(this.x+e.x,this.y+e.y,this.z+e.z)}subtract(e){return new x(this.x-e.x,this.y-e.y,this.z-e.z)}multiply(e){return new x(this.x*e,this.y*e,this.z*e)}divide(e){if(e===0)throw new Error("Division by zero");return new x(this.x/e,this.y/e,this.z/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z}normalize(){let e=this.length();return e===0?x.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){return new x(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}lerp(e,c){return new x(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c,this.z+(e.z-this.z)*c)}clone(){return new x(this.x,this.y,this.z)}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}toString(){return`Vector3(${this.x}, ${this.y}, ${this.z})`}toArray(){return[this.x,this.y,this.z]}set(e,c,f){return this.x=e,this.y=c,this.z=f,this}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this.z/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0,this.z=0):(this.x/=e,this.y/=e,this.z/=e),this}};o(x,"Vector3");var C=x;var si={scanlines:{opacity:.15,pattern:"horizontal",spacing:2,thickness:1,color:{r:0,g:0,b:0}},ambientEffect:{blur:30,scale:1.3,opacity:.7}},ni={color:"rgba(144, 24, 24, 1)",lineWidth:1};var T=(h=>(h.None="none",h.Eighth="eighth",h.Quarter="quarter",h.Half="half",h.Integer="integer",h))(T||{}),_=(h=>(h[h.None=0]="None",h[h.Eighth=1]="Eighth",h[h.Quarter=2]="Quarter",h[h.Half=3]="Half",h[h.Integer=4]="Integer",h))(_||{});function ci(t){switch(t){case"none":return 0;case"eighth":return 1;case"quarter":return 2;case"half":return 3;case"integer":return 4;default:return 0}}o(ci,"scalingModeToValue");function oi(t){switch(t){case 0:return"none";case 1:return"eighth";case 2:return"quarter";case 3:return"half";case 4:return"integer";default:return"none"}}o(oi,"valueToScalingMode");var b=(h=>(h[h.Disconnected=0]="Disconnected",h[h.Connecting=1]="Connecting",h[h.Connected=2]="Connected",h[h.Reconnecting=3]="Reconnecting",h[h.Error=4]="Error",h))(b||{});
|
|
1
|
+
"use strict";var k=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var ii=(t,e,c)=>e in t?k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[e]=c;var o=(t,e)=>k(t,"name",{value:e,configurable:!0});var ei=(t,e)=>{for(var c in e)k(t,c,{get:e[c],enumerable:!0})},ri=(t,e,c,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of K(e))!I.call(t,m)&&m!==c&&k(t,m,{get:()=>e[m],enumerable:!(f=p(e,m))||f.enumerable});return t};var ti=t=>ri(k({},"__esModule",{value:!0}),t);var w=(t,e,c)=>(ii(t,typeof e!="symbol"?e+"":e,c),c);var hi={};ei(hi,{GRID_DEFAULTS:()=>ni,GamepadInput:()=>P,InputDeviceType:()=>S,KeyboardInput:()=>u,MouseInput:()=>z,NetworkState:()=>R,POST_PROCESS_DEFAULTS:()=>si,ScalingMode:()=>_,ScalingModeValue:()=>b,TVRemoteInput:()=>A,TouchInput:()=>B,Vector2:()=>C,Vector3:()=>E,createInputDescriptor:()=>J,deserializeInputDescriptor:()=>y,gamepadAxisIndexToInput:()=>q,gamepadButtonIndexToInput:()=>F,getTouchXAxis:()=>W,getTouchYAxis:()=>O,inputDescriptorToString:()=>V,isAxis:()=>d,isButton:()=>M,isGamepadAxis:()=>H,isGamepadButton:()=>X,isMouseAxis:()=>Y,isMouseButton:()=>N,isTVRemoteAxis:()=>j,isTVRemoteButton:()=>Z,isTouchButton:()=>U,isTouchGesture:()=>$,isTouchPosition:()=>Q,keyCodeToKeyboardInput:()=>v,keyboardInputToKeyCode:()=>L,parseInputDescriptor:()=>T,scalingModeToValue:()=>ci,serializeInputDescriptor:()=>G,valueToScalingMode:()=>oi});module.exports=ti(hi);var S=(a=>(a[a.Keyboard=0]="Keyboard",a[a.Mouse=1]="Mouse",a[a.Gamepad=2]="Gamepad",a[a.Touch=3]="Touch",a[a.TVRemote=4]="TVRemote",a[a.TextInput=5]="TextInput",a[a.Motion=6]="Motion",a))(S||{});var u=(i=>(i[i.KeyA=0]="KeyA",i[i.KeyB=1]="KeyB",i[i.KeyC=2]="KeyC",i[i.KeyD=3]="KeyD",i[i.KeyE=4]="KeyE",i[i.KeyF=5]="KeyF",i[i.KeyG=6]="KeyG",i[i.KeyH=7]="KeyH",i[i.KeyI=8]="KeyI",i[i.KeyJ=9]="KeyJ",i[i.KeyK=10]="KeyK",i[i.KeyL=11]="KeyL",i[i.KeyM=12]="KeyM",i[i.KeyN=13]="KeyN",i[i.KeyO=14]="KeyO",i[i.KeyP=15]="KeyP",i[i.KeyQ=16]="KeyQ",i[i.KeyR=17]="KeyR",i[i.KeyS=18]="KeyS",i[i.KeyT=19]="KeyT",i[i.KeyU=20]="KeyU",i[i.KeyV=21]="KeyV",i[i.KeyW=22]="KeyW",i[i.KeyX=23]="KeyX",i[i.KeyY=24]="KeyY",i[i.KeyZ=25]="KeyZ",i[i.Digit0=26]="Digit0",i[i.Digit1=27]="Digit1",i[i.Digit2=28]="Digit2",i[i.Digit3=29]="Digit3",i[i.Digit4=30]="Digit4",i[i.Digit5=31]="Digit5",i[i.Digit6=32]="Digit6",i[i.Digit7=33]="Digit7",i[i.Digit8=34]="Digit8",i[i.Digit9=35]="Digit9",i[i.ArrowUp=36]="ArrowUp",i[i.ArrowDown=37]="ArrowDown",i[i.ArrowLeft=38]="ArrowLeft",i[i.ArrowRight=39]="ArrowRight",i[i.Space=40]="Space",i[i.Enter=41]="Enter",i[i.Escape=42]="Escape",i[i.Backspace=43]="Backspace",i[i.Tab=44]="Tab",i[i.ShiftLeft=45]="ShiftLeft",i[i.ShiftRight=46]="ShiftRight",i[i.ControlLeft=47]="ControlLeft",i[i.ControlRight=48]="ControlRight",i[i.AltLeft=49]="AltLeft",i[i.AltRight=50]="AltRight",i[i.MetaLeft=51]="MetaLeft",i[i.MetaRight=52]="MetaRight",i[i.CapsLock=53]="CapsLock",i[i.Delete=54]="Delete",i[i.Insert=55]="Insert",i[i.Home=56]="Home",i[i.End=57]="End",i[i.PageUp=58]="PageUp",i[i.PageDown=59]="PageDown",i[i.F1=60]="F1",i[i.F2=61]="F2",i[i.F3=62]="F3",i[i.F4=63]="F4",i[i.F5=64]="F5",i[i.F6=65]="F6",i[i.F7=66]="F7",i[i.F8=67]="F8",i[i.F9=68]="F9",i[i.F10=69]="F10",i[i.F11=70]="F11",i[i.F12=71]="F12",i[i.Minus=72]="Minus",i[i.Equal=73]="Equal",i[i.BracketLeft=74]="BracketLeft",i[i.BracketRight=75]="BracketRight",i[i.Backslash=76]="Backslash",i[i.Semicolon=77]="Semicolon",i[i.Quote=78]="Quote",i[i.Comma=79]="Comma",i[i.Period=80]="Period",i[i.Slash=81]="Slash",i[i.Backquote=82]="Backquote",i[i.Numpad0=91]="Numpad0",i[i.Numpad1=92]="Numpad1",i[i.Numpad2=93]="Numpad2",i[i.Numpad3=94]="Numpad3",i[i.Numpad4=95]="Numpad4",i[i.Numpad5=96]="Numpad5",i[i.Numpad6=97]="Numpad6",i[i.Numpad7=98]="Numpad7",i[i.Numpad8=99]="Numpad8",i[i.Numpad9=100]="Numpad9",i[i.NumpadAdd=101]="NumpadAdd",i[i.NumpadSubtract=102]="NumpadSubtract",i[i.NumpadMultiply=103]="NumpadMultiply",i[i.NumpadDivide=104]="NumpadDivide",i[i.NumpadDecimal=105]="NumpadDecimal",i[i.NumpadEnter=106]="NumpadEnter",i[i.NumLock=107]="NumLock",i[i.PrintScreen=111]="PrintScreen",i[i.ScrollLock=112]="ScrollLock",i[i.Pause=113]="Pause",i[i.ContextMenu=114]="ContextMenu",i))(u||{});function v(t){let e=u[t];return e!==void 0?e:null}o(v,"keyCodeToKeyboardInput");function L(t){return u[t]}o(L,"keyboardInputToKeyCode");var z=(h=>(h[h.LeftButton=0]="LeftButton",h[h.MiddleButton=1]="MiddleButton",h[h.RightButton=2]="RightButton",h[h.Button4=3]="Button4",h[h.Button5=4]="Button5",h[h.PositionX=100]="PositionX",h[h.PositionY=101]="PositionY",h[h.DeltaX=102]="DeltaX",h[h.DeltaY=103]="DeltaY",h[h.WheelDeltaY=104]="WheelDeltaY",h[h.WheelDeltaX=105]="WheelDeltaX",h))(z||{});function N(t){return t<100}o(N,"isMouseButton");function Y(t){return t>=100}o(Y,"isMouseAxis");var P=(n=>(n[n.ButtonA=0]="ButtonA",n[n.ButtonB=1]="ButtonB",n[n.ButtonX=2]="ButtonX",n[n.ButtonY=3]="ButtonY",n[n.LeftShoulder=4]="LeftShoulder",n[n.RightShoulder=5]="RightShoulder",n[n.LeftTrigger=6]="LeftTrigger",n[n.RightTrigger=7]="RightTrigger",n[n.Select=8]="Select",n[n.Start=9]="Start",n[n.LeftStick=10]="LeftStick",n[n.RightStick=11]="RightStick",n[n.DPadUp=12]="DPadUp",n[n.DPadDown=13]="DPadDown",n[n.DPadLeft=14]="DPadLeft",n[n.DPadRight=15]="DPadRight",n[n.Home=16]="Home",n[n.Touchpad=17]="Touchpad",n[n.LeftStickX=100]="LeftStickX",n[n.LeftStickY=101]="LeftStickY",n[n.RightStickX=102]="RightStickX",n[n.RightStickY=103]="RightStickY",n[n.LeftTriggerAxis=104]="LeftTriggerAxis",n[n.RightTriggerAxis=105]="RightTriggerAxis",n))(P||{});function X(t){return t<100}o(X,"isGamepadButton");function H(t){return t>=100}o(H,"isGamepadAxis");function F(t){return t>=0&&t<=19?t:null}o(F,"gamepadButtonIndexToInput");function q(t){return{0:100,1:101,2:102,3:103}[t]??null}o(q,"gamepadAxisIndexToInput");var B=(s=>(s[s.Touch0=0]="Touch0",s[s.Touch1=1]="Touch1",s[s.Touch2=2]="Touch2",s[s.Touch3=3]="Touch3",s[s.Touch4=4]="Touch4",s[s.Touch5=5]="Touch5",s[s.Touch6=6]="Touch6",s[s.Touch7=7]="Touch7",s[s.Touch8=8]="Touch8",s[s.Touch9=9]="Touch9",s[s.Touch0X=100]="Touch0X",s[s.Touch0Y=101]="Touch0Y",s[s.Touch1X=102]="Touch1X",s[s.Touch1Y=103]="Touch1Y",s[s.Touch2X=104]="Touch2X",s[s.Touch2Y=105]="Touch2Y",s[s.Touch3X=106]="Touch3X",s[s.Touch3Y=107]="Touch3Y",s[s.Touch4X=108]="Touch4X",s[s.Touch4Y=109]="Touch4Y",s[s.Touch5X=110]="Touch5X",s[s.Touch5Y=111]="Touch5Y",s[s.Touch6X=112]="Touch6X",s[s.Touch6Y=113]="Touch6Y",s[s.Touch7X=114]="Touch7X",s[s.Touch7Y=115]="Touch7Y",s[s.Touch8X=116]="Touch8X",s[s.Touch8Y=117]="Touch8Y",s[s.Touch9X=118]="Touch9X",s[s.Touch9Y=119]="Touch9Y",s[s.PinchScale=200]="PinchScale",s[s.RotationAngle=201]="RotationAngle",s[s.SwipeVelocityX=202]="SwipeVelocityX",s[s.SwipeVelocityY=203]="SwipeVelocityY",s))(B||{});function U(t){return t<100}o(U,"isTouchButton");function Q(t){return t>=100&&t<200}o(Q,"isTouchPosition");function $(t){return t>=200}o($,"isTouchGesture");function W(t){return t<0||t>9?null:100+t*2}o(W,"getTouchXAxis");function O(t){return t<0||t>9?null:101+t*2}o(O,"getTouchYAxis");var A=(r=>(r[r.DPadUp=0]="DPadUp",r[r.DPadDown=1]="DPadDown",r[r.DPadLeft=2]="DPadLeft",r[r.DPadRight=3]="DPadRight",r[r.DPadCenter=4]="DPadCenter",r[r.Play=5]="Play",r[r.Pause=6]="Pause",r[r.PlayPause=7]="PlayPause",r[r.Stop=8]="Stop",r[r.Rewind=9]="Rewind",r[r.FastForward=10]="FastForward",r[r.Previous=11]="Previous",r[r.Next=12]="Next",r[r.Record=13]="Record",r[r.VolumeUp=15]="VolumeUp",r[r.VolumeDown=16]="VolumeDown",r[r.Mute=17]="Mute",r[r.ChannelUp=18]="ChannelUp",r[r.ChannelDown=19]="ChannelDown",r[r.Back=20]="Back",r[r.Home=21]="Home",r[r.Menu=22]="Menu",r[r.Info=23]="Info",r[r.Guide=24]="Guide",r[r.Exit=25]="Exit",r[r.Red=30]="Red",r[r.Green=31]="Green",r[r.Yellow=32]="Yellow",r[r.Blue=33]="Blue",r[r.Digit0=40]="Digit0",r[r.Digit1=41]="Digit1",r[r.Digit2=42]="Digit2",r[r.Digit3=43]="Digit3",r[r.Digit4=44]="Digit4",r[r.Digit5=45]="Digit5",r[r.Digit6=46]="Digit6",r[r.Digit7=47]="Digit7",r[r.Digit8=48]="Digit8",r[r.Digit9=49]="Digit9",r[r.Input=50]="Input",r[r.Settings=51]="Settings",r[r.Subtitle=52]="Subtitle",r[r.Audio=53]="Audio",r[r.Power=54]="Power",r[r.PointerX=100]="PointerX",r[r.PointerY=101]="PointerY",r[r.GyroX=102]="GyroX",r[r.GyroY=103]="GyroY",r[r.GyroZ=104]="GyroZ",r))(A||{});function Z(t){return t<100}o(Z,"isTVRemoteButton");function j(t){return t>=100}o(j,"isTVRemoteAxis");function J(t,e){return{device:t,input:e}}o(J,"createInputDescriptor");function M(t){switch(t.device){case 0:return!0;case 1:return t.input<100;case 2:return t.input<100;case 3:return t.input<100;case 4:return t.input<100;default:return!1}}o(M,"isButton");function d(t){return!M(t)}o(d,"isAxis");function G(t){let e=new Uint8Array(3);return e[0]=t.device,e[1]=t.input&255,e[2]=t.input>>8&255,e}o(G,"serializeInputDescriptor");function y(t,e=0){let c=t[e],f=t[e+1]|t[e+2]<<8;return{device:c,input:f}}o(y,"deserializeInputDescriptor");function V(t){let e=S[t.device],c;switch(t.device){case 0:c=u[t.input];break;case 1:c=z[t.input];break;case 2:c=P[t.input];break;case 3:c=B[t.input];break;case 4:c=A[t.input];break;default:c="Unknown"}return`${e}:${c}`}o(V,"inputDescriptorToString");function T(t){let[e,c]=t.split(":");if(!e||!c)return null;let f=Object.entries(S).find(([D,l])=>D.toLowerCase()===e.toLowerCase()&&typeof l=="number")?.[1];if(f===void 0)return null;let m;switch(f){case 0:m=u[c];break;case 1:m=z[c];break;case 2:m=P[c];break;case 3:m=B[c];break;case 4:m=A[c];break}return m===void 0?null:{device:f,input:m}}o(T,"parseInputDescriptor");var g=class g{constructor(e=0,c=0){w(this,"x");w(this,"y");this.x=e,this.y=c}static zero(){return new g(0,0)}static one(){return new g(1,1)}static up(){return new g(0,-1)}static down(){return new g(0,1)}static left(){return new g(-1,0)}static right(){return new g(1,0)}add(e){return new g(this.x+e.x,this.y+e.y)}subtract(e){return new g(this.x-e.x,this.y-e.y)}multiply(e){return new g(this.x*e,this.y*e)}divide(e){if(e===0)throw new Error("Division by zero");return new g(this.x/e,this.y/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){let e=this.length();return e===0?g.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}angle(){return Math.atan2(this.y,this.x)}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}rotate(e){let c=Math.cos(e),f=Math.sin(e);return new g(this.x*c-this.y*f,this.x*f+this.y*c)}lerp(e,c){return new g(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c)}clone(){return new g(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}toString(){return`Vector2(${this.x}, ${this.y})`}toArray(){return[this.x,this.y]}set(e,c){return this.x=e,this.y=c,this}copy(e){return this.x=e.x,this.y=e.y,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0):(this.x/=e,this.y/=e),this}};o(g,"Vector2");var C=g;var x=class x{constructor(e=0,c=0,f=0){w(this,"x");w(this,"y");w(this,"z");this.x=e,this.y=c,this.z=f}static zero(){return new x(0,0,0)}static one(){return new x(1,1,1)}static up(){return new x(0,1,0)}static down(){return new x(0,-1,0)}static left(){return new x(-1,0,0)}static right(){return new x(1,0,0)}static forward(){return new x(0,0,1)}static back(){return new x(0,0,-1)}add(e){return new x(this.x+e.x,this.y+e.y,this.z+e.z)}subtract(e){return new x(this.x-e.x,this.y-e.y,this.z-e.z)}multiply(e){return new x(this.x*e,this.y*e,this.z*e)}divide(e){if(e===0)throw new Error("Division by zero");return new x(this.x/e,this.y/e,this.z/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z}normalize(){let e=this.length();return e===0?x.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){return new x(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}lerp(e,c){return new x(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c,this.z+(e.z-this.z)*c)}clone(){return new x(this.x,this.y,this.z)}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}toString(){return`Vector3(${this.x}, ${this.y}, ${this.z})`}toArray(){return[this.x,this.y,this.z]}set(e,c,f){return this.x=e,this.y=c,this.z=f,this}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this.z/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0,this.z=0):(this.x/=e,this.y/=e,this.z/=e),this}};o(x,"Vector3");var E=x;var si={scanlines:{opacity:.15,pattern:"horizontal",spacing:2,thickness:1,color:{r:0,g:0,b:0}},ambientEffect:{blur:30,scale:1.3,opacity:.7}},ni={color:"rgba(144, 24, 24, 1)",lineWidth:1};var _=(l=>(l.None="none",l.Eighth="eighth",l.Quarter="quarter",l.Half="half",l.Integer="integer",l.Responsive="responsive",l))(_||{}),b=(l=>(l[l.None=0]="None",l[l.Eighth=1]="Eighth",l[l.Quarter=2]="Quarter",l[l.Half=3]="Half",l[l.Integer=4]="Integer",l[l.Responsive=5]="Responsive",l))(b||{});function ci(t){switch(t){case"none":return 0;case"eighth":return 1;case"quarter":return 2;case"half":return 3;case"integer":return 4;case"responsive":return 5;default:return 0}}o(ci,"scalingModeToValue");function oi(t){switch(t){case 0:return"none";case 1:return"eighth";case 2:return"quarter";case 3:return"half";case 4:return"integer";case 5:return"responsive";default:return"none"}}o(oi,"valueToScalingMode");var R=(D=>(D[D.Disconnected=0]="Disconnected",D[D.Connecting=1]="Connecting",D[D.Connected=2]="Connected",D[D.Reconnecting=3]="Reconnecting",D[D.Error=4]="Error",D))(R||{});
|
package/dist/index.d.ts
CHANGED
|
@@ -855,7 +855,14 @@ declare enum ScalingMode {
|
|
|
855
855
|
* Crisp pixels with no sub-pixel artifacts.
|
|
856
856
|
* May leave empty space around the canvas.
|
|
857
857
|
*/
|
|
858
|
-
Integer = "integer"
|
|
858
|
+
Integer = "integer",
|
|
859
|
+
/**
|
|
860
|
+
* Responsive mode - no scaling applied (scale = 1).
|
|
861
|
+
* The canvas size matches exactly cols × cellWidth by rows × cellHeight.
|
|
862
|
+
* Use with display.setSize() to dynamically add/remove cells based on viewport.
|
|
863
|
+
* Best for responsive applications that want to maximize cell count.
|
|
864
|
+
*/
|
|
865
|
+
Responsive = "responsive"
|
|
859
866
|
}
|
|
860
867
|
/**
|
|
861
868
|
* Numeric values for ScalingMode (for binary protocol)
|
|
@@ -866,7 +873,8 @@ declare enum ScalingModeValue {
|
|
|
866
873
|
Eighth = 1,
|
|
867
874
|
Quarter = 2,
|
|
868
875
|
Half = 3,
|
|
869
|
-
Integer = 4
|
|
876
|
+
Integer = 4,
|
|
877
|
+
Responsive = 5
|
|
870
878
|
}
|
|
871
879
|
/**
|
|
872
880
|
* Convert ScalingMode string enum to numeric ScalingModeValue
|
|
@@ -976,20 +984,38 @@ declare const GRID_DEFAULTS: {
|
|
|
976
984
|
/**
|
|
977
985
|
* Post-process command types
|
|
978
986
|
*/
|
|
979
|
-
type PostProcessCommandType = 'set-config' | 'set-scanlines-enabled' | 'set-scanlines-opacity' | 'set-ambient-effect-enabled' | 'set-ambient-effect-blur' | 'set-ambient-effect-scale' | 'set-scaling-mode' | 'set-grid' | 'switch-palette';
|
|
987
|
+
type PostProcessCommandType = 'set-config' | 'set-scanlines-enabled' | 'set-scanlines-opacity' | 'set-ambient-effect-enabled' | 'set-ambient-effect-blur' | 'set-ambient-effect-scale' | 'set-scaling-mode' | 'set-grid' | 'switch-palette' | 'set-cell-size';
|
|
980
988
|
/**
|
|
981
|
-
* Command to update post-processing settings
|
|
989
|
+
* Command to update post-processing settings for a specific display
|
|
990
|
+
*
|
|
991
|
+
* All post-process commands are scoped to a display.
|
|
992
|
+
* The displayId identifies which display the command applies to.
|
|
982
993
|
*/
|
|
983
994
|
interface PostProcessCommand {
|
|
995
|
+
/** Command type */
|
|
984
996
|
type: PostProcessCommandType;
|
|
997
|
+
/** Display ID this command applies to (0-255) - REQUIRED */
|
|
998
|
+
displayId: number;
|
|
999
|
+
/** Full post-process configuration (for 'set-config' type) */
|
|
985
1000
|
config?: PostProcessConfig;
|
|
1001
|
+
/** Enable/disable flag (for toggle commands) */
|
|
986
1002
|
enabled?: boolean;
|
|
1003
|
+
/** Opacity value 0-1 (for opacity commands) */
|
|
987
1004
|
opacity?: number;
|
|
1005
|
+
/** Blur value in pixels (for blur commands) */
|
|
988
1006
|
blur?: number;
|
|
1007
|
+
/** Scale factor (for scale commands) */
|
|
989
1008
|
scale?: number;
|
|
1009
|
+
/** Scaling mode (for 'set-scaling-mode' type) */
|
|
990
1010
|
scalingMode?: ScalingMode;
|
|
1011
|
+
/** Grid configuration (for 'set-grid' type) */
|
|
991
1012
|
gridConfig?: GridConfig;
|
|
1013
|
+
/** Palette slot ID (for 'switch-palette' type) */
|
|
992
1014
|
paletteSlotId?: number;
|
|
1015
|
+
/** Cell width in pixels (for 'set-cell-size' type) */
|
|
1016
|
+
cellWidth?: number;
|
|
1017
|
+
/** Cell height in pixels (for 'set-cell-size' type) */
|
|
1018
|
+
cellHeight?: number;
|
|
993
1019
|
}
|
|
994
1020
|
|
|
995
1021
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var C=Object.defineProperty;var L=(t,e,c)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[e]=c;var o=(t,e)=>C(t,"name",{value:e,configurable:!0});var D=(t,e,c)=>(L(t,typeof e!="symbol"?e+"":e,c),c);var u=(f=>(f[f.Keyboard=0]="Keyboard",f[f.Mouse=1]="Mouse",f[f.Gamepad=2]="Gamepad",f[f.Touch=3]="Touch",f[f.TVRemote=4]="TVRemote",f[f.TextInput=5]="TextInput",f[f.Motion=6]="Motion",f))(u||{});var w=(i=>(i[i.KeyA=0]="KeyA",i[i.KeyB=1]="KeyB",i[i.KeyC=2]="KeyC",i[i.KeyD=3]="KeyD",i[i.KeyE=4]="KeyE",i[i.KeyF=5]="KeyF",i[i.KeyG=6]="KeyG",i[i.KeyH=7]="KeyH",i[i.KeyI=8]="KeyI",i[i.KeyJ=9]="KeyJ",i[i.KeyK=10]="KeyK",i[i.KeyL=11]="KeyL",i[i.KeyM=12]="KeyM",i[i.KeyN=13]="KeyN",i[i.KeyO=14]="KeyO",i[i.KeyP=15]="KeyP",i[i.KeyQ=16]="KeyQ",i[i.KeyR=17]="KeyR",i[i.KeyS=18]="KeyS",i[i.KeyT=19]="KeyT",i[i.KeyU=20]="KeyU",i[i.KeyV=21]="KeyV",i[i.KeyW=22]="KeyW",i[i.KeyX=23]="KeyX",i[i.KeyY=24]="KeyY",i[i.KeyZ=25]="KeyZ",i[i.Digit0=26]="Digit0",i[i.Digit1=27]="Digit1",i[i.Digit2=28]="Digit2",i[i.Digit3=29]="Digit3",i[i.Digit4=30]="Digit4",i[i.Digit5=31]="Digit5",i[i.Digit6=32]="Digit6",i[i.Digit7=33]="Digit7",i[i.Digit8=34]="Digit8",i[i.Digit9=35]="Digit9",i[i.ArrowUp=36]="ArrowUp",i[i.ArrowDown=37]="ArrowDown",i[i.ArrowLeft=38]="ArrowLeft",i[i.ArrowRight=39]="ArrowRight",i[i.Space=40]="Space",i[i.Enter=41]="Enter",i[i.Escape=42]="Escape",i[i.Backspace=43]="Backspace",i[i.Tab=44]="Tab",i[i.ShiftLeft=45]="ShiftLeft",i[i.ShiftRight=46]="ShiftRight",i[i.ControlLeft=47]="ControlLeft",i[i.ControlRight=48]="ControlRight",i[i.AltLeft=49]="AltLeft",i[i.AltRight=50]="AltRight",i[i.MetaLeft=51]="MetaLeft",i[i.MetaRight=52]="MetaRight",i[i.CapsLock=53]="CapsLock",i[i.Delete=54]="Delete",i[i.Insert=55]="Insert",i[i.Home=56]="Home",i[i.End=57]="End",i[i.PageUp=58]="PageUp",i[i.PageDown=59]="PageDown",i[i.F1=60]="F1",i[i.F2=61]="F2",i[i.F3=62]="F3",i[i.F4=63]="F4",i[i.F5=64]="F5",i[i.F6=65]="F6",i[i.F7=66]="F7",i[i.F8=67]="F8",i[i.F9=68]="F9",i[i.F10=69]="F10",i[i.F11=70]="F11",i[i.F12=71]="F12",i[i.Minus=72]="Minus",i[i.Equal=73]="Equal",i[i.BracketLeft=74]="BracketLeft",i[i.BracketRight=75]="BracketRight",i[i.Backslash=76]="Backslash",i[i.Semicolon=77]="Semicolon",i[i.Quote=78]="Quote",i[i.Comma=79]="Comma",i[i.Period=80]="Period",i[i.Slash=81]="Slash",i[i.Backquote=82]="Backquote",i[i.Numpad0=91]="Numpad0",i[i.Numpad1=92]="Numpad1",i[i.Numpad2=93]="Numpad2",i[i.Numpad3=94]="Numpad3",i[i.Numpad4=95]="Numpad4",i[i.Numpad5=96]="Numpad5",i[i.Numpad6=97]="Numpad6",i[i.Numpad7=98]="Numpad7",i[i.Numpad8=99]="Numpad8",i[i.Numpad9=100]="Numpad9",i[i.NumpadAdd=101]="NumpadAdd",i[i.NumpadSubtract=102]="NumpadSubtract",i[i.NumpadMultiply=103]="NumpadMultiply",i[i.NumpadDivide=104]="NumpadDivide",i[i.NumpadDecimal=105]="NumpadDecimal",i[i.NumpadEnter=106]="NumpadEnter",i[i.NumLock=107]="NumLock",i[i.PrintScreen=111]="PrintScreen",i[i.ScrollLock=112]="ScrollLock",i[i.Pause=113]="Pause",i[i.ContextMenu=114]="ContextMenu",i))(w||{});function N(t){let e=w[t];return e!==void 0?e:null}o(N,"keyCodeToKeyboardInput");function Y(t){return w[t]}o(Y,"keyboardInputToKeyCode");var S=(l=>(l[l.LeftButton=0]="LeftButton",l[l.MiddleButton=1]="MiddleButton",l[l.RightButton=2]="RightButton",l[l.Button4=3]="Button4",l[l.Button5=4]="Button5",l[l.PositionX=100]="PositionX",l[l.PositionY=101]="PositionY",l[l.DeltaX=102]="DeltaX",l[l.DeltaY=103]="DeltaY",l[l.WheelDeltaY=104]="WheelDeltaY",l[l.WheelDeltaX=105]="WheelDeltaX",l))(S||{});function v(t){return t<100}o(v,"isMouseButton");function X(t){return t>=100}o(X,"isMouseAxis");var z=(n=>(n[n.ButtonA=0]="ButtonA",n[n.ButtonB=1]="ButtonB",n[n.ButtonX=2]="ButtonX",n[n.ButtonY=3]="ButtonY",n[n.LeftShoulder=4]="LeftShoulder",n[n.RightShoulder=5]="RightShoulder",n[n.LeftTrigger=6]="LeftTrigger",n[n.RightTrigger=7]="RightTrigger",n[n.Select=8]="Select",n[n.Start=9]="Start",n[n.LeftStick=10]="LeftStick",n[n.RightStick=11]="RightStick",n[n.DPadUp=12]="DPadUp",n[n.DPadDown=13]="DPadDown",n[n.DPadLeft=14]="DPadLeft",n[n.DPadRight=15]="DPadRight",n[n.Home=16]="Home",n[n.Touchpad=17]="Touchpad",n[n.LeftStickX=100]="LeftStickX",n[n.LeftStickY=101]="LeftStickY",n[n.RightStickX=102]="RightStickX",n[n.RightStickY=103]="RightStickY",n[n.LeftTriggerAxis=104]="LeftTriggerAxis",n[n.RightTriggerAxis=105]="RightTriggerAxis",n))(z||{});function F(t){return t<100}o(F,"isGamepadButton");function H(t){return t>=100}o(H,"isGamepadAxis");function q(t){return t>=0&&t<=19?t:null}o(q,"gamepadButtonIndexToInput");function U(t){return{0:100,1:101,2:102,3:103}[t]??null}o(U,"gamepadAxisIndexToInput");var P=(s=>(s[s.Touch0=0]="Touch0",s[s.Touch1=1]="Touch1",s[s.Touch2=2]="Touch2",s[s.Touch3=3]="Touch3",s[s.Touch4=4]="Touch4",s[s.Touch5=5]="Touch5",s[s.Touch6=6]="Touch6",s[s.Touch7=7]="Touch7",s[s.Touch8=8]="Touch8",s[s.Touch9=9]="Touch9",s[s.Touch0X=100]="Touch0X",s[s.Touch0Y=101]="Touch0Y",s[s.Touch1X=102]="Touch1X",s[s.Touch1Y=103]="Touch1Y",s[s.Touch2X=104]="Touch2X",s[s.Touch2Y=105]="Touch2Y",s[s.Touch3X=106]="Touch3X",s[s.Touch3Y=107]="Touch3Y",s[s.Touch4X=108]="Touch4X",s[s.Touch4Y=109]="Touch4Y",s[s.Touch5X=110]="Touch5X",s[s.Touch5Y=111]="Touch5Y",s[s.Touch6X=112]="Touch6X",s[s.Touch6Y=113]="Touch6Y",s[s.Touch7X=114]="Touch7X",s[s.Touch7Y=115]="Touch7Y",s[s.Touch8X=116]="Touch8X",s[s.Touch8Y=117]="Touch8Y",s[s.Touch9X=118]="Touch9X",s[s.Touch9Y=119]="Touch9Y",s[s.PinchScale=200]="PinchScale",s[s.RotationAngle=201]="RotationAngle",s[s.SwipeVelocityX=202]="SwipeVelocityX",s[s.SwipeVelocityY=203]="SwipeVelocityY",s))(P||{});function Q(t){return t<100}o(Q,"isTouchButton");function $(t){return t>=100&&t<200}o($,"isTouchPosition");function O(t){return t>=200}o(O,"isTouchGesture");function W(t){return t<0||t>9?null:100+t*2}o(W,"getTouchXAxis");function Z(t){return t<0||t>9?null:101+t*2}o(Z,"getTouchYAxis");var B=(r=>(r[r.DPadUp=0]="DPadUp",r[r.DPadDown=1]="DPadDown",r[r.DPadLeft=2]="DPadLeft",r[r.DPadRight=3]="DPadRight",r[r.DPadCenter=4]="DPadCenter",r[r.Play=5]="Play",r[r.Pause=6]="Pause",r[r.PlayPause=7]="PlayPause",r[r.Stop=8]="Stop",r[r.Rewind=9]="Rewind",r[r.FastForward=10]="FastForward",r[r.Previous=11]="Previous",r[r.Next=12]="Next",r[r.Record=13]="Record",r[r.VolumeUp=15]="VolumeUp",r[r.VolumeDown=16]="VolumeDown",r[r.Mute=17]="Mute",r[r.ChannelUp=18]="ChannelUp",r[r.ChannelDown=19]="ChannelDown",r[r.Back=20]="Back",r[r.Home=21]="Home",r[r.Menu=22]="Menu",r[r.Info=23]="Info",r[r.Guide=24]="Guide",r[r.Exit=25]="Exit",r[r.Red=30]="Red",r[r.Green=31]="Green",r[r.Yellow=32]="Yellow",r[r.Blue=33]="Blue",r[r.Digit0=40]="Digit0",r[r.Digit1=41]="Digit1",r[r.Digit2=42]="Digit2",r[r.Digit3=43]="Digit3",r[r.Digit4=44]="Digit4",r[r.Digit5=45]="Digit5",r[r.Digit6=46]="Digit6",r[r.Digit7=47]="Digit7",r[r.Digit8=48]="Digit8",r[r.Digit9=49]="Digit9",r[r.Input=50]="Input",r[r.Settings=51]="Settings",r[r.Subtitle=52]="Subtitle",r[r.Audio=53]="Audio",r[r.Power=54]="Power",r[r.PointerX=100]="PointerX",r[r.PointerY=101]="PointerY",r[r.GyroX=102]="GyroX",r[r.GyroY=103]="GyroY",r[r.GyroZ=104]="GyroZ",r))(B||{});function j(t){return t<100}o(j,"isTVRemoteButton");function J(t){return t>=100}o(J,"isTVRemoteAxis");function d(t,e){return{device:t,input:e}}o(d,"createInputDescriptor");function E(t){switch(t.device){case 0:return!0;case 1:return t.input<100;case 2:return t.input<100;case 3:return t.input<100;case 4:return t.input<100;default:return!1}}o(E,"isButton");function G(t){return!E(t)}o(G,"isAxis");function y(t){let e=new Uint8Array(3);return e[0]=t.device,e[1]=t.input&255,e[2]=t.input>>8&255,e}o(y,"serializeInputDescriptor");function V(t,e=0){let c=t[e],a=t[e+1]|t[e+2]<<8;return{device:c,input:a}}o(V,"deserializeInputDescriptor");function T(t){let e=u[t.device],c;switch(t.device){case 0:c=w[t.input];break;case 1:c=S[t.input];break;case 2:c=z[t.input];break;case 3:c=P[t.input];break;case 4:c=B[t.input];break;default:c="Unknown"}return`${e}:${c}`}o(T,"inputDescriptorToString");function _(t){let[e,c]=t.split(":");if(!e||!c)return null;let a=Object.entries(u).find(([h,M])=>h.toLowerCase()===e.toLowerCase()&&typeof M=="number")?.[1];if(a===void 0)return null;let m;switch(a){case 0:m=w[c];break;case 1:m=S[c];break;case 2:m=z[c];break;case 3:m=P[c];break;case 4:m=B[c];break}return m===void 0?null:{device:a,input:m}}o(_,"parseInputDescriptor");var g=class g{constructor(e=0,c=0){D(this,"x");D(this,"y");this.x=e,this.y=c}static zero(){return new g(0,0)}static one(){return new g(1,1)}static up(){return new g(0,-1)}static down(){return new g(0,1)}static left(){return new g(-1,0)}static right(){return new g(1,0)}add(e){return new g(this.x+e.x,this.y+e.y)}subtract(e){return new g(this.x-e.x,this.y-e.y)}multiply(e){return new g(this.x*e,this.y*e)}divide(e){if(e===0)throw new Error("Division by zero");return new g(this.x/e,this.y/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){let e=this.length();return e===0?g.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}angle(){return Math.atan2(this.y,this.x)}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}rotate(e){let c=Math.cos(e),a=Math.sin(e);return new g(this.x*c-this.y*a,this.x*a+this.y*c)}lerp(e,c){return new g(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c)}clone(){return new g(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}toString(){return`Vector2(${this.x}, ${this.y})`}toArray(){return[this.x,this.y]}set(e,c){return this.x=e,this.y=c,this}copy(e){return this.x=e.x,this.y=e.y,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0):(this.x/=e,this.y/=e),this}};o(g,"Vector2");var A=g;var x=class x{constructor(e=0,c=0,a=0){D(this,"x");D(this,"y");D(this,"z");this.x=e,this.y=c,this.z=a}static zero(){return new x(0,0,0)}static one(){return new x(1,1,1)}static up(){return new x(0,1,0)}static down(){return new x(0,-1,0)}static left(){return new x(-1,0,0)}static right(){return new x(1,0,0)}static forward(){return new x(0,0,1)}static back(){return new x(0,0,-1)}add(e){return new x(this.x+e.x,this.y+e.y,this.z+e.z)}subtract(e){return new x(this.x-e.x,this.y-e.y,this.z-e.z)}multiply(e){return new x(this.x*e,this.y*e,this.z*e)}divide(e){if(e===0)throw new Error("Division by zero");return new x(this.x/e,this.y/e,this.z/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z}normalize(){let e=this.length();return e===0?x.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){return new x(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}lerp(e,c){return new x(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c,this.z+(e.z-this.z)*c)}clone(){return new x(this.x,this.y,this.z)}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}toString(){return`Vector3(${this.x}, ${this.y}, ${this.z})`}toArray(){return[this.x,this.y,this.z]}set(e,c,a){return this.x=e,this.y=c,this.z=a,this}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this.z/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0,this.z=0):(this.x/=e,this.y/=e,this.z/=e),this}};o(x,"Vector3");var k=x;var Hi={scanlines:{opacity:.15,pattern:"horizontal",spacing:2,thickness:1,color:{r:0,g:0,b:0}},ambientEffect:{blur:30,scale:1.3,opacity:.7}},qi={color:"rgba(144, 24, 24, 1)",lineWidth:1};var b=(h=>(h.None="none",h.Eighth="eighth",h.Quarter="quarter",h.Half="half",h.Integer="integer",h))(b||{}),R=(h=>(h[h.None=0]="None",h[h.Eighth=1]="Eighth",h[h.Quarter=2]="Quarter",h[h.Half=3]="Half",h[h.Integer=4]="Integer",h))(R||{});function Qi(t){switch(t){case"none":return 0;case"eighth":return 1;case"quarter":return 2;case"half":return 3;case"integer":return 4;default:return 0}}o(Qi,"scalingModeToValue");function $i(t){switch(t){case 0:return"none";case 1:return"eighth";case 2:return"quarter";case 3:return"half";case 4:return"integer";default:return"none"}}o($i,"valueToScalingMode");var p=(h=>(h[h.Disconnected=0]="Disconnected",h[h.Connecting=1]="Connecting",h[h.Connected=2]="Connected",h[h.Reconnecting=3]="Reconnecting",h[h.Error=4]="Error",h))(p||{});export{qi as GRID_DEFAULTS,z as GamepadInput,u as InputDeviceType,w as KeyboardInput,S as MouseInput,p as NetworkState,Hi as POST_PROCESS_DEFAULTS,b as ScalingMode,R as ScalingModeValue,B as TVRemoteInput,P as TouchInput,A as Vector2,k as Vector3,d as createInputDescriptor,V as deserializeInputDescriptor,U as gamepadAxisIndexToInput,q as gamepadButtonIndexToInput,W as getTouchXAxis,Z as getTouchYAxis,T as inputDescriptorToString,G as isAxis,E as isButton,H as isGamepadAxis,F as isGamepadButton,X as isMouseAxis,v as isMouseButton,J as isTVRemoteAxis,j as isTVRemoteButton,Q as isTouchButton,O as isTouchGesture,$ as isTouchPosition,N as keyCodeToKeyboardInput,Y as keyboardInputToKeyCode,_ as parseInputDescriptor,Qi as scalingModeToValue,y as serializeInputDescriptor,$i as valueToScalingMode};
|
|
1
|
+
var E=Object.defineProperty;var v=(t,e,c)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[e]=c;var o=(t,e)=>E(t,"name",{value:e,configurable:!0});var u=(t,e,c)=>(v(t,typeof e!="symbol"?e+"":e,c),c);var S=(f=>(f[f.Keyboard=0]="Keyboard",f[f.Mouse=1]="Mouse",f[f.Gamepad=2]="Gamepad",f[f.Touch=3]="Touch",f[f.TVRemote=4]="TVRemote",f[f.TextInput=5]="TextInput",f[f.Motion=6]="Motion",f))(S||{});var w=(i=>(i[i.KeyA=0]="KeyA",i[i.KeyB=1]="KeyB",i[i.KeyC=2]="KeyC",i[i.KeyD=3]="KeyD",i[i.KeyE=4]="KeyE",i[i.KeyF=5]="KeyF",i[i.KeyG=6]="KeyG",i[i.KeyH=7]="KeyH",i[i.KeyI=8]="KeyI",i[i.KeyJ=9]="KeyJ",i[i.KeyK=10]="KeyK",i[i.KeyL=11]="KeyL",i[i.KeyM=12]="KeyM",i[i.KeyN=13]="KeyN",i[i.KeyO=14]="KeyO",i[i.KeyP=15]="KeyP",i[i.KeyQ=16]="KeyQ",i[i.KeyR=17]="KeyR",i[i.KeyS=18]="KeyS",i[i.KeyT=19]="KeyT",i[i.KeyU=20]="KeyU",i[i.KeyV=21]="KeyV",i[i.KeyW=22]="KeyW",i[i.KeyX=23]="KeyX",i[i.KeyY=24]="KeyY",i[i.KeyZ=25]="KeyZ",i[i.Digit0=26]="Digit0",i[i.Digit1=27]="Digit1",i[i.Digit2=28]="Digit2",i[i.Digit3=29]="Digit3",i[i.Digit4=30]="Digit4",i[i.Digit5=31]="Digit5",i[i.Digit6=32]="Digit6",i[i.Digit7=33]="Digit7",i[i.Digit8=34]="Digit8",i[i.Digit9=35]="Digit9",i[i.ArrowUp=36]="ArrowUp",i[i.ArrowDown=37]="ArrowDown",i[i.ArrowLeft=38]="ArrowLeft",i[i.ArrowRight=39]="ArrowRight",i[i.Space=40]="Space",i[i.Enter=41]="Enter",i[i.Escape=42]="Escape",i[i.Backspace=43]="Backspace",i[i.Tab=44]="Tab",i[i.ShiftLeft=45]="ShiftLeft",i[i.ShiftRight=46]="ShiftRight",i[i.ControlLeft=47]="ControlLeft",i[i.ControlRight=48]="ControlRight",i[i.AltLeft=49]="AltLeft",i[i.AltRight=50]="AltRight",i[i.MetaLeft=51]="MetaLeft",i[i.MetaRight=52]="MetaRight",i[i.CapsLock=53]="CapsLock",i[i.Delete=54]="Delete",i[i.Insert=55]="Insert",i[i.Home=56]="Home",i[i.End=57]="End",i[i.PageUp=58]="PageUp",i[i.PageDown=59]="PageDown",i[i.F1=60]="F1",i[i.F2=61]="F2",i[i.F3=62]="F3",i[i.F4=63]="F4",i[i.F5=64]="F5",i[i.F6=65]="F6",i[i.F7=66]="F7",i[i.F8=67]="F8",i[i.F9=68]="F9",i[i.F10=69]="F10",i[i.F11=70]="F11",i[i.F12=71]="F12",i[i.Minus=72]="Minus",i[i.Equal=73]="Equal",i[i.BracketLeft=74]="BracketLeft",i[i.BracketRight=75]="BracketRight",i[i.Backslash=76]="Backslash",i[i.Semicolon=77]="Semicolon",i[i.Quote=78]="Quote",i[i.Comma=79]="Comma",i[i.Period=80]="Period",i[i.Slash=81]="Slash",i[i.Backquote=82]="Backquote",i[i.Numpad0=91]="Numpad0",i[i.Numpad1=92]="Numpad1",i[i.Numpad2=93]="Numpad2",i[i.Numpad3=94]="Numpad3",i[i.Numpad4=95]="Numpad4",i[i.Numpad5=96]="Numpad5",i[i.Numpad6=97]="Numpad6",i[i.Numpad7=98]="Numpad7",i[i.Numpad8=99]="Numpad8",i[i.Numpad9=100]="Numpad9",i[i.NumpadAdd=101]="NumpadAdd",i[i.NumpadSubtract=102]="NumpadSubtract",i[i.NumpadMultiply=103]="NumpadMultiply",i[i.NumpadDivide=104]="NumpadDivide",i[i.NumpadDecimal=105]="NumpadDecimal",i[i.NumpadEnter=106]="NumpadEnter",i[i.NumLock=107]="NumLock",i[i.PrintScreen=111]="PrintScreen",i[i.ScrollLock=112]="ScrollLock",i[i.Pause=113]="Pause",i[i.ContextMenu=114]="ContextMenu",i))(w||{});function L(t){let e=w[t];return e!==void 0?e:null}o(L,"keyCodeToKeyboardInput");function N(t){return w[t]}o(N,"keyboardInputToKeyCode");var z=(h=>(h[h.LeftButton=0]="LeftButton",h[h.MiddleButton=1]="MiddleButton",h[h.RightButton=2]="RightButton",h[h.Button4=3]="Button4",h[h.Button5=4]="Button5",h[h.PositionX=100]="PositionX",h[h.PositionY=101]="PositionY",h[h.DeltaX=102]="DeltaX",h[h.DeltaY=103]="DeltaY",h[h.WheelDeltaY=104]="WheelDeltaY",h[h.WheelDeltaX=105]="WheelDeltaX",h))(z||{});function Y(t){return t<100}o(Y,"isMouseButton");function X(t){return t>=100}o(X,"isMouseAxis");var P=(n=>(n[n.ButtonA=0]="ButtonA",n[n.ButtonB=1]="ButtonB",n[n.ButtonX=2]="ButtonX",n[n.ButtonY=3]="ButtonY",n[n.LeftShoulder=4]="LeftShoulder",n[n.RightShoulder=5]="RightShoulder",n[n.LeftTrigger=6]="LeftTrigger",n[n.RightTrigger=7]="RightTrigger",n[n.Select=8]="Select",n[n.Start=9]="Start",n[n.LeftStick=10]="LeftStick",n[n.RightStick=11]="RightStick",n[n.DPadUp=12]="DPadUp",n[n.DPadDown=13]="DPadDown",n[n.DPadLeft=14]="DPadLeft",n[n.DPadRight=15]="DPadRight",n[n.Home=16]="Home",n[n.Touchpad=17]="Touchpad",n[n.LeftStickX=100]="LeftStickX",n[n.LeftStickY=101]="LeftStickY",n[n.RightStickX=102]="RightStickX",n[n.RightStickY=103]="RightStickY",n[n.LeftTriggerAxis=104]="LeftTriggerAxis",n[n.RightTriggerAxis=105]="RightTriggerAxis",n))(P||{});function H(t){return t<100}o(H,"isGamepadButton");function F(t){return t>=100}o(F,"isGamepadAxis");function q(t){return t>=0&&t<=19?t:null}o(q,"gamepadButtonIndexToInput");function U(t){return{0:100,1:101,2:102,3:103}[t]??null}o(U,"gamepadAxisIndexToInput");var B=(s=>(s[s.Touch0=0]="Touch0",s[s.Touch1=1]="Touch1",s[s.Touch2=2]="Touch2",s[s.Touch3=3]="Touch3",s[s.Touch4=4]="Touch4",s[s.Touch5=5]="Touch5",s[s.Touch6=6]="Touch6",s[s.Touch7=7]="Touch7",s[s.Touch8=8]="Touch8",s[s.Touch9=9]="Touch9",s[s.Touch0X=100]="Touch0X",s[s.Touch0Y=101]="Touch0Y",s[s.Touch1X=102]="Touch1X",s[s.Touch1Y=103]="Touch1Y",s[s.Touch2X=104]="Touch2X",s[s.Touch2Y=105]="Touch2Y",s[s.Touch3X=106]="Touch3X",s[s.Touch3Y=107]="Touch3Y",s[s.Touch4X=108]="Touch4X",s[s.Touch4Y=109]="Touch4Y",s[s.Touch5X=110]="Touch5X",s[s.Touch5Y=111]="Touch5Y",s[s.Touch6X=112]="Touch6X",s[s.Touch6Y=113]="Touch6Y",s[s.Touch7X=114]="Touch7X",s[s.Touch7Y=115]="Touch7Y",s[s.Touch8X=116]="Touch8X",s[s.Touch8Y=117]="Touch8Y",s[s.Touch9X=118]="Touch9X",s[s.Touch9Y=119]="Touch9Y",s[s.PinchScale=200]="PinchScale",s[s.RotationAngle=201]="RotationAngle",s[s.SwipeVelocityX=202]="SwipeVelocityX",s[s.SwipeVelocityY=203]="SwipeVelocityY",s))(B||{});function Q(t){return t<100}o(Q,"isTouchButton");function $(t){return t>=100&&t<200}o($,"isTouchPosition");function W(t){return t>=200}o(W,"isTouchGesture");function O(t){return t<0||t>9?null:100+t*2}o(O,"getTouchXAxis");function Z(t){return t<0||t>9?null:101+t*2}o(Z,"getTouchYAxis");var A=(r=>(r[r.DPadUp=0]="DPadUp",r[r.DPadDown=1]="DPadDown",r[r.DPadLeft=2]="DPadLeft",r[r.DPadRight=3]="DPadRight",r[r.DPadCenter=4]="DPadCenter",r[r.Play=5]="Play",r[r.Pause=6]="Pause",r[r.PlayPause=7]="PlayPause",r[r.Stop=8]="Stop",r[r.Rewind=9]="Rewind",r[r.FastForward=10]="FastForward",r[r.Previous=11]="Previous",r[r.Next=12]="Next",r[r.Record=13]="Record",r[r.VolumeUp=15]="VolumeUp",r[r.VolumeDown=16]="VolumeDown",r[r.Mute=17]="Mute",r[r.ChannelUp=18]="ChannelUp",r[r.ChannelDown=19]="ChannelDown",r[r.Back=20]="Back",r[r.Home=21]="Home",r[r.Menu=22]="Menu",r[r.Info=23]="Info",r[r.Guide=24]="Guide",r[r.Exit=25]="Exit",r[r.Red=30]="Red",r[r.Green=31]="Green",r[r.Yellow=32]="Yellow",r[r.Blue=33]="Blue",r[r.Digit0=40]="Digit0",r[r.Digit1=41]="Digit1",r[r.Digit2=42]="Digit2",r[r.Digit3=43]="Digit3",r[r.Digit4=44]="Digit4",r[r.Digit5=45]="Digit5",r[r.Digit6=46]="Digit6",r[r.Digit7=47]="Digit7",r[r.Digit8=48]="Digit8",r[r.Digit9=49]="Digit9",r[r.Input=50]="Input",r[r.Settings=51]="Settings",r[r.Subtitle=52]="Subtitle",r[r.Audio=53]="Audio",r[r.Power=54]="Power",r[r.PointerX=100]="PointerX",r[r.PointerY=101]="PointerY",r[r.GyroX=102]="GyroX",r[r.GyroY=103]="GyroY",r[r.GyroZ=104]="GyroZ",r))(A||{});function j(t){return t<100}o(j,"isTVRemoteButton");function J(t){return t>=100}o(J,"isTVRemoteAxis");function d(t,e){return{device:t,input:e}}o(d,"createInputDescriptor");function M(t){switch(t.device){case 0:return!0;case 1:return t.input<100;case 2:return t.input<100;case 3:return t.input<100;case 4:return t.input<100;default:return!1}}o(M,"isButton");function G(t){return!M(t)}o(G,"isAxis");function y(t){let e=new Uint8Array(3);return e[0]=t.device,e[1]=t.input&255,e[2]=t.input>>8&255,e}o(y,"serializeInputDescriptor");function V(t,e=0){let c=t[e],a=t[e+1]|t[e+2]<<8;return{device:c,input:a}}o(V,"deserializeInputDescriptor");function T(t){let e=S[t.device],c;switch(t.device){case 0:c=w[t.input];break;case 1:c=z[t.input];break;case 2:c=P[t.input];break;case 3:c=B[t.input];break;case 4:c=A[t.input];break;default:c="Unknown"}return`${e}:${c}`}o(T,"inputDescriptorToString");function _(t){let[e,c]=t.split(":");if(!e||!c)return null;let a=Object.entries(S).find(([m,l])=>m.toLowerCase()===e.toLowerCase()&&typeof l=="number")?.[1];if(a===void 0)return null;let D;switch(a){case 0:D=w[c];break;case 1:D=z[c];break;case 2:D=P[c];break;case 3:D=B[c];break;case 4:D=A[c];break}return D===void 0?null:{device:a,input:D}}o(_,"parseInputDescriptor");var g=class g{constructor(e=0,c=0){u(this,"x");u(this,"y");this.x=e,this.y=c}static zero(){return new g(0,0)}static one(){return new g(1,1)}static up(){return new g(0,-1)}static down(){return new g(0,1)}static left(){return new g(-1,0)}static right(){return new g(1,0)}add(e){return new g(this.x+e.x,this.y+e.y)}subtract(e){return new g(this.x-e.x,this.y-e.y)}multiply(e){return new g(this.x*e,this.y*e)}divide(e){if(e===0)throw new Error("Division by zero");return new g(this.x/e,this.y/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){let e=this.length();return e===0?g.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}angle(){return Math.atan2(this.y,this.x)}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}rotate(e){let c=Math.cos(e),a=Math.sin(e);return new g(this.x*c-this.y*a,this.x*a+this.y*c)}lerp(e,c){return new g(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c)}clone(){return new g(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}toString(){return`Vector2(${this.x}, ${this.y})`}toArray(){return[this.x,this.y]}set(e,c){return this.x=e,this.y=c,this}copy(e){return this.x=e.x,this.y=e.y,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0):(this.x/=e,this.y/=e),this}};o(g,"Vector2");var k=g;var x=class x{constructor(e=0,c=0,a=0){u(this,"x");u(this,"y");u(this,"z");this.x=e,this.y=c,this.z=a}static zero(){return new x(0,0,0)}static one(){return new x(1,1,1)}static up(){return new x(0,1,0)}static down(){return new x(0,-1,0)}static left(){return new x(-1,0,0)}static right(){return new x(1,0,0)}static forward(){return new x(0,0,1)}static back(){return new x(0,0,-1)}add(e){return new x(this.x+e.x,this.y+e.y,this.z+e.z)}subtract(e){return new x(this.x-e.x,this.y-e.y,this.z-e.z)}multiply(e){return new x(this.x*e,this.y*e,this.z*e)}divide(e){if(e===0)throw new Error("Division by zero");return new x(this.x/e,this.y/e,this.z/e)}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z}normalize(){let e=this.length();return e===0?x.zero():this.divide(e)}distance(e){return this.subtract(e).length()}distanceSquared(e){return this.subtract(e).lengthSquared()}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){return new x(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)}lerp(e,c){return new x(this.x+(e.x-this.x)*c,this.y+(e.y-this.y)*c,this.z+(e.z-this.z)*c)}clone(){return new x(this.x,this.y,this.z)}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}toString(){return`Vector3(${this.x}, ${this.y}, ${this.z})`}toArray(){return[this.x,this.y,this.z]}set(e,c,a){return this.x=e,this.y=c,this.z=a,this}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}multiplyInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this}divideInPlace(e){if(e===0)throw new Error("Division by zero");return this.x/=e,this.y/=e,this.z/=e,this}normalizeInPlace(){let e=this.length();return e===0?(this.x=0,this.y=0,this.z=0):(this.x/=e,this.y/=e,this.z/=e),this}};o(x,"Vector3");var C=x;var Fi={scanlines:{opacity:.15,pattern:"horizontal",spacing:2,thickness:1,color:{r:0,g:0,b:0}},ambientEffect:{blur:30,scale:1.3,opacity:.7}},qi={color:"rgba(144, 24, 24, 1)",lineWidth:1};var b=(l=>(l.None="none",l.Eighth="eighth",l.Quarter="quarter",l.Half="half",l.Integer="integer",l.Responsive="responsive",l))(b||{}),R=(l=>(l[l.None=0]="None",l[l.Eighth=1]="Eighth",l[l.Quarter=2]="Quarter",l[l.Half=3]="Half",l[l.Integer=4]="Integer",l[l.Responsive=5]="Responsive",l))(R||{});function Qi(t){switch(t){case"none":return 0;case"eighth":return 1;case"quarter":return 2;case"half":return 3;case"integer":return 4;case"responsive":return 5;default:return 0}}o(Qi,"scalingModeToValue");function $i(t){switch(t){case 0:return"none";case 1:return"eighth";case 2:return"quarter";case 3:return"half";case 4:return"integer";case 5:return"responsive";default:return"none"}}o($i,"valueToScalingMode");var p=(m=>(m[m.Disconnected=0]="Disconnected",m[m.Connecting=1]="Connecting",m[m.Connected=2]="Connected",m[m.Reconnecting=3]="Reconnecting",m[m.Error=4]="Error",m))(p||{});export{qi as GRID_DEFAULTS,P as GamepadInput,S as InputDeviceType,w as KeyboardInput,z as MouseInput,p as NetworkState,Fi as POST_PROCESS_DEFAULTS,b as ScalingMode,R as ScalingModeValue,A as TVRemoteInput,B as TouchInput,k as Vector2,C as Vector3,d as createInputDescriptor,V as deserializeInputDescriptor,U as gamepadAxisIndexToInput,q as gamepadButtonIndexToInput,O as getTouchXAxis,Z as getTouchYAxis,T as inputDescriptorToString,G as isAxis,M as isButton,F as isGamepadAxis,H as isGamepadButton,X as isMouseAxis,Y as isMouseButton,J as isTVRemoteAxis,j as isTVRemoteButton,Q as isTouchButton,W as isTouchGesture,$ as isTouchPosition,L as keyCodeToKeyboardInput,N as keyboardInputToKeyCode,_ as parseInputDescriptor,Qi as scalingModeToValue,y as serializeInputDescriptor,$i as valueToScalingMode};
|
package/package.json
CHANGED