webarkit / webarkit-testing

Testing a new version of WebARKit
https://www.webarkit.org/examples/webarkit-testing/
GNU General Public License v3.0
2 stars 0 forks source link

New interface with typescript #5

Closed kalwalt closed 1 year ago

kalwalt commented 3 years ago

I open this only to keep all the infos in a place.

kalwalt commented 3 years ago

in the terminal console, while running npm run dev-es6:

 npm run dev-es6

> @kalwalt/webarkit-testing@0.0.0 dev-es6 /home/walter/kalwalt-github/webarkit-testing
> webpack --mode development --progress --colors --watch

10% building 0/0 modules 0 active
webpack is watching the files…

Hash: a1d0e3a4c453f0ac7167
Version: webpack 4.44.2
Time: 1609ms
Built at: 2020-12-06 17:27:09
      Asset      Size  Chunks             Chunk Names
WebARKit.js  5.52 MiB    main  [emitted]  main
Entrypoint main = WebARKit.js
[0] util (ignored) 15 bytes {main} [built]
[1] util (ignored) 15 bytes {main} [built]
[2] util (ignored) 15 bytes {main} [built]
[4] buffer (ignored) 15 bytes {main} [optional] [built]
[5] crypto (ignored) 15 bytes {main} [optional] [built]
[6] util (ignored) 15 bytes {main} [built]
[7] util (ignored) 15 bytes {main} [built]
[8] buffer (ignored) 15 bytes {main} [optional] [built]
[9] buffer (ignored) 15 bytes {main} [optional] [built]
[./build/webarkit_ES6_wasm.js] 1.23 MiB {main} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {main} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {main} [built]
[./src/ModuleLoader.js] 369 bytes {main} [built]
[./src/WebARKit.ts] 4.32 KiB {main} [built] [5 errors]
[./src/index.ts] 78 bytes {main} [built]
    + 189 hidden modules

ERROR in /home/walter/kalwalt-github/webarkit-testing/src/tsconfig.json
[tsl] ERROR
      TS2468: Cannot find global value 'Promise'.

ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts
./src/WebARKit.ts
[tsl] ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts(15,11)
      TS7008: Member 'instance' implicitly has an 'any' type.

ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts
./src/WebARKit.ts
[tsl] ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts(35,18)
      TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.

ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts
./src/WebARKit.ts
[tsl] ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts(39,62)
      TS2304: Cannot find name 'global'.

ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts
./src/WebARKit.ts
[tsl] ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts(51,7)
      TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'WebARKit'.
  No index signature with a parameter of type 'string' was found on type 'WebARKit'.

ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts
./src/WebARKit.ts
[tsl] ERROR in /home/walter/kalwalt-github/webarkit-testing/src/WebARKit.ts(57,9)
      TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'WebARKit'.
  No index signature with a parameter of type 'string' was found on type 'WebARKit'.

but in the browser console we have the output the WebARKit object:

{WebARKit: ƒ}WebARKit: ƒ WebARKit(pipeline)arguments: (...)caller: (...)length: 1name: "WebARKit"prototype: {constructor: ƒ}__proto__: ƒ ()[[FunctionLocation]]: WebARKit.ts:20[[Scopes]]: Scopes[3]__proto__: constructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()

kalwalt commented 1 year ago

Closing because this code is outdated. I will see if add typescript support on this repository or when it will be available to WebARKit.