processor (processor.html)

Add a new processor to the package. The processor can be defined by a processor definition object or a factory function, which can be injected with services and will return the processor definition object. The following properties of a processor definition object have special meaning to Dgeni: * `name : {string}`: The name of the processor - if the processor is defined by a factory function or a name is explicitly provided as the first parameter, then this is ignored * `$process(docs : {string}) : {Array|Promise|undefined}`: The method that will be called to process the documents. If it is async then it should return a Promise. * `$runAfter : {string[]}`: Dgeni will ensure that this processor runs after those named here. * `$runBefore : {string[]}`: Dgeni will ensure that this processor runs before those named here. * `$validate: {Object}`: Dgeni will check that the properties of the processor, which match the keys of this object, pass the validation rules provided as the values of this object. See http://validatejs.org

Params

Returns

{ Package } - `this` package, to allow methods to be chained.