diff --git a/src/lib/application.ts b/src/lib/application.ts index fb9dca565..d36d3a3a1 100644 --- a/src/lib/application.ts +++ b/src/lib/application.ts @@ -261,7 +261,7 @@ export class Application extends ChildableComponent< /** * Return the application / root component instance. */ - get application(): NeverIfInternal { + override get application(): NeverIfInternal { this.logger.deprecated( "Application.application is deprecated. Plugins are now passed the application instance when loaded." ); @@ -666,7 +666,7 @@ export class Application extends ChildableComponent< /** * Print the version number. */ - toString() { + override toString() { return [ "", `TypeDoc ${Application.VERSION}`, diff --git a/src/lib/converter/plugins/CategoryPlugin.ts b/src/lib/converter/plugins/CategoryPlugin.ts index 8dbce6f32..e640611eb 100644 --- a/src/lib/converter/plugins/CategoryPlugin.ts +++ b/src/lib/converter/plugins/CategoryPlugin.ts @@ -34,7 +34,7 @@ export class CategoryPlugin extends ConverterComponent { /** * Create a new CategoryPlugin instance. */ - initialize() { + override initialize() { this.listenTo( this.owner, { diff --git a/src/lib/converter/plugins/CommentPlugin.ts b/src/lib/converter/plugins/CommentPlugin.ts index 9e8da26a7..0883da92e 100644 --- a/src/lib/converter/plugins/CommentPlugin.ts +++ b/src/lib/converter/plugins/CommentPlugin.ts @@ -60,7 +60,7 @@ export class CommentPlugin extends ConverterComponent { /** * Create a new CommentPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration, [Converter.EVENT_CREATE_SIGNATURE]: this.onDeclaration, diff --git a/src/lib/converter/plugins/DecoratorPlugin.ts b/src/lib/converter/plugins/DecoratorPlugin.ts index 9d68f7ddf..1b426fbdc 100644 --- a/src/lib/converter/plugins/DecoratorPlugin.ts +++ b/src/lib/converter/plugins/DecoratorPlugin.ts @@ -16,7 +16,7 @@ export class DecoratorPlugin extends ConverterComponent { /** * Create a new ImplementsPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration, [Converter.EVENT_CREATE_PARAMETER]: this.onDeclaration, diff --git a/src/lib/converter/plugins/DeepCommentPlugin.ts b/src/lib/converter/plugins/DeepCommentPlugin.ts index d1ce92a58..fe8335c06 100644 --- a/src/lib/converter/plugins/DeepCommentPlugin.ts +++ b/src/lib/converter/plugins/DeepCommentPlugin.ts @@ -18,7 +18,7 @@ export class DeepCommentPlugin extends ConverterComponent { /** * Create a new CommentHandler instance. */ - initialize() { + override initialize() { this.listenTo( this.owner, Converter.EVENT_RESOLVE_BEGIN, diff --git a/src/lib/converter/plugins/GitHubPlugin.ts b/src/lib/converter/plugins/GitHubPlugin.ts index 717146aae..b72aef39d 100644 --- a/src/lib/converter/plugins/GitHubPlugin.ts +++ b/src/lib/converter/plugins/GitHubPlugin.ts @@ -188,7 +188,7 @@ export class GitHubPlugin extends ConverterComponent { * * @param converter The converter this plugin should be attached to. */ - initialize() { + override initialize() { if (git("--version").status === 0) { this.listenTo( this.owner, diff --git a/src/lib/converter/plugins/GroupPlugin.ts b/src/lib/converter/plugins/GroupPlugin.ts index 954744d51..17d76c3b6 100644 --- a/src/lib/converter/plugins/GroupPlugin.ts +++ b/src/lib/converter/plugins/GroupPlugin.ts @@ -45,7 +45,7 @@ export class GroupPlugin extends ConverterComponent { /** * Create a new GroupPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [Converter.EVENT_RESOLVE]: this.onResolve, [Converter.EVENT_RESOLVE_END]: this.onEndResolve, diff --git a/src/lib/converter/plugins/ImplementsPlugin.ts b/src/lib/converter/plugins/ImplementsPlugin.ts index d8e7ba226..c252e9198 100644 --- a/src/lib/converter/plugins/ImplementsPlugin.ts +++ b/src/lib/converter/plugins/ImplementsPlugin.ts @@ -24,7 +24,7 @@ export class ImplementsPlugin extends ConverterComponent { /** * Create a new ImplementsPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, Converter.EVENT_RESOLVE, this.onResolve, -10); this.listenTo( this.owner, diff --git a/src/lib/converter/plugins/InheritDocPlugin.ts b/src/lib/converter/plugins/InheritDocPlugin.ts index 319d7866d..becf7146b 100644 --- a/src/lib/converter/plugins/InheritDocPlugin.ts +++ b/src/lib/converter/plugins/InheritDocPlugin.ts @@ -30,7 +30,7 @@ export class InheritDocPlugin extends ConverterComponent { /** * Create a new InheritDocPlugin instance. */ - initialize() { + override initialize() { this.listenTo( this.owner, { diff --git a/src/lib/converter/plugins/PackagePlugin.ts b/src/lib/converter/plugins/PackagePlugin.ts index af2fe4954..e4219fa41 100644 --- a/src/lib/converter/plugins/PackagePlugin.ts +++ b/src/lib/converter/plugins/PackagePlugin.ts @@ -32,7 +32,7 @@ export class PackagePlugin extends ConverterComponent { /** * Create a new PackageHandler instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [Converter.EVENT_BEGIN]: this.onBegin, [Converter.EVENT_RESOLVE_BEGIN]: this.onBeginResolve, diff --git a/src/lib/converter/plugins/SourcePlugin.ts b/src/lib/converter/plugins/SourcePlugin.ts index 77f618fd3..67ccbc790 100644 --- a/src/lib/converter/plugins/SourcePlugin.ts +++ b/src/lib/converter/plugins/SourcePlugin.ts @@ -38,7 +38,7 @@ export class SourcePlugin extends ConverterComponent { /** * Create a new SourceHandler instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [Converter.EVENT_END]: this.onEnd, [Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration, diff --git a/src/lib/converter/plugins/TypePlugin.ts b/src/lib/converter/plugins/TypePlugin.ts index c139a9302..6e419c638 100644 --- a/src/lib/converter/plugins/TypePlugin.ts +++ b/src/lib/converter/plugins/TypePlugin.ts @@ -18,7 +18,7 @@ export class TypePlugin extends ConverterComponent { /** * Create a new TypeHandler instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [Converter.EVENT_RESOLVE]: this.onResolve, [Converter.EVENT_RESOLVE_END]: this.onResolveEnd, diff --git a/src/lib/models/reflections/container.ts b/src/lib/models/reflections/container.ts index 70891e9bd..0e7cbd19f 100644 --- a/src/lib/models/reflections/container.ts +++ b/src/lib/models/reflections/container.ts @@ -42,7 +42,7 @@ export class ContainerReflection extends Reflection { * * @param callback The callback function that should be applied for each child reflection. */ - traverse(callback: TraverseCallback) { + override traverse(callback: TraverseCallback) { for (const child of this.children ?? []) { if (callback(child, TraverseProperty.Children) === false) { return; diff --git a/src/lib/models/reflections/declaration.ts b/src/lib/models/reflections/declaration.ts index f2c39d813..1db062895 100644 --- a/src/lib/models/reflections/declaration.ts +++ b/src/lib/models/reflections/declaration.ts @@ -137,7 +137,7 @@ export class DeclarationReflection */ typeHierarchy?: DeclarationHierarchy; - hasGetterOrSetter(): boolean { + override hasGetterOrSetter(): boolean { return !!this.getSignature || !!this.setSignature; } @@ -177,7 +177,7 @@ export class DeclarationReflection * * @param callback The callback function that should be applied for each child reflection. */ - traverse(callback: TraverseCallback) { + override traverse(callback: TraverseCallback) { for (const parameter of this.typeParameters ?? []) { if (callback(parameter, TraverseProperty.TypeParameter) === false) { return; @@ -236,7 +236,7 @@ export class DeclarationReflection /** * Return a string representation of this reflection. */ - toString(): string { + override toString(): string { let result = super.toString(); if (this.typeParameters) { diff --git a/src/lib/models/reflections/parameter.ts b/src/lib/models/reflections/parameter.ts index 6daf690af..381ca820c 100644 --- a/src/lib/models/reflections/parameter.ts +++ b/src/lib/models/reflections/parameter.ts @@ -12,7 +12,7 @@ export class ParameterReflection extends Reflection implements DefaultValueContainer, TypeContainer { - parent?: SignatureReflection; + override parent?: SignatureReflection; defaultValue?: string; @@ -26,7 +26,7 @@ export class ParameterReflection * * @param callback The callback function that should be applied for each child reflection. */ - traverse(callback: TraverseCallback) { + override traverse(callback: TraverseCallback) { if (this.type instanceof ReflectionType) { if ( callback( @@ -44,7 +44,7 @@ export class ParameterReflection /** * Return a string representation of this reflection. */ - toString() { + override toString() { return super.toString() + (this.type ? ":" + this.type.toString() : ""); } } diff --git a/src/lib/models/reflections/project.ts b/src/lib/models/reflections/project.ts index 7402f543f..0f5d6d9fd 100644 --- a/src/lib/models/reflections/project.ts +++ b/src/lib/models/reflections/project.ts @@ -49,7 +49,7 @@ export class ProjectReflection extends ContainerReflection { * The name can be passed as a command line argument or it is read from the package info. * this.name is assigned in the Reflection class. */ - name!: string; + override name!: string; /** * The contents of the readme.md file of the project when found. @@ -73,7 +73,7 @@ export class ProjectReflection extends ContainerReflection { /** * Return whether this reflection is the root / project reflection. */ - isProject(): this is ProjectReflection { + override isProject(): this is ProjectReflection { return true; } @@ -95,7 +95,9 @@ export class ProjectReflection extends ContainerReflection { * @param names The name hierarchy to look for, if a string, the name will be split on "." * @return The found reflection or undefined. */ - findReflectionByName(arg: string | string[]): Reflection | undefined { + override findReflectionByName( + arg: string | string[] + ): Reflection | undefined { const names: string[] = Array.isArray(arg) ? arg : splitUnquotedString(arg, "."); diff --git a/src/lib/models/reflections/signature.ts b/src/lib/models/reflections/signature.ts index 394486690..3b8065362 100644 --- a/src/lib/models/reflections/signature.ts +++ b/src/lib/models/reflections/signature.ts @@ -26,14 +26,14 @@ export class SignatureReflection super(name, kind, parent); } - kind!: + override kind!: | ReflectionKind.SetSignature | ReflectionKind.GetSignature | ReflectionKind.IndexSignature | ReflectionKind.CallSignature | ReflectionKind.ConstructorSignature; - parent!: DeclarationReflection; + override parent!: DeclarationReflection; parameters?: ParameterReflection[]; @@ -85,7 +85,7 @@ export class SignatureReflection * * @param callback The callback function that should be applied for each child reflection. */ - traverse(callback: TraverseCallback) { + override traverse(callback: TraverseCallback) { if (this.type instanceof ReflectionType) { if ( callback( @@ -115,7 +115,7 @@ export class SignatureReflection /** * Return a string representation of this reflection. */ - toString(): string { + override toString(): string { let result = super.toString(); if (this.typeParameters) { diff --git a/src/lib/models/reflections/type-parameter.ts b/src/lib/models/reflections/type-parameter.ts index 596237f1d..055856dfc 100644 --- a/src/lib/models/reflections/type-parameter.ts +++ b/src/lib/models/reflections/type-parameter.ts @@ -6,7 +6,7 @@ export class TypeParameterReflection extends Reflection implements TypeContainer { - parent?: DeclarationReflection; + override parent?: DeclarationReflection; type?: Type; diff --git a/src/lib/models/types/array.ts b/src/lib/models/types/array.ts index dfd3b56aa..4340ae9c0 100644 --- a/src/lib/models/types/array.ts +++ b/src/lib/models/types/array.ts @@ -18,7 +18,7 @@ export class ArrayType extends Type { /** * The type name identifier. */ - readonly type = "array"; + override readonly type = "array"; /** * Create a new TupleType instance. @@ -45,7 +45,7 @@ export class ArrayType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: Type): boolean { + override equals(type: Type): boolean { if (!(type instanceof ArrayType)) { return false; } @@ -55,7 +55,7 @@ export class ArrayType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { const elementTypeStr = this.elementType.toString(); if ( this.elementType instanceof UnionType || diff --git a/src/lib/models/types/conditional.ts b/src/lib/models/types/conditional.ts index 153e02cf6..9f76ca4cf 100644 --- a/src/lib/models/types/conditional.ts +++ b/src/lib/models/types/conditional.ts @@ -12,7 +12,7 @@ export class ConditionalType extends Type { /** * The type name identifier. */ - readonly type: string = "conditional"; + override readonly type: string = "conditional"; constructor( public checkType: Type, @@ -43,7 +43,7 @@ export class ConditionalType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: any): boolean { + override equals(type: any): boolean { if (!(type instanceof ConditionalType)) { return false; } @@ -58,7 +58,7 @@ export class ConditionalType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { return ( this.checkType + " extends " + diff --git a/src/lib/models/types/indexed-access.ts b/src/lib/models/types/indexed-access.ts index 959f8a8ca..aa0736a0c 100644 --- a/src/lib/models/types/indexed-access.ts +++ b/src/lib/models/types/indexed-access.ts @@ -7,7 +7,7 @@ export class IndexedAccessType extends Type { /** * The type name identifier. */ - readonly type = "indexedAccess"; + override readonly type = "indexedAccess"; /** * Create a new TupleType instance. @@ -33,7 +33,7 @@ export class IndexedAccessType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: Type): boolean { + override equals(type: Type): boolean { if (!(type instanceof IndexedAccessType)) { return false; } @@ -46,7 +46,7 @@ export class IndexedAccessType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { return `${this.objectType.toString()}[${this.indexType.toString()}]`; } } diff --git a/src/lib/models/types/inferred.ts b/src/lib/models/types/inferred.ts index a03934c79..4f9ee953d 100644 --- a/src/lib/models/types/inferred.ts +++ b/src/lib/models/types/inferred.ts @@ -11,7 +11,7 @@ export class InferredType extends Type { /** * The type name identifier. */ - readonly type: string = "inferred"; + override readonly type: string = "inferred"; constructor(public name: string) { super(); @@ -32,7 +32,7 @@ export class InferredType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: unknown): boolean { + override equals(type: unknown): boolean { if (!(type instanceof InferredType)) { return false; } @@ -42,7 +42,7 @@ export class InferredType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { return `infer ${this.name}`; } } diff --git a/src/lib/models/types/intersection.ts b/src/lib/models/types/intersection.ts index 111a65bfb..3350e96ef 100644 --- a/src/lib/models/types/intersection.ts +++ b/src/lib/models/types/intersection.ts @@ -16,7 +16,7 @@ export class IntersectionType extends Type { /** * The type name identifier. */ - readonly type: string = "intersection"; + override readonly type: string = "intersection"; /** * Create a new TupleType instance. @@ -43,7 +43,7 @@ export class IntersectionType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: IntersectionType): boolean { + override equals(type: IntersectionType): boolean { if (!(type instanceof IntersectionType)) { return false; } @@ -53,7 +53,7 @@ export class IntersectionType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { const names: string[] = []; this.types.forEach((element) => { names.push(element.toString()); diff --git a/src/lib/models/types/intrinsic.ts b/src/lib/models/types/intrinsic.ts index f2ad1a027..0a9a0abf5 100644 --- a/src/lib/models/types/intrinsic.ts +++ b/src/lib/models/types/intrinsic.ts @@ -16,7 +16,7 @@ export class IntrinsicType extends Type { /** * The type name identifier. */ - readonly type = "intrinsic"; + override readonly type = "intrinsic"; /** * Create a new instance of IntrinsicType. @@ -43,14 +43,14 @@ export class IntrinsicType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: IntrinsicType): boolean { + override equals(type: IntrinsicType): boolean { return type instanceof IntrinsicType && type.name === this.name; } /** * Return a string representation of this type. */ - toString() { + override toString() { return this.name; } } diff --git a/src/lib/models/types/literal.ts b/src/lib/models/types/literal.ts index bce096786..63d73ca63 100644 --- a/src/lib/models/types/literal.ts +++ b/src/lib/models/types/literal.ts @@ -14,7 +14,7 @@ export class LiteralType extends Type { /** * The type name identifier. */ - readonly type = "literal"; + override readonly type = "literal"; constructor(value: LiteralType["value"]) { super(); @@ -36,14 +36,14 @@ export class LiteralType extends Type { * @param other The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(other: LiteralType): boolean { + override equals(other: LiteralType): boolean { return other instanceof LiteralType && other.value === this.value; } /** * Return a string representation of this type. */ - toString(): string { + override toString(): string { if (typeof this.value === "bigint") { return this.value.toString(); } diff --git a/src/lib/models/types/mapped.ts b/src/lib/models/types/mapped.ts index ec114d3b7..840ec6092 100644 --- a/src/lib/models/types/mapped.ts +++ b/src/lib/models/types/mapped.ts @@ -8,7 +8,7 @@ import { Type } from "./abstract"; * ``` */ export class MappedType extends Type { - readonly type = "mapped"; + override readonly type = "mapped"; constructor( public parameter: string, @@ -32,7 +32,7 @@ export class MappedType extends Type { ); } - equals(other: Type): boolean { + override equals(other: Type): boolean { if (!(other instanceof MappedType)) { return false; } @@ -55,7 +55,7 @@ export class MappedType extends Type { ); } - toString(): string { + override toString(): string { const read = { "+": "readonly", "-": "-readonly", diff --git a/src/lib/models/types/optional.ts b/src/lib/models/types/optional.ts index 9e5c6beb6..1aa7c056f 100644 --- a/src/lib/models/types/optional.ts +++ b/src/lib/models/types/optional.ts @@ -18,7 +18,7 @@ export class OptionalType extends Type { /** * The type name identifier. */ - readonly type = "optional"; + override readonly type = "optional"; /** * Create a new OptionalType instance. @@ -45,7 +45,7 @@ export class OptionalType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: Type): boolean { + override equals(type: Type): boolean { if (!(type instanceof OptionalType)) { return false; } @@ -55,7 +55,7 @@ export class OptionalType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { if ( this.elementType instanceof UnionType || this.elementType instanceof IntersectionType diff --git a/src/lib/models/types/predicate.ts b/src/lib/models/types/predicate.ts index 7475b7c4d..54a0c53bf 100644 --- a/src/lib/models/types/predicate.ts +++ b/src/lib/models/types/predicate.ts @@ -30,7 +30,7 @@ export class PredicateType extends Type { /** * The type name identifier. */ - readonly type = "predicate"; + override readonly type = "predicate"; /** * Create a new PredicateType instance. @@ -57,7 +57,7 @@ export class PredicateType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: Type): boolean { + override equals(type: Type): boolean { if (!(type instanceof PredicateType)) { return false; } @@ -79,7 +79,7 @@ export class PredicateType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { const out = this.asserts ? ["asserts", this.name] : [this.name]; if (this.targetType) { out.push("is", this.targetType.toString()); diff --git a/src/lib/models/types/query.ts b/src/lib/models/types/query.ts index 3733d38d9..9516fbd3d 100644 --- a/src/lib/models/types/query.ts +++ b/src/lib/models/types/query.ts @@ -11,7 +11,7 @@ import { ReferenceType } from "./reference"; export class QueryType extends Type { readonly queryType: ReferenceType; - readonly type = "query"; + override readonly type = "query"; constructor(reference: ReferenceType) { super(); @@ -22,13 +22,13 @@ export class QueryType extends Type { return new QueryType(this.queryType); } - equals(other: Type): boolean { + override equals(other: Type): boolean { return ( other instanceof QueryType && this.queryType.equals(other.queryType) ); } - toString() { + override toString() { return `typeof ${this.queryType.toString()}`; } } diff --git a/src/lib/models/types/reference.ts b/src/lib/models/types/reference.ts index ff9fe6a43..dd1badea2 100644 --- a/src/lib/models/types/reference.ts +++ b/src/lib/models/types/reference.ts @@ -16,7 +16,7 @@ export class ReferenceType extends Type { /** * The type name identifier. */ - readonly type = "reference"; + override readonly type = "reference"; /** * The name of the referenced type. @@ -88,7 +88,7 @@ export class ReferenceType extends Type { * @param other The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(other: ReferenceType): boolean { + override equals(other: ReferenceType): boolean { if (!(other instanceof ReferenceType)) { return false; } @@ -121,7 +121,7 @@ export class ReferenceType extends Type { * Return a string representation of this type. * @example EventEmitter */ - toString() { + override toString() { const name = this.reflection ? this.reflection.name : this.name; let typeArgs = ""; diff --git a/src/lib/models/types/reflection.ts b/src/lib/models/types/reflection.ts index 854a9ed69..43425399f 100644 --- a/src/lib/models/types/reflection.ts +++ b/src/lib/models/types/reflection.ts @@ -17,7 +17,7 @@ export class ReflectionType extends Type { /** * The type name identifier. */ - readonly type = "reflection"; + override readonly type = "reflection"; /** * Create a new instance of ReflectionType. @@ -44,14 +44,14 @@ export class ReflectionType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: ReflectionType): boolean { + override equals(type: ReflectionType): boolean { return type === this; } /** * Return a string representation of this type. */ - toString() { + override toString() { if (!this.declaration.children && this.declaration.signatures) { return "function"; } else { diff --git a/src/lib/models/types/rest.ts b/src/lib/models/types/rest.ts index 11a6309b0..dc0df24f6 100644 --- a/src/lib/models/types/rest.ts +++ b/src/lib/models/types/rest.ts @@ -16,7 +16,7 @@ export class RestType extends Type { /** * The type name identifier. */ - readonly type = "rest"; + override readonly type = "rest"; /** * Create a new RestType instance. @@ -43,7 +43,7 @@ export class RestType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: Type): boolean { + override equals(type: Type): boolean { if (!(type instanceof RestType)) { return false; } @@ -53,7 +53,7 @@ export class RestType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { return `...${this.elementType.toString()}`; } } diff --git a/src/lib/models/types/template-literal.ts b/src/lib/models/types/template-literal.ts index 872944b85..cd6dbf410 100644 --- a/src/lib/models/types/template-literal.ts +++ b/src/lib/models/types/template-literal.ts @@ -7,7 +7,7 @@ import { Type } from "./abstract"; * ``` */ export class TemplateLiteralType extends Type { - readonly type = "template-literal"; + override readonly type = "template-literal"; head: string; tail: [Type, string][]; @@ -25,7 +25,7 @@ export class TemplateLiteralType extends Type { ); } - equals(other: Type): boolean { + override equals(other: Type): boolean { return ( other instanceof TemplateLiteralType && this.head === other.head && @@ -38,7 +38,7 @@ export class TemplateLiteralType extends Type { ); } - toString() { + override toString() { return [ "`", this.head, diff --git a/src/lib/models/types/tuple.ts b/src/lib/models/types/tuple.ts index 16b2191f3..20c79095c 100644 --- a/src/lib/models/types/tuple.ts +++ b/src/lib/models/types/tuple.ts @@ -16,7 +16,7 @@ export class TupleType extends Type { /** * The type name identifier. */ - readonly type = "tuple"; + override readonly type = "tuple"; /** * Create a new TupleType instance. @@ -43,7 +43,7 @@ export class TupleType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: TupleType): boolean { + override equals(type: TupleType): boolean { if (!(type instanceof TupleType)) { return false; } @@ -53,7 +53,7 @@ export class TupleType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { const names: string[] = []; this.elements.forEach((element) => { names.push(element.toString()); @@ -64,7 +64,7 @@ export class TupleType extends Type { } export class NamedTupleMember extends Type { - readonly type = "named-tuple-member"; + override readonly type = "named-tuple-member"; constructor( public name: string, @@ -93,7 +93,7 @@ export class NamedTupleMember extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: Type): boolean { + override equals(type: Type): boolean { if (!(type instanceof NamedTupleMember)) { return false; } @@ -106,7 +106,7 @@ export class NamedTupleMember extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { return `${this.name}${this.isOptional ? "?" : ""}: ${this.element}`; } } diff --git a/src/lib/models/types/type-operator.ts b/src/lib/models/types/type-operator.ts index 048ec9a79..6a3cd7777 100644 --- a/src/lib/models/types/type-operator.ts +++ b/src/lib/models/types/type-operator.ts @@ -12,7 +12,7 @@ export class TypeOperatorType extends Type { /** * The type name identifier. */ - readonly type = "typeOperator"; + override readonly type = "typeOperator"; constructor( public target: Type, @@ -36,7 +36,7 @@ export class TypeOperatorType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: TypeOperatorType): boolean { + override equals(type: TypeOperatorType): boolean { if (!(type instanceof TypeOperatorType)) { return false; } @@ -51,7 +51,7 @@ export class TypeOperatorType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { return `${this.operator} ${this.target.toString()}`; } } diff --git a/src/lib/models/types/type-parameter.ts b/src/lib/models/types/type-parameter.ts index 18a45cda2..dd51d5c9e 100644 --- a/src/lib/models/types/type-parameter.ts +++ b/src/lib/models/types/type-parameter.ts @@ -27,7 +27,7 @@ export class TypeParameterType extends Type { /** * The type name identifier. */ - readonly type: string = "typeParameter"; + override readonly type: string = "typeParameter"; constructor(name: string) { super(); @@ -52,7 +52,7 @@ export class TypeParameterType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: TypeParameterType): boolean { + override equals(type: TypeParameterType): boolean { if (!(type instanceof TypeParameterType)) { return false; } @@ -79,7 +79,7 @@ export class TypeParameterType extends Type { /** * Return a string representation of this type. */ - toString(): string { + override toString(): string { return this.name; } } diff --git a/src/lib/models/types/union.ts b/src/lib/models/types/union.ts index fc3ece18d..afbd87929 100644 --- a/src/lib/models/types/union.ts +++ b/src/lib/models/types/union.ts @@ -18,7 +18,7 @@ export class UnionType extends Type { /** * The type name identifier. */ - readonly type: string = "union"; + override readonly type: string = "union"; /** * Create a new TupleType instance. @@ -46,7 +46,7 @@ export class UnionType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: UnionType): boolean { + override equals(type: UnionType): boolean { if (!(type instanceof UnionType)) { return false; } @@ -56,7 +56,7 @@ export class UnionType extends Type { /** * Return a string representation of this type. */ - toString() { + override toString() { const names: string[] = []; this.types.forEach((element) => { names.push(element.toString()); diff --git a/src/lib/models/types/unknown.ts b/src/lib/models/types/unknown.ts index ee7e84a36..305248be1 100644 --- a/src/lib/models/types/unknown.ts +++ b/src/lib/models/types/unknown.ts @@ -12,7 +12,7 @@ export class UnknownType extends Type { /** * The type name identifier. */ - readonly type = "unknown"; + override readonly type = "unknown"; /** * Create a new instance of UnknownType. @@ -39,14 +39,14 @@ export class UnknownType extends Type { * @param type The type that should be checked for equality. * @returns TRUE if the given type equals this type, FALSE otherwise. */ - equals(type: UnknownType): boolean { + override equals(type: UnknownType): boolean { return type instanceof UnknownType && type.name === this.name; } /** * Return a string representation of this type. */ - toString() { + override toString() { return this.name; } } diff --git a/src/lib/output/components.ts b/src/lib/output/components.ts index a3d958fc3..6144d6cde 100644 --- a/src/lib/output/components.ts +++ b/src/lib/output/components.ts @@ -42,7 +42,7 @@ export abstract class ContextAwareRendererComponent extends RendererComponent { * * @param renderer The renderer this plugin should be attached to. */ - protected initialize() { + protected override initialize() { this.listenTo(this.owner, { [RendererEvent.BEGIN]: this.onBeginRenderer, [PageEvent.BEGIN]: this.onBeginPage, diff --git a/src/lib/output/plugins/AssetsPlugin.ts b/src/lib/output/plugins/AssetsPlugin.ts index 8357352a1..9c1c03c83 100644 --- a/src/lib/output/plugins/AssetsPlugin.ts +++ b/src/lib/output/plugins/AssetsPlugin.ts @@ -19,7 +19,7 @@ export class AssetsPlugin extends RendererComponent { /** * Create a new AssetsPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [RendererEvent.BEGIN]: this.onRendererBegin, }); diff --git a/src/lib/output/plugins/JavascriptIndexPlugin.ts b/src/lib/output/plugins/JavascriptIndexPlugin.ts index d24c7ef79..d411aaa0e 100644 --- a/src/lib/output/plugins/JavascriptIndexPlugin.ts +++ b/src/lib/output/plugins/JavascriptIndexPlugin.ts @@ -21,7 +21,7 @@ export class JavascriptIndexPlugin extends RendererComponent { /** * Create a new JavascriptIndexPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, RendererEvent.BEGIN, this.onRendererBegin); } diff --git a/src/lib/output/plugins/LayoutPlugin.ts b/src/lib/output/plugins/LayoutPlugin.ts index cdf26a78a..6d7bbf157 100644 --- a/src/lib/output/plugins/LayoutPlugin.ts +++ b/src/lib/output/plugins/LayoutPlugin.ts @@ -12,7 +12,7 @@ export class LayoutPlugin extends RendererComponent { /** * Create a new LayoutPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, PageEvent.END, this.onRendererEndPage); } diff --git a/src/lib/output/plugins/LegendPlugin.ts b/src/lib/output/plugins/LegendPlugin.ts index 2b908ce81..b8e7765cb 100644 --- a/src/lib/output/plugins/LegendPlugin.ts +++ b/src/lib/output/plugins/LegendPlugin.ts @@ -271,7 +271,7 @@ export class LegendPlugin extends RendererComponent { /** * Create a new LegendPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [RendererEvent.BEGIN]: this.onRenderBegin, [PageEvent.BEGIN]: this.onRendererBeginPage, diff --git a/src/lib/output/plugins/MarkedLinksPlugin.ts b/src/lib/output/plugins/MarkedLinksPlugin.ts index 2c707cec9..a1303e8f0 100644 --- a/src/lib/output/plugins/MarkedLinksPlugin.ts +++ b/src/lib/output/plugins/MarkedLinksPlugin.ts @@ -29,7 +29,7 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent { /** * Create a new MarkedLinksPlugin instance. */ - initialize() { + override initialize() { super.initialize(); this.listenTo( this.owner, diff --git a/src/lib/output/plugins/MarkedPlugin.ts b/src/lib/output/plugins/MarkedPlugin.ts index 7e379156b..0ec65e606 100644 --- a/src/lib/output/plugins/MarkedPlugin.ts +++ b/src/lib/output/plugins/MarkedPlugin.ts @@ -88,7 +88,7 @@ export class MarkedPlugin extends ContextAwareRendererComponent { /** * Create a new MarkedPlugin instance. */ - initialize() { + override initialize() { super.initialize(); this.listenTo(this.owner, MarkdownEvent.PARSE, this.onParseMarkdown); @@ -193,7 +193,7 @@ output file : * * @param event An event object describing the current render operation. */ - protected onBeginRenderer(event: RendererEvent) { + protected override onBeginRenderer(event: RendererEvent) { super.onBeginRenderer(event); Marked.setOptions(this.createMarkedOptions()); diff --git a/src/lib/output/plugins/NavigationPlugin.ts b/src/lib/output/plugins/NavigationPlugin.ts index d163c3352..4bfce9437 100644 --- a/src/lib/output/plugins/NavigationPlugin.ts +++ b/src/lib/output/plugins/NavigationPlugin.ts @@ -20,7 +20,7 @@ export class NavigationPlugin extends RendererComponent { /** * Create a new NavigationPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [RendererEvent.BEGIN]: this.onBeginRenderer, [PageEvent.BEGIN]: this.onBeginPage, diff --git a/src/lib/output/plugins/PrettyPrintPlugin.ts b/src/lib/output/plugins/PrettyPrintPlugin.ts index 2d2b24334..09be67e1f 100644 --- a/src/lib/output/plugins/PrettyPrintPlugin.ts +++ b/src/lib/output/plugins/PrettyPrintPlugin.ts @@ -67,7 +67,7 @@ export class PrettyPrintPlugin extends RendererComponent { /** * Create a new PrettyPrintPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, PageEvent.END, this.onRendererEndPage, -1024); } diff --git a/src/lib/output/plugins/TocPlugin.ts b/src/lib/output/plugins/TocPlugin.ts index 774032ebe..f56c72134 100644 --- a/src/lib/output/plugins/TocPlugin.ts +++ b/src/lib/output/plugins/TocPlugin.ts @@ -20,7 +20,7 @@ export class TocPlugin extends RendererComponent { /** * Create a new TocPlugin instance. */ - initialize() { + override initialize() { this.listenTo(this.owner, { [PageEvent.BEGIN]: this.onRendererBeginPage, }); diff --git a/src/lib/output/themes/MinimalTheme.ts b/src/lib/output/themes/MinimalTheme.ts index bc77fa8ee..13821e7a0 100644 --- a/src/lib/output/themes/MinimalTheme.ts +++ b/src/lib/output/themes/MinimalTheme.ts @@ -37,7 +37,7 @@ export class MinimalTheme extends DefaultTheme { * @returns TRUE if the given path seems to be a previous output directory, * otherwise FALSE. */ - isOutputDirectory(path: string): boolean { + override isOutputDirectory(path: string): boolean { if (!FS.existsSync(Path.join(path, "index.html"))) { return false; } @@ -51,7 +51,7 @@ export class MinimalTheme extends DefaultTheme { * @returns A list of [[UrlMapping]] instances defining which models * should be rendered to which files. */ - getUrls(project: ProjectReflection): UrlMapping[] { + override getUrls(project: ProjectReflection): UrlMapping[] { const urls: UrlMapping[] = []; urls.push(new UrlMapping("index.html", project, "index.hbs")); diff --git a/src/lib/output/utils/resources/helpers.ts b/src/lib/output/utils/resources/helpers.ts index ee024795f..45964a68e 100644 --- a/src/lib/output/utils/resources/helpers.ts +++ b/src/lib/output/utils/resources/helpers.ts @@ -35,7 +35,7 @@ export class HelperStack extends ResourceStack { this.addCoreHelpers(); } - activate(): boolean { + override activate(): boolean { if (!super.activate()) { return false; } @@ -57,7 +57,7 @@ export class HelperStack extends ResourceStack { return true; } - deactivate(): boolean { + override deactivate(): boolean { if (!super.deactivate()) { return false; } @@ -74,7 +74,7 @@ export class HelperStack extends ResourceStack { this.addOrigin("core", Path.join(__dirname, "..", "..", "helpers")); } - removeAllOrigins() { + override removeAllOrigins() { super.removeAllOrigins(); this.addCoreHelpers(); } diff --git a/src/lib/output/utils/resources/templates.ts b/src/lib/output/utils/resources/templates.ts index 46cb9fc1b..dc12e670f 100644 --- a/src/lib/output/utils/resources/templates.ts +++ b/src/lib/output/utils/resources/templates.ts @@ -36,7 +36,7 @@ export class TemplateStack extends ResourceStack