import { Reporter } from '../reporter/reporter.js';
import { InfoComponent } from '../component/info_component.js';
import { checkPropTypes, semverRegex, UUIDRegex } from '../lib.js';
import { WrappedMaterial } from '../package/material/wrapped_material.js';
/**
* Configuration info
*/
class ConfigurationInfo extends InfoComponent {
/**
* @param {Reporter} reporter
* @param {Object} settings
* @param {string} settings.name
* @param {URL} settings.packageURL
* @param {UUID} settings.packageId
* @param {number} settings.step
* @param {WrappedMaterial} [settings.lastUsedMaterial]
* @param {WrappedMaterial} [settings.defaultMaterial]
* @param {string} [settings.creationDate]
* @param {string} [settings.author]
*/
constructor(reporter, settings) {
super(reporter, settings);
checkPropTypes(
settings,
{
name: 'string',
packageURL: URL,
packageId: UUIDRegex,
},
{
creationDate: "string",
author: "string",
lastUsedMaterial: WrappedMaterial,
defaultMaterial: WrappedMaterial,
}
);
// mf typescript
if ( ! Object.getOwnPropertyDescriptor(this, 'step')) {
this.step = settings.step;
}
}
static _exportName = {
singular: 'info',
plural: 'info'
};
}
export { ConfigurationInfo };