Skip to content
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

Add native public API documentations #11135

Closed
pandamicro opened this issue May 18, 2022 · 11 comments
Closed

Add native public API documentations #11135

pandamicro opened this issue May 18, 2022 · 11 comments
Assignees
Labels
Doc Documentation tasks Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows P1 Must be finished in the milestone
Milestone

Comments

@pandamicro
Copy link
Contributor

Currently there is no doc about how to use jsb APIs, they are absolutely needed for native development. The missing content include but not limited to

  1. Application
  2. FileUtils
  3. PAL related APIs
  4. Native Events
  5. Network

@minggo please give a complete list and assign the tasks

Either we create manual docs which describes briefly all the APIs, or we generate all native APIs from JS Binding tools and make them available in API docs

@pandamicro pandamicro added Doc Documentation tasks P1 Must be finished in the milestone Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows labels May 18, 2022
@pandamicro pandamicro added this to the V3.6 milestone May 18, 2022
@pandamicro pandamicro changed the title Add jsb usage documentations in manual doc Add native API documentations in manual doc May 18, 2022
@pandamicro pandamicro changed the title Add native API documentations in manual doc Add native API documentations May 18, 2022
@pandamicro pandamicro changed the title Add native API documentations Add native public API documentations May 18, 2022
@minggo
Copy link
Contributor

minggo commented May 18, 2022

Ok, i will check which module is needed and suitable to be public in v3.6.0 for native developers.

@minggo
Copy link
Contributor

minggo commented May 18, 2022

And should check if anything is available in ts, but missing documentation.

@minggo
Copy link
Contributor

minggo commented May 18, 2022

JSB related documentation:

Where and how to write the API doc @PPpro

@dumganhar
Copy link
Contributor

JSB related documentation:

jsb.onError
jsb.garbageCollect
jsb.copyTextToClipboard
jsb.saveByteCode
jsb.zipUtils

@dumganhar
Copy link
Contributor

Should EventDispatcher be public for native developers?

@minggo
Copy link
Contributor

minggo commented May 18, 2022

Should EventDispatcher be public for native developers?

If not, then how to listen some events in c++? Some application may do some operations based on these events in C++.

jsb.onError
jsb.copyTextToClipboard
jsb.saveByteCode

Does engine have these features?

@dumganhar
Copy link
Contributor

dumganhar commented May 18, 2022

If not, then how to listen some events in c++? Some application may do some operations based on these events in C++.

Why do developers need to write event registration code by C++ ? In general, he should do it in JS to subcribe touch, mouse, background, foreground ... events. I think EventDispatcher should be private now and it should be only used for dispatching events to JS or interactive with other internal modules.

Does engine have these features?

Yes, I found some code like :

void SystemWindow::copyTextToClipboard(const std::string &text) {
    NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
    [pasteboard clearContents];
    NSString *tmp = [NSString stringWithCString:text.c_str() encoding:NSUTF8StringEncoding];
    [pasteboard setString:tmp forType:NSPasteboardTypeString];
}

@minggo
Copy link
Contributor

minggo commented May 19, 2022

Why do developers need to write event registration code by C++ ? In general, he should do it in JS to subcribe touch, mouse, background, foreground ... events. I think EventDispatcher should be private now and it should be only used for dispatching events to JS or interactive with other internal modules.

It is ok not be public currently.

Yep, we should add docs for copyTextToClipboard .

@minggo
Copy link
Contributor

minggo commented May 30, 2022

@PPpro please describe where and how to write the API.

@minggo minggo removed their assignment May 31, 2022
@PPpro
Copy link
Contributor

PPpro commented Jun 14, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doc Documentation tasks Env: Native General issue on all native platforms including iOS, Android, MacOS, Windows P1 Must be finished in the milestone
Projects
None yet
Development

No branches or pull requests

7 participants