@override
| Standardization: | Extended |
| Syntax kind: | Modifier |
Usageโ
This modifier has similar semantics to the override keyword in C# or Java. For a member function or property,
explicitly indicates that this definition is overriding (i.e. redefining) the definition inherited from the
base class. The base class definition would normally be marked as virtual.
TypeScript's override keyword
should be preferred over the @override tag, unless documentation is being generated from declaration files.
A documentation tool may enforce that the @virtual, @override, and/or @sealed modifiers are consistently
applied, but this is not required by the TSDoc standard.
Exampleโ
In the code sample below, Child.render() overrides the virtual member Base.render():
class Base {
/** @abstract */
public render(): void {}
/** @sealed */
public initialize(): void {}
}
class Child extends Base {
/** @override */
public render(): void;
}
See alsoโ
- @sealed tag
- @virtual tag
- C# reference: override: an equivalent feature from another programming language