Javascript.index.mustache Maven / Gradle / Ivy
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['./ApiClient'{{#models}}, './{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, './{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('./ApiClient'){{#models}}, require('./{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'){{/models}}{{#apiInfo}}{{#apis}}, require('./{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'){{/apis}}{{/apiInfo}});
}
}(function(ApiClient{{#models}}{{#model}}, {{classFilename}}{{/model}}{{/models}}{{#apiInfo}}{{#apis}}, {{importPath}}{{/apis}}{{/apiInfo}}) {
'use strict';
{{#emitJSDoc}} /**{{#projectDescription}}
* {{projectDescription}}.
{{/projectDescription}}
* The index
module provides access to constructors for all the classes which comprise the public API.
*
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
*
* var {{moduleName}} = require('./index'); // See note below*.
* var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
* var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
*
* *NOTE: For a top-level AMD script, use require(['./index'], function(){...}) and put the application logic within the
* callback function.
*
*
* A non-AMD browser application (discouraged) might do something like this:
*
* var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
* var yyy = new {{moduleName}}.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
*
*
* @module index
* @version {{projectVersion}}
*/{{/emitJSDoc}}
{{=< >=}} var exports = {<#emitJSDoc>
/**
* The ApiClient constructor.
* @property {module:ApiClient}
*/
ApiClient: ApiClient<#models>,<#emitJSDoc>
/**
* The model constructor.
* @property {module:<#modelPackage>/ }
*/
: <#apiInfo><#apis>,<#emitJSDoc>
/**
* The service constructor.
* @property {module:<#apiPackage>/ }
*/
:
};
return exports;<={{ }}=>
}));