-
Notifications
You must be signed in to change notification settings - Fork 121
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
npm run -s -- ndts . > lib-types.d.ts doesn't seem to do anything #99
Comments
Can you share your C++ code? Is there an |
Hey jjrv, all code I have can be temporarily found at https://bitbucket.org/kayvanbree/screencapture/overview. The c++ code was the following (based on the example): #include <string>
#include <iostream>
struct Streaming {
static void sayHello(std::string name) {
std::cout
<< "Hello, "
<< name << "!\n";
}
};
#include "nbind/nbind.h"
NBIND_CLASS(Streaming) {
method(sayHello);
} When I add the following to index.html I get an error: <script>
var nbind = require('nbind');
var lib = nbind.init().lib;
lib.Streaming.sayHello('something');
</script> The error is:
Another quick question: Is it possible to get a video stream to a canvas / video through nbind? |
So I created a fresh installation without Electron or any code, just following the tutorial from the nbind readme. TypeScript seems to be generated now, but I got another error message than before:
I think this should contain the path information of my compiled module. Am I right about that? Another thing: I get multiple warnings while compiling looking like this:
|
@jjrv I finally figured out that I forgot to include "ndts": "ndts" to my package.json. lib-types.d.ts is now actually generated with my class and method, like this: import { Buffer } from "nbind/dist/shim";
export class NBindBase { free?(): void }
export class Streaming extends NBindBase {
/** static void sayHello(std::string); */
static sayHello(p0: string): void;
} However, when I start my application (either on localhost or as Electron application) I get the following error:
I was wondering if you might be willing to publish an example how to use nbind with TypeScript. If I get this running I will publish a repository with an Angular Electron example. |
I'm working on Windows in WebStorm, I have an Angular 5 electron app up and running and I want to create a nodejs extension so I can use opencv in c++.
When running the
npm run -s -- ndts . > lib-types.d.ts
ndts doesn't generate anything inside lib-types.d.ts. Therefor TypeScript doesn't recognize lib-types as a module. Compiling seems to work as I have a build folder with my obj file.When running the command it doesn't print anything to the console, so I can't figure out what's going wrong. Can you help me figure out what is wrong? I can provide more information, when I know what information to provide.
The text was updated successfully, but these errors were encountered: