Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Support #30

Open
ding-e opened this issue Sep 1, 2019 · 0 comments
Open

TypeScript Support #30

ding-e opened this issue Sep 1, 2019 · 0 comments

Comments

@ding-e
Copy link

ding-e commented Sep 1, 2019

d.ts:

declare module FULLTILT {
	class DeviceOrientation {
		ALPHA:number;
		BETA:number;
		GAMMA:number;
		constructor(options?:any);
		start(callback?:Function):void;
		stop():void;
		listen(callback?:Function):void;
		isAvailable(attribute:number):boolean;
		isAbsolute():boolean;
		getFixedFrameQuaternion():Quaternion;
		getScreenAdjustedQuaternion():Quaternion;
		getFixedFrameMatrix():RotationMatrix;
		getScreenAdjustedMatrix():RotationMatrix;
		getFixedFrameEuler():Euler;
		getScreenAdjustedEuler():Euler;
		getLastRawEventData():DeviceOrientationEvent;
	}
	class DeviceMotion {
		ACCELERATION_X:number;
		ACCELERATION_Y:number;
		ACCELERATION_Z:number;
		ACCELERATION_INCLUDING_GRAVITY_X:number;
		ACCELERATION_INCLUDING_GRAVITY_Y:number;
		ACCELERATION_INCLUDING_GRAVITY_Z:number;
		ROTATION_RATE_ALPHA:number;
		ROTATION_RATE_BETA:number;
		ROTATION_RATE_GAMMA:number;
		constructor(options?:any);
		start(callback?:Function):void;
		stop():void;
		listen(callback?:Function):void;
		isAvailable(attribute:number):boolean;
		getScreenAdjustedAcceleration():number;
		getScreenAdjustedAccelerationIncludingGravity():number;
		getScreenAdjustedRotationRate():number;
		getLastRawEventData():DeviceOrientationEvent;
	}
	class Quaternion {
		constructor(x?:number, y?:number, z?:number, w?:number);
		set(x?:number, y?:number, z?:number, w?:number):Quaternion
		copy(quaternion:Quaternion):Quaternion;
		setFromEuler(euler:Euler):Quaternion;
		setFromRotationMatrix(matrix:RotationMatrix):Quaternion;
		multiply(quaternion:Quaternion):Quaternion;
		rotateX(radians:number):Quaternion;
		rotateY(radians:number):Quaternion;
		rotateZ(radians:number):Quaternion;
	}
	class RotationMatrix {
		elements:Array<number>;
		constructor(m11?:number, m12?:number, m13?:number, m21?:number, m22?:number, m23?:number, m31?:number, m32?:number, m33?:number);
		set(m11:number, m12:number, m13:number, m21:number, m22:number, m23:number, m31:number, m32:number, m33:number):RotationMatrix;
		copy(matrix:RotationMatrix):RotationMatrix;
		setFromEuler(euler:Euler):RotationMatrix;
		setFromQuaternion(quaternion:Quaternion):RotationMatrix;
		multiply(matrix:RotationMatrix):RotationMatrix;
		rotateX(radians:number):RotationMatrix;
		rotateY(radians:number):RotationMatrix;
		rotateZ(radians:number):RotationMatrix;
	}
	class Euler {
		alpha:number;
		gamma:number;
		beta:number;
		constructor(alpha?:number, beta?:number, gamma?:number);
		set(alpha:number, beta:number, gamma:number):Euler;
		copy(euler:Euler):Euler;
		setFromQuaternion(quaternion:Quaternion):Euler;
		setFromRotationMatrix(matrix:RotationMatrix):Euler;
		rotateX(radians:number):Euler;
		rotateY(radians:number):Euler;
		rotateZ(radians:number):Euler;
	}
	function getDeviceOrientation(options?:any):any;
	function getDeviceMotion(options?:any):any;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant