restructure, move to TS
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
/npm-debug.log
|
/npm-debug.log
|
||||||
/*.tgz
|
/*.tgz
|
||||||
|
/dist
|
||||||
|
|
||||||
# Files for editors and other tools
|
# Files for editors and other tools
|
||||||
/.brackets.json
|
/.brackets.json
|
||||||
|
|||||||
388
package-lock.json
generated
388
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@
|
|||||||
"test": "npm exec -- karma start --log-level debug --single-run=true"
|
"test": "npm exec -- karma start --log-level debug --single-run=true"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"eslint": "^8.56.0",
|
||||||
"jscs": "^2.1.1",
|
"jscs": "^2.1.1",
|
||||||
"jshint": "^2.11.0",
|
"jshint": "^2.11.0",
|
||||||
"karma": "^6.4.2",
|
"karma": "^6.4.2",
|
||||||
@@ -41,6 +42,6 @@
|
|||||||
"qunit-assert-close": "^2.1.2",
|
"qunit-assert-close": "^2.1.2",
|
||||||
"syn": "^0.14.1",
|
"syn": "^0.14.1",
|
||||||
"terser": "^4.6.7",
|
"terser": "^4.6.7",
|
||||||
"eslint": "^8.56.0"
|
"typescript": "^5.3.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ window.impress = () => {
|
|||||||
|
|
||||||
// this function is used to initialize impress. It calls various private functions that initialize
|
// this function is used to initialize impress. It calls various private functions that initialize
|
||||||
// various components
|
// various components
|
||||||
var init = () => {
|
var init: Function = () => {
|
||||||
console.log( 'init' );
|
console.log( 'init' );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -48,22 +48,42 @@ window.impress = () => {
|
|||||||
* Returns true if successful at positioning this element, false, if failed
|
* Returns true if successful at positioning this element, false, if failed
|
||||||
* @param {string} DOMElementID
|
* @param {string} DOMElementID
|
||||||
* @param {object} coordinates
|
* @param {object} coordinates
|
||||||
|
* @param {number} coordinates.x The translation in direction of x-axis
|
||||||
|
* @param {number} coordinates.y The translation in direction of y-axis
|
||||||
|
* @param {number} coordinates.z The translation in direction of z-axis
|
||||||
* @param {object} rotation
|
* @param {object} rotation
|
||||||
|
* @param {number} rotation.x The rotation in degrees around the x-axis
|
||||||
|
* @param {number} rotation.y The rotation in degrees around the y-axis
|
||||||
|
* @param {number} rotation.z The rotation in degrees around the z-axis
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
var addElement = ( DOMElementID, coordinates, rotation ) => {
|
var addElement: Function = ( DOMElementID, coordinates, rotation ) => {
|
||||||
console.log( 'element added' );
|
console.log( 'element added' );
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* This function allows you to remove an element from the virtual canvas. Essentially,
|
||||||
* @param {any} DOMElementID
|
* impress.js just hides this element and ignores it in translations & rotations
|
||||||
* @return {any}
|
* @param {string} DOMElementID The element that is removed. Has to be the element ID of a DOM element
|
||||||
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
var removeElement = ( DOMElementID ) => {
|
var removeElement = ( DOMElementID: string ): boolean => {
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description
|
||||||
|
* @param {object} coordinates
|
||||||
|
* @param {object} rotation
|
||||||
|
* @returns {promise}
|
||||||
|
*/
|
||||||
|
var moveTo = ( coordinates: object, rotation: object ): Promise<any> => {
|
||||||
|
return new Promise( ( resolve, reject ) => {
|
||||||
|
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
init
|
init
|
||||||
};
|
};
|
||||||
8
tsconfig.json
Normal file
8
tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./dist",
|
||||||
|
"allowJs": true,
|
||||||
|
"target": "ES6"
|
||||||
|
},
|
||||||
|
"include": [ "./src/**/*" ]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user