Kind: global class
- Generator
- new Generator(config)
- .configure(config) ⇒
- .addIgnoredOperations(operationNames) ⇒
- .addIgnoredParameters(parameterNames) ⇒
- .setModules(parameters) ⇒
- .use(moduleNamesOrObjects) ⇒
- .emit(phase, event, data) ⇒
- .on(phase, event, data) ⇒
- .onPrepare(event, listener) ⇒
- .onDecorate(event, listener) ⇒
- .onFinalize(event, listener) ⇒
- .write(event, data) ⇒
- .onWrite(event, listener) ⇒
- .process(specs, references)
- .groupOperation(operation) ⇒
- .groupSort(group) ⇒
- .operationSort(operation) ⇒
Represents a Generator
Param | Type | Description |
---|---|---|
config | object |
The configuration object (optional) |
Adds configuration properties
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
config | object |
The configuration object |
Adds known ignored operation names
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
operationNames | Array.<string> |
The list of operation names |
Adds known ignored parameters names
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
parameterNames | Array.<string> |
The list of parameter names |
Sets the internal Modules object to use for resolving modules
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
parameters | Array.<string> |
The list of parameter names |
Loads modules and their dependencies
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
moduleNamesOrObjects | Array.<string> | Array.<object> |
Module objects or names to load |
Emits an event for a given specification scope.
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
phase | string |
The phase name |
event | string |
The event name |
data | object |
The data object to emit |
Registers a listener for a given phase and event.
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
phase | string |
The phase name |
event | string |
The event name |
data | object |
The data object to emit |
Shorthand method to register a listener for 'prepare' phase and given event.
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
event | string |
The event name |
listener | function |
The callback listener function |
Shorthand method to register a listener for 'decorate' phase and given event.
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
event | string |
The event name |
listener | function |
The callback listener function |
Shorthand method to register a listener for 'finalize' phase and given event.
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
event | string |
The event name |
listener | function |
The callback listener function |
Emits a write event
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
event | string |
The event name |
data | object |
The data to write |
Shorthand method to register a write listener for given event.
Kind: instance method of Generator
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
event | string |
The event name |
listener | function |
The callback listener function |
Processes the specification.
Kind: instance method of Generator
Param | Type | Description |
---|---|---|
specs | object | Array.<object> |
One or many specifications loaded by the Loader |
references | object |
(Optional) A manually loaded set of references |
Internal hook that determines the resource and group names for grouping. This method can be overriden with by custom logic.
Kind: instance method of Generator
Returns: the resource and group names object.
Param | Type | Description |
---|---|---|
operation | object |
The operation object |
Internal hook that returns a order index used to sort group names. This method can be overriden with by custom logic.
Kind: instance method of Generator
Returns: the sort index based on the group name
Param | Type | Description |
---|---|---|
group | string |
The group name |
Internal hook that returns a order index used to sort operations. This method can be overriden with by custom logic. This implementation sorts by length of the URI after variables are stripped out.
Kind: instance method of Generator
Returns: the sort index based on the operation
Param | Type | Description |
---|---|---|
operation | object |
The operation object |