-
Notifications
You must be signed in to change notification settings - Fork 145
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
[feature request] add @types/RiveScript package #318
Comments
Hi, I don't personally use TypeScript and the definition file was contributed by a GitHub user. If it's out of date, consider sending a pull request with an updated definition file. The @types user on npm seems to mostly publish their type definitions from https://github.com/DefinitelyTyped/DefinitelyTyped so you could ask there about making an @types/rivescript package for npm. |
@MrBokeh What doesn't work well exactly? I use TypeScript with RiveScript, too, but I don't have any issues currently. If you describe them here and they're reproducible I can help with any necessary changes! |
I use TypeScript and RiveScript on the frontend with Angular with cause all sort of issues. If you use TypeScript and RiveScript with NodeJS on the backend it will work, so here are the problems:
|
@MrBokeh Can you post your TypeScript version and the contents of your
This one doesn't make sense to me—if you're using it on the front end it doesn't require "exclude": [
"node_modules"
// ...
] ...in your
Hm, that's a valid concern. @kirsle maybe where it looks for process.browser it could instead do something like... if ((typeof process !== 'undefined' && process.browser) || typeof window === 'undefined') {
return "web";
} ...since
The
Don't quite understand this one. Yes, if you want to use, e.g., |
Re: the runtime detection for node vs. web environment, the old way used to check for Something like that could be added back in as an extra fallback in case |
Hi @kjleitz, thanks for your reply.
In order to do import RiveScript from "rivescript"; I need to enable the following on tsconfig:
But if the .d.ts file is working fine I don't need to do those settings just like most of the library out there. |
I do believe you'll need to use
Could you post your |
Is there any progress on this topic? I have the same issue when I import RiveScript.
Workaround:
tsconfig.json
|
Ah okay so @ArkasDev you may have a couple problems here. I can't say for certain, but a few things that stand out:
tl;dr:
Try that out and see if it works. If it doesn't, consider moving to |
The existing type file doesn’t work with TypeScript very well in angular, suggest to create @types/rivescript package in npm
The text was updated successfully, but these errors were encountered: