module SomhairlesDream.Frontend.Bindings open Fable.Core [] type ThreeVector = abstract set: x: float * y: float * z: float -> ThreeVector abstract x: float with get, set abstract y: float with get, set abstract z: float with get, set abstract length: unit -> float [] type ThreeNode = abstract add: child: ThreeNode -> unit abstract clear: unit -> unit abstract lookAt: x: float * y: float * z: float -> unit abstract position: ThreeVector with get abstract rotation: ThreeVector with get abstract background: obj with get, set abstract children: ThreeNode array with get [] let disposeNodeResources (node: ThreeNode) : unit = jsNative [] type ThreeBox3 = abstract setFromObject: node: ThreeNode -> ThreeBox3 abstract isEmpty: unit -> bool abstract getCenter: target: ThreeVector -> ThreeVector abstract getSize: target: ThreeVector -> ThreeVector [] type ThreeCamera = inherit ThreeNode abstract fov: float with get, set abstract aspect: float with get, set abstract near: float with get, set abstract far: float with get, set abstract updateProjectionMatrix: unit -> unit [] type ThreeRenderer = abstract setPixelRatio: ratio: float -> unit abstract setSize: width: float * height: float * updateStyle: bool -> unit abstract render: scene: ThreeNode * camera: ThreeNode -> unit [] type ThreeGeometry = abstract setAttribute: name: string * attribute: obj -> ThreeGeometry abstract setIndex: attribute: obj -> ThreeGeometry abstract computeVertexNormals: unit -> unit [] type ServerEvent = abstract data: string with get [] type GLTFScene = abstract scene: ThreeNode with get [] let createGLTFLoader () : obj = jsNative [] let loadGLTF (loader: obj) (url: string) (onLoad: GLTFScene -> unit) (onError: obj -> unit) : unit = jsNative [] let createOrbitControls (camera: obj) (canvas: obj) : obj = jsNative [] let setControlsTarget (controls: obj) (x: float) (y: float) (z: float) : unit = jsNative [] let setControlsDamping (controls: obj) (enabled: bool) : unit = jsNative [] let setControlsAutoRotate (controls: obj) (auto: bool) : unit = jsNative [] let setControlsAutoRotateSpeed (controls: obj) (speed: float) : unit = jsNative [] let updateControls (controls: obj) : unit = jsNative [] let queryParam (name: string) : string = jsNative [] type EventSource = abstract onerror: (obj -> unit) with get, set abstract onmessage: (ServerEvent -> unit) with get, set abstract close: unit -> unit [] type FetchResponse = abstract ok: bool with get abstract status: int with get abstract json: unit -> JS.Promise [] type HtmlInput = abstract value: string with get abstract ``checked``: bool with get [] let createScene () : ThreeNode = jsNative [] let createGroup () : ThreeNode = jsNative [] let createPerspectiveCamera (fieldOfView: float, aspect: float, nearPlane: float, farPlane: float) : ThreeCamera = jsNative [] let createBox3 () : ThreeBox3 = jsNative [] let createVector3 () : ThreeVector = jsNative [] let exposeViewerDebug (camera: ThreeCamera) (scene: ThreeNode) (group: ThreeNode) (canvas: obj) (controls: obj) : unit = jsNative [] let clearChildren (node: obj) : unit = jsNative [] let createRenderer (options: obj) : ThreeRenderer = jsNative [] let createBufferGeometry () : ThreeGeometry = jsNative [] let createFloat32BufferAttribute (values: float array, itemSize: int) : obj = jsNative [] let createUint32BufferAttribute (values: int array) : obj = jsNative [] let createColor (value: string) : obj = jsNative [] let createBoxGeometry (width: float, height: float, depth: float) : obj = jsNative [] let createMeshStandardMaterial (options: obj) : obj = jsNative [] let createMesh (geometry: obj, material: obj) : ThreeNode = jsNative [] let createAmbientLight (color: string, intensity: float) : ThreeNode = jsNative [] let createDirectionalLight (color: string, intensity: float) : ThreeNode = jsNative [] let createEventSource (url: string) : EventSource = jsNative [] let fetch (url: string, options: obj) : JS.Promise = jsNative [] let encodeURIComponent (value: string) : string = jsNative [] let setInterval (callback: unit -> unit) (milliseconds: int) : int = jsNative [] let clearInterval (handle: int) : unit = jsNative [] let requestAnimationFrame (callback: float -> unit) : int = jsNative