Skip to content

Commit

Permalink
doc: Improve inline docs for decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Dec 16, 2016
1 parent 969f394 commit a345f51
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/Decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {Transforms, DefaultTransforms} from "./Transforms";

/**
* Specifies the name of the collection to which this instance's documents should be sent.
* @param name The name of the MongoDB collection to store the documents in.
* @param {string} name The name of the MongoDB collection to store the documents in.
*
* This decorator replaces the use of the static collection property on instance implementation
* classes. If your transpiler does not support decorators then you are free to make use of the
Expand All @@ -25,8 +25,8 @@ export function Collection(name: string) {
/**
* Specifies a MongoDB collection level index to be managed by Iridium for this instance type.
* More than one instance of this decorator may be used if you wish to specify multiple indexes.
* @param spec The formal index specification which defines the properties and ordering used in the index.
* @param options The options dictating the way in which the index behaves.
* @param {IndexSpecification} spec The formal index specification which defines the properties and ordering used in the index.
* @param {MongoDB.IndexOptions} options The options dictating the way in which the index behaves.
*
* This decorator replaces the use of the static indexes property on instance implementation
* classes. If your transpiler does not support decorators then you are free to make use of the
Expand All @@ -41,8 +41,8 @@ export function Index(spec: IndexSpecification, options?: MongoDB.IndexOptions)
/**
* Specifies a custom validator to be made available for this collection's schema.
* More than one instance of this decorator may be used if you wish to specify multiple validators.
* @param forType The value in the schema which will be delegated to this function for validation.
* @param validate A function which calls this.assert(condition) to determine whether a schema node is valid or not.
* @param {Object} forType The value in the schema which will be delegated to this function for validation.
* @param {function} validate A function which calls this.assert(condition) to determine whether a schema node is valid or not.
*
* This decorator replaces the use of the static validators property on instance implementation
* classes. If your transpiler does not support decorators then you are free to make use of the
Expand All @@ -59,17 +59,17 @@ export function Validate(forType: any, validate: Skmatc.IValidationHandler) {
* static schema property on your instance. Multiple instances of this decorator can be applied, but no more
* than one per property.
*
* @param asType The schema validation type to make use of for this property
* @param required Whether this property is required to have a value or not, defaults to true.
* @param {Object} asType The schema validation type to make use of for this property
* @param {Boolean} [required] Whether this property is required to have a value or not, defaults to true.
*/
export function Property(asType: any, required?: boolean): (target: Instance<any, any>, name: string) => void;
/**
* Specifies the schema type for a property with the given name on the class this decorator is applied to. This
* can either compliment or replace the static schema property on your instance class.
*
* @param name The name of the property that is being targetted
* @param asType The schema validation type to make use of for this property
* @param required Whether this property is required to have a value or not, defaults to true.
* @param {String} name The name of the property that is being targetted
* @param {Object} asType The schema validation type to make use of for this property
* @param {Boolean} [required] Whether this property is required to have a value or not, defaults to true.
*/
export function Property(name: string, asType: any, required?: boolean): (target: InstanceImplementation<any, any>) => void;
export function Property(...args: any[]): (target: Instance<any, any> | InstanceImplementation<any, any>, name?: string) => void {
Expand Down Expand Up @@ -98,8 +98,8 @@ export function Property(...args: any[]): (target: Instance<any, any> | Instance
/**
* Specifies a custom transform to be applied to the property this decorator is applied to.
*
* @param fromDB The function used to convert values from the database for the application.
* @param toDB The function used to convert values from the application to the form used in the database.
* @param {function} fromDB The function used to convert values from the database for the application.
* @param {function} toDB The function used to convert values from the application to the form used in the database.
*
* This decorator can either compliment or replace the static transforms property on your instance
* class, however only one transform can be applied to any property at a time.
Expand Down

0 comments on commit a345f51

Please sign in to comment.