Comments (13)
from x_ite.
I'm not that familiar with TypeScript, which means I can't maintain the declarations file either, which means a PR is always welcome.
from x_ite.
I have already had a look at the .ts file, there are still a few small errors in there, but on the whole it already looks very good.
from x_ite.
I put the .d.ts file in the dist folder https://github.com/create3000/x_ite/tree/development/dist. I hope this is the right place. Could you please give me an example how I can benefit from this file.
from x_ite.
Well the problem is I am no expert on creating .d.ts files for javascript projects, either. When you make a native TypeScript project, it just generates the .d.ts for you.
But I think that you have put the .d.ts file in the best place, right alongside the module file. And when it is there, one then can/should unwrap it from the declare module URL { ... }
block and move everything inside up one level. Also I think the line const X3D : X3D
should actually be declare const X3D : X3D
.
I think with those changes if it is published this way on npm and imported into a typescript project, then one can import X3D from 'x_ite' and start calling the functions and they will just typecheck properly. I will make a dummy TypeScript project and install the current x_ite and just put the file modified in this way by hand alongside the module file in node_modules and see if it works and let you know.
from x_ite.
Yes, indeed, that worked, with the one additional change that I had to add a declare
before class X3DField
. The exact file I added in dist is attached to this message, to avoid ambiguity.
So if you ship this file alongside the x_ite JavaScript files, then it should be usable directly from TypeScript, and intellisense should work (although I don't use an IDE, so I can't vouch for that completely). I would recommend it in the next release. Let me know if there is more I can do to help. (And of course, yes, I am sure some improvements to this .d.ts will be needed over time, but I hope it is an OK place to start.)
x_ite.d.ts.txt
from x_ite.
I have tested the new file with VSCode and IntelliSense works fine for both JS and TS files. Thanks for your great efforts. If you have further updates, please let me know.
from x_ite.
Well once it's in an x_ite published release, then thereafter I can just file PRs to this repository with any corrections/improvements that I may find. Thanks!
from x_ite.
I can make a release next Sunday if all is fine, and we have still time for changes.
from x_ite.
OK, I have updated my project to use the .d.ts directly from the develop branch, and it is working OK at the moment. If I discover anything that seems to need a change, I will just file a PR against that branch. Once it's published, I will switch to using it from the main branch, or just grab it from the CDN if it ends up on there too (not sure if it will).
from x_ite.
I have added you to the list of contributors in https://github.com/create3000/x_ite/blob/development/package.json, for that reason it is good idea to make a PR when the file has changed, because GitHub automatically keeps track of it.
from x_ite.
Version 8.12.1 is out now. Please drop me a note if it is working for you.
from x_ite.
Oh dear, seems I overlooked responding -- yes, I am compiling and running fine with the latest version, now 8.12.4. Thanks!
from x_ite.
Related Issues (20)
- npx sunrize [files] HOT 5
- X_ITE React implementation questions HOT 5
- "aspectRatio" not supported? HOT 4
- Despite no errors on the console, X_ITE shows no graphics HOT 10
- Use RENDERER on Firefox HOT 1
- ExternProtoDeclare not downloading? X3D checks in X3D-Edit. HOT 3
- Mono Sound plays only over left speaker HOT 3
- How to start X_ITE in a browser window in fullscreen mode HOT 3
- "Better" webpack.config.js, for Git Bash under Windows 10 HOT 5
- Replace webpack "string-replace-webpack-plugin" or provide dependency overrides in package.json HOT 2
- Adding a new node HOT 13
- Filling up an empty scene with Javascript HOT 8
- IndexedFaceSet solid false and alpha HOT 1
- EnvironmentLight has no effect (noob question number 3) HOT 3
- Unknown node type 'ProtoDeclare' 'ProtoBody' 'InstancedShape' HOT 10
- Behavior of VRML SpotLicht HOT 7
- Strange behavior when using addChildren in VRML HOT 3
- animated directional light off ? HOT 2
- Playground should preserve xml comments
- Stack Overflow (same as sunrize post) with resolution = 200 HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x_ite.