-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support core.query_model() #25016
Support core.query_model() #25016
Conversation
@vishniakov-nikolai I need some help with writing Tests for this. |
|
||
Napi::Value CoreWrap::query_model(const Napi::CallbackInfo& info) { | ||
try { | ||
if (info.Length() < 2 || !info[0].IsObject() || !info[1].IsString()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should check if info[0] contain model object like this:
const auto& model_prototype = info.Env().GetInstanceData<AddonData>()->model; if (model_prototype && model.InstanceOf(model_prototype.Value().As<Napi::Function>())) { }
The exact form of this condition I leave to you ;)
@@ -68,7 +68,17 @@ class CoreWrap : public Napi::ObjectWrap<CoreWrap> { | |||
Napi::Value set_property(const Napi::CallbackInfo& info); | |||
Napi::Value get_property(const Napi::CallbackInfo& info); | |||
|
|||
/** @brief Query device if it supports the specified model with specified properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this description to addon.ts
You will have to rewrite it according to typedoc
You can look at how other methods in addon.ts are described
The test should be put in this file:
|
This PR will be closed in a week because of 2 weeks of no activity. |
Hi @hegdeadithyak! To prevent close of this PR, please add fresh commit to it or let us know if you need more time. Thank you! |
Details:
Added Query Model to C++ Core Class and Updated TS addons
Solves : #24373