import TransformFormat from 'typhonjs-escomplex-commons/src/transform/TransformFormat.js'
TransformFormat
Static Method Summary
Static Public Methods | ||
public static |
Adds a formatter to the static Map by type: |
|
public static |
Invokes the callback for each stored formatter. |
|
public static |
forEachExt(extension: string, callback: function, thisArg: object) Provides a |
|
public static |
forEachType(type: string, callback: function, thisArg: object) Provides a |
|
public static |
format(report: ClassReport | MethodReport | ModuleReport | ProjectReport, name: string, options: object): string Formats a given ModuleReport or ProjectReport via the formatter of the requested type. |
|
public static |
getFormats(reportType: ReportType): string[] Returns the supported format file extension types. |
|
public static |
Returns whether a given formatter by name is available. |
|
public static |
isSupported(name: string, reportType: ReportType): boolean Returns whether a given formatter by name is supports a given report. |
|
public static |
removeFormat(name: string) Removes a formatter from the static Map by name. |
Static Public Methods
public static addFormat(format: object) source
Adds a formatter to the static Map by type: format.type
.
Params:
Name | Type | Attribute | Description |
format | object | An instance of an object conforming to the module / project transform format API. |
public static forEach(callback: function, thisArg: object) source
Invokes the callback for each stored formatter.
public static forEachExt(extension: string, callback: function, thisArg: object) source
Provides a forEach
variation that invokes the callback if the given extension matches that of a stored
formatter.
public static forEachType(type: string, callback: function, thisArg: object) source
Provides a forEach
variation that invokes the callback if the given type matches that of a stored
formatter.
public static format(report: ClassReport | MethodReport | ModuleReport | ProjectReport, name: string, options: object): string source
Formats a given ModuleReport or ProjectReport via the formatter of the requested type.
Params:
Name | Type | Attribute | Description |
report | ClassReport | MethodReport | ModuleReport | ProjectReport | A report to format. |
|
name | string | The name of formatter to invoke. |
|
options | object | (Optional) One or more optional parameters to pass to the formatter. |
public static getFormats(reportType: ReportType): string[] source
Returns the supported format file extension types.
Params:
Name | Type | Attribute | Description |
reportType | ReportType | (Optional) A ReportType to filter supported formats. |
public static isFormat(name: string): boolean source
Returns whether a given formatter by name is available.
Params:
Name | Type | Attribute | Description |
name | string | The name of the formatter: |
public static isSupported(name: string, reportType: ReportType): boolean source
Returns whether a given formatter by name is supports a given report.
Params:
Name | Type | Attribute | Description |
name | string | The name of the formatter: |
|
reportType | ReportType | A ReportType to check for support. |