diff --git a/src/index.ts b/src/index.ts index a9f154079..e91d5a77e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,6 +28,8 @@ export { } from "./lib/output"; export type { RenderTemplate, RendererHooks } from "./lib/output"; +export { Validator } from "./lib/validation"; + export { ArgumentsReader, BindOption, diff --git a/src/lib/validation/index.ts b/src/lib/validation/index.ts new file mode 100644 index 000000000..db7351171 --- /dev/null +++ b/src/lib/validation/index.ts @@ -0,0 +1 @@ +export { Validator } from "./validator"; diff --git a/src/lib/validation/validator-events.ts b/src/lib/validation/validator-events.ts new file mode 100644 index 000000000..6eaf8a137 --- /dev/null +++ b/src/lib/validation/validator-events.ts @@ -0,0 +1,3 @@ +export const ValidatorEvents = { + RUN: "run_validator", +} as const; diff --git a/src/lib/validation/validator.ts b/src/lib/validation/validator.ts index 840e88cae..23684bfa0 100644 --- a/src/lib/validation/validator.ts +++ b/src/lib/validation/validator.ts @@ -6,6 +6,7 @@ import { ValidatorComponent } from "./components"; import { validateExports } from "./exports"; import { validateDocumentation } from "./documentation"; import { validateLinks } from "./links"; +import { ValidatorEvents } from "./validator-events"; @Component({ name: "validator", @@ -16,6 +17,17 @@ export class Validator extends ChildableComponent< Application, ValidatorComponent > { + /** + * General events + */ + + /** + * Triggered when the converter begins converting a project. + * The listener will be given a {@link Context} object. + * @event + */ + static readonly EVENT_RUN = ValidatorEvents.RUN; + constructor(owner: Application) { super(owner); } @@ -44,6 +56,8 @@ export class Validator extends ChildableComponent< validateLinks(project, this.application.logger); } + this.trigger(Validator.EVENT_RUN); + this.application.logger.verbose( `Validation took ${Date.now() - start}ms` );