Update and cleanup JSDoc

This commit is contained in:
crandmck 2014-04-02 15:46:39 -07:00
parent a265d67007
commit 006aca6b9c
1 changed files with 15 additions and 14 deletions

View File

@ -15,27 +15,29 @@ var express = require('express')
, assert = require('assert'); , assert = require('assert');
/** /**
* `loopback` is the main entry for LoopBack core module. It provides static * Main entry for LoopBack core module. It provides static properties and
* methods to create models and data sources. The module itself is a function * methods to create models and data sources. The module itself is a function
* that creates loopback `app`. For example, * that creates loopback `app`. For example,
* *
*
* ```js * ```js
* var loopback = require('loopback'); * var loopback = require('loopback');
* var app = loopback(); * var app = loopback();
* ``` * ```
*
* @class loopback
* @header loopback
*/ */
var loopback = exports = module.exports = createApplication; var loopback = exports = module.exports = createApplication;
/** /**
* Is this a browser environment? * True if running in a browser environment; false otherwise.
*/ */
loopback.isBrowser = typeof window !== 'undefined'; loopback.isBrowser = typeof window !== 'undefined';
/** /**
* Is this a server environment? * True if running in a server environment; false otherwise.
*/ */
loopback.isServer = !loopback.isBrowser; loopback.isServer = !loopback.isBrowser;
@ -116,11 +118,10 @@ loopback.errorHandler.title = 'Loopback';
/** /**
* Create a data source with passing the provided options to the connector. * Create a data source with passing the provided options to the connector.
* *
* @param {String} name (optional) * @param {String} name Optional name.
* @param {Object} options * @options {Object} Data Source options
* * @property {Object} connector LoopBack connector.
* - connector - an loopback connector * @property {*} Other properties See the relevant connector documentation.
* - other values - see the specified `connector` docs
*/ */
loopback.createDataSource = function (name, options) { loopback.createDataSource = function (name, options) {
@ -141,7 +142,7 @@ loopback.createDataSource = function (name, options) {
/** /**
* Create a named vanilla JavaScript class constructor with an attached set of properties and options. * Create a named vanilla JavaScript class constructor with an attached set of properties and options.
* *
* @param {String} name - must be unique * @param {String} name Unique name.
* @param {Object} properties * @param {Object} properties
* @param {Object} options (optional) * @param {Object} options (optional)
*/ */
@ -223,7 +224,7 @@ loopback.memory = function (name) {
/** /**
* Look up a model class by name from all models created by loopback.createModel() * Look up a model class by name from all models created by loopback.createModel()
* @param {String} modelName The model name * @param {String} modelName The model name
* @return {Model} The model class * @returns {Model} The model class
*/ */
loopback.getModel = function(modelName) { loopback.getModel = function(modelName) {
return loopback.Model.modelBuilder.models[modelName]; return loopback.Model.modelBuilder.models[modelName];
@ -233,7 +234,7 @@ loopback.getModel = function(modelName) {
* Look up a model class by the base model class. The method can be used by LoopBack * Look up a model class by the base model class. The method can be used by LoopBack
* to find configured models in models.json over the base model. * to find configured models in models.json over the base model.
* @param {Model} The base model class * @param {Model} The base model class
* @return {Model} The subclass if found or the base class * @returns {Model} The subclass if found or the base class
*/ */
loopback.getModelByType = function(modelType) { loopback.getModelByType = function(modelType) {
assert(typeof modelType === 'function', 'The model type must be a constructor'); assert(typeof modelType === 'function', 'The model type must be a constructor');
@ -250,7 +251,7 @@ loopback.getModelByType = function(modelType) {
* Set the default `dataSource` for a given `type`. * Set the default `dataSource` for a given `type`.
* @param {String} type The datasource type * @param {String} type The datasource type
* @param {Object|DataSource} dataSource The data source settings or instance * @param {Object|DataSource} dataSource The data source settings or instance
* @return {DataSource} The data source instance * @returns {DataSource} The data source instance
*/ */
loopback.setDefaultDataSourceForType = function(type, dataSource) { loopback.setDefaultDataSourceForType = function(type, dataSource) {
@ -267,7 +268,7 @@ loopback.setDefaultDataSourceForType = function(type, dataSource) {
/** /**
* Get the default `dataSource` for a given `type`. * Get the default `dataSource` for a given `type`.
* @param {String} type The datasource type * @param {String} type The datasource type
* @return {DataSource} The data source instance * @returns {DataSource} The data source instance
*/ */
loopback.getDefaultDataSourceForType = function(type) { loopback.getDefaultDataSourceForType = function(type) {