Javascript API documentation

Hey, I know there are PHP docs of the public API for nextcloud. Are there such things for the JavaScript components? Or are those considered not public APIs?

2 Likes

There’s OC.generateUrl(), everything else is not considered to be public afaik.

That can’t possibly be true. What about all the tooling to add menu items in the files view. Or common dialogs/notifications. What about stuff like OC.Files.Client and OC.Files.FileInfo for file access? That seems like a recipe for disaster if those interfaces are not considered “safe” to use.

Well, you can use them if you want to, its not like they dont work :slight_smile:

In general: frontend code (also CSS) change way more often than backend code and there is no clear deprecation/change timeline. But that’s totally fine since everyone rolls his own stuff. It’s not like you can implement anything useful that isnt totally outdated in a year.

As for dialogs/notifications: dialogs (modals) are usually bad UX and you absolutely shouldn’t use them. The notification system itself is so minimal that it probably won’t work for you. And placing a modal/notification in your app is close to 0 work.

TL;DR: it’s a non issue. You just assume its one :slight_smile:

It is an issue because a) if its out of date a year later the platform is not viable yet, and b) if everyone rolls their own the platform is not viable.

<rant> This has always been a problem with OC/NC in my mind. I appreciate you write an app for NC so you may be used to the abuse. Over the last few years I have been a contributor to over 20 projects (seriously, I counted for this email) so I am turned off by this. I think there needs to be some focus on building an API for reuse, not throwing in every JS toolkit known to the human race. Just my 2c </rant>.

Either way does anyone have a vision for a frontend API?

3 Likes