CocoonJS namespace. Each extension has it's own namespace upon the CocoonJS namespace. Although the APIs are easy to use, some general explanation on their structure could be useful:
- Extension files: All the extensions are provided in .js files. All the files start with the
CocoonJSprefix. There is a basic general purpose file called
CocoonJS.jsthat defines the basic namespace and should be included the first in your app. Each extension use a different suffix after an underscore '_'. For example, the general purpose extension is defined inside the
CocoonJS_App.jsfile. There are some extensions that provide specific functionalities for CocoonJS and the WebView environments. In these cases, an additional suffix is used after another underscore. The extension functionalities for CocoonJS environment use the
ForCocoonJSsuffix and the extension functionalities for the WebView environment use the
ForWebViewsuffix. For example, the basic extensions functionalities just for the CocoonJS environment are stored in a file called
CocoonJS_App_ForCocoonJS.js(and a similar one called
CocoonJS_App_ForWebView.jsfor the WebView environment). Read the ''CocoonJS and the WebView'' section for more information.
- Data Structures: Some extension namespaces expose some data structures that are related to the extension use. Some of these structures are plain enumerations of possible values and others represent structures that will be passed to or from extension functions or extension events.
- Functions: The CocoonJS extensions expose a set a functions that provide the functionality.
- Event Objects/Handlers: The CocoonJS extensions use a event object mechanism in order to provide callback functionality for some events or asynchronous return of some function calls. All the CocoonJS event objects always follow the same structure. They are objects that represent the event handlers and all of them provide
functions. A callback function with certain signature must be passed to these functions to register/unregister as listeners of the corresponding event.
Please, refer to the documentation of each extension in order to get more information on the data structures, functions and event objects of each one.
All the functionalities related to the CocoonJS and WebView handling are documented in the CocoonJS Basic Extensions section.