Skip to content

Commit f698cf3

Browse files
committed
noImplicitOverride
1 parent 9fde36a commit f698cf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+109
-108
lines changed

src/app/analog/models/AnalogCircuitDesigner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class AnalogCircuitDesigner extends CircuitDesigner {
137137
this.callback({ type: "wire", op: "removed", wire });
138138
}
139139

140-
public replace(designer: AnalogCircuitDesigner): void {
140+
public override replace(designer: AnalogCircuitDesigner): void {
141141
super.replace(designer);
142142
}
143143

src/app/analog/models/AnalogComponent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export abstract class AnalogComponent extends Component {
7070
return this.ports.length;
7171
}
7272

73-
public getConnections(): AnalogWire[] {
73+
public override getConnections(): AnalogWire[] {
7474
// Get each wire connected to each port and then filter out the null ones
7575
return this.getPorts().flatMap((p) => p.getWires())
7676
.filter((w) => !!w);

src/app/analog/models/AnalogNode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class AnalogNode extends AnalogComponent implements Node {
2525
this.ports.last .setTargetPos(V(0, 0));
2626
}
2727

28-
public isWithinSelectBounds(v: Vector): boolean {
28+
public override isWithinSelectBounds(v: Vector): boolean {
2929
return CircleContains(this.getPos(), this.getSize().x, v);
3030
}
3131

src/app/analog/models/AnalogWire.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import {AnalogPort} from "./index";
1111
@serializable("AnalogWire")
1212
export class AnalogWire extends Wire {
1313
@serialize
14-
protected p1: AnalogPort;
14+
protected override p1: AnalogPort;
1515
@serialize
16-
protected p2: AnalogPort;
16+
protected override p2: AnalogPort;
1717

1818
public constructor(p1?: AnalogPort, p2?: AnalogPort) {
1919
super(p1!, p2!);

src/app/analog/models/eeobjects/essentials/Capacitor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class Capacitor extends AnalogComponent {
3737
return [`${this.props["C"]}`];
3838
}
3939

40-
public getPropInfo(key: string) {
40+
public override getPropInfo(key: string) {
4141
return Info[key];
4242
}
4343

@@ -55,7 +55,7 @@ export class Capacitor extends AnalogComponent {
5555
*
5656
* @returns The string "capacitor.svg".
5757
*/
58-
public getImageName(): string {
58+
public override getImageName(): string {
5959
return "capacitor.svg";
6060
}
6161
}

src/app/analog/models/eeobjects/essentials/Ground.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Ground extends AnalogComponent {
3636
*
3737
* @returns The string "ground.svg".
3838
*/
39-
public getImageName(): string {
39+
public override getImageName(): string {
4040
return "ground.svg";
4141
}
4242
}

src/app/analog/models/ports/AnalogPort.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {AnalogComponent, AnalogWire} from "../index";
99

1010
@serializable("AnalogPort")
1111
export class AnalogPort extends Port {
12-
protected parent: AnalogComponent;
13-
protected connections: AnalogWire[];
12+
protected override parent: AnalogComponent;
13+
protected override connections: AnalogWire[];
1414

1515
public constructor(parent?: AnalogComponent) {
1616
super(parent!);
@@ -33,11 +33,11 @@ export class AnalogPort extends Port {
3333
return V(-1, 0);
3434
}
3535

36-
public getParent(): AnalogComponent {
36+
public override getParent(): AnalogComponent {
3737
return this.parent;
3838
}
3939

40-
public getWires(): AnalogWire[] {
40+
public override getWires(): AnalogWire[] {
4141
return this.connections;
4242
}
4343

src/app/analog/models/ports/positioners/LeftRightPositioner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class LeftRightPositioner extends Positioner<AnalogPort> {
2424
* @param arr."0" The first port.
2525
* @param arr."1" The second port.
2626
*/
27-
public updatePortPositions([p1, p2]: AnalogPort[]): void {
27+
public override updatePortPositions([p1, p2]: AnalogPort[]): void {
2828
const width = p1.getParent().getSize().x;
2929

3030
p1.setOriginPos(V(-width/2, 0));

src/app/analog/models/ports/positioners/SidePositioner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class SidePositioner extends Positioner<AnalogPort> {
2525
* @param arr The array of input ports.
2626
* @param arr."0" The input port.
2727
*/
28-
public updatePortPositions([p1]: AnalogPort[]): void {
28+
public override updatePortPositions([p1]: AnalogPort[]): void {
2929
const size = (
3030
this.side === "left" || this.side === "right"
3131
? p1.getParent().getSize().x

src/app/analog/models/ports/positioners/TopBottomPositioner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class TopBottomPositioner extends Positioner<AnalogPort> {
2424
* @param arr."0" The first port.
2525
* @param arr."1" The second port.
2626
*/
27-
public updatePortPositions([p1, p2]: AnalogPort[]): void {
27+
public override updatePortPositions([p1, p2]: AnalogPort[]): void {
2828
const height = p1.getParent().getSize().y;
2929

3030
p1.setOriginPos(V(0, -height/2));

src/app/core/models/Component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export abstract class Component extends CullableObject {
2525
this.transform = new Transform(V(), size);
2626
}
2727

28-
public onTransformChange(): void {
28+
public override onTransformChange(): void {
2929
super.onTransformChange();
3030
this.getConnections().forEach((w) => w.onTransformChange());
3131
}

src/app/core/models/Wire.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export abstract class Wire extends CullableObject {
9696
}
9797
}
9898

99-
public onTransformChange(): void {
99+
public override onTransformChange(): void {
100100
super.onTransformChange();
101101
this.dirtyShape = true;
102102
}

src/app/core/models/ports/positioners/ConstantSpacePositioner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class ConstantSpacePositioner<T extends Port> extends Positioner<T> {
2121
*
2222
* @param ports The array of input ports.
2323
*/
24-
public updatePortPositions(ports: Array<T | undefined>): void {
24+
public override updatePortPositions(ports: Array<T | undefined>): void {
2525
ports.forEach((port, i) => {
2626
if (!port) // Ignore undefined ports for 'blank spaces' in the positioning
2727
return;

src/app/core/rendering/shapes/ArcCircle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class ArcCircle extends Circle {
2929
*
3030
* @param ctx Provides the 2D rendering context for the drawing surface of an element.
3131
*/
32-
public draw(ctx: CanvasRenderingContext2D): void {
32+
public override draw(ctx: CanvasRenderingContext2D): void {
3333
ctx.moveTo(this.pos.x, this.pos.y);
3434
let da = (this.a1 - this.a0) % (2*Math.PI);
3535
if (da < 0)

src/app/core/tools/InteractionTool.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export class InteractionTool extends DefaultTool {
2828
o.isWithinSelectBounds(pos)));
2929
}
3030

31-
public onActivate(event: Event, info: CircuitInfo): boolean {
31+
public override onActivate(event: Event, info: CircuitInfo): boolean {
3232
return this.onEvent(event, info);
3333
}
3434

35-
public onEvent(event: Event, info: CircuitInfo): boolean {
35+
public override onEvent(event: Event, info: CircuitInfo): boolean {
3636
const { locked, input, camera, currentlyPressedObject } = info;
3737

3838
const worldMousePos = camera.getWorldPos(input.getMousePos());

src/app/digital/actions/ports/InputPortChangeAction.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class InputPortChangeAction extends PortChangeAction {
3939
*
4040
* @returns The object with the new number of ports.
4141
*/
42-
public execute(): Action {
42+
public override execute(): Action {
4343
super.execute();
4444
this.obj.setInputPortCount(this.targetCount);
4545
return this;
@@ -50,13 +50,13 @@ export class InputPortChangeAction extends PortChangeAction {
5050
*
5151
* @returns The object with the initial number of ports.
5252
*/
53-
public undo(): Action {
53+
public override undo(): Action {
5454
this.obj.setInputPortCount(this.initialCount);
5555
super.undo();
5656
return this;
5757
}
5858

59-
public getName(): string {
59+
public override getName(): string {
6060
return "Inport Change";
6161
}
6262

src/app/digital/actions/ports/MuxPortChangeAction.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class MuxPortChangeAction extends PortChangeAction {
6464
*
6565
* @returns The new obj with the new size and number of ports.
6666
*/
67-
public execute(): Action {
67+
public override execute(): Action {
6868
// Change size first
6969
this.changeSize(this.targetCount);
7070

@@ -79,7 +79,7 @@ export class MuxPortChangeAction extends PortChangeAction {
7979
*
8080
* @returns The new object with the initial size and number of ports.
8181
*/
82-
public undo(): Action {
82+
public override undo(): Action {
8383
// Change size back first
8484
this.changeSize(this.initialCount);
8585

@@ -89,7 +89,7 @@ export class MuxPortChangeAction extends PortChangeAction {
8989
return this;
9090
}
9191

92-
public getName(): string {
92+
public override getName(): string {
9393
return "Mux Port Change";
9494
}
9595

src/app/digital/actions/ports/OutputPortChangeAction.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class OutputPortChangeAction extends PortChangeAction {
3939
*
4040
* @returns The object with the new number of ports.
4141
*/
42-
public execute(): Action {
42+
public override execute(): Action {
4343
super.execute();
4444
this.obj.setOutputPortCount(this.targetCount);
4545
return this;
@@ -50,13 +50,13 @@ export class OutputPortChangeAction extends PortChangeAction {
5050
*
5151
* @returns The object with the initial number of ports.
5252
*/
53-
public undo(): Action {
53+
public override undo(): Action {
5454
this.obj.setOutputPortCount(this.initialCount);
5555
super.undo();
5656
return this;
5757
}
5858

59-
public getName(): string {
59+
public override getName(): string {
6060
return "Outport Change";
6161
}
6262
}

src/app/digital/models/DigitalCircuitDesigner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export class DigitalCircuitDesigner extends CircuitDesigner {
274274
this.callback({ type: "wire", op: "removed", wire });
275275
}
276276

277-
public replace(designer: DigitalCircuitDesigner): void {
277+
public override replace(designer: DigitalCircuitDesigner): void {
278278
super.replace(designer);
279279

280280
for (const ic of designer.getICData())

src/app/digital/models/DigitalComponent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export abstract class DigitalComponent extends Component {
123123
return [...this.getInputPorts(), ...this.getOutputPorts()];
124124
}
125125

126-
public getConnections(): DigitalWire[] {
126+
public override getConnections(): DigitalWire[] {
127127
return [...this.getInputs(), ...this.getOutputs()];
128128
}
129129

src/app/digital/models/DigitalObjectSet.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ export class DigitalObjectSet extends IOObjectSet {
4949
return [...this.others]; // Shallow Copy
5050
}
5151

52-
public getWires(): DigitalWire[] {
52+
public override getWires(): DigitalWire[] {
5353
return [...this.wires] as DigitalWire[];
5454
}
5555

56-
public getComponents(): DigitalComponent[] {
56+
public override getComponents(): DigitalComponent[] {
5757
return [...this.inputs, ...this.outputs, ...this.others];
5858
}
5959

src/app/digital/models/DigitalWire.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import {DigitalComponent, InputPort, OutputPort} from "./index";
1515
@serializable("DigitalWire")
1616
export class DigitalWire extends Wire {
1717
@serialize
18-
protected p1: OutputPort;
18+
protected override p1: OutputPort;
1919
@serialize
20-
protected p2: InputPort;
20+
protected override p2: InputPort;
2121

2222
@serialize
2323
private isOn: boolean;
@@ -40,7 +40,7 @@ export class DigitalWire extends Wire {
4040
this.p2.activate(signal);
4141
}
4242

43-
public canConnectTo(port: Port): boolean {
43+
public override canConnectTo(port: Port): boolean {
4444
if (!super.canConnectTo(port))
4545
return false;
4646

@@ -75,7 +75,7 @@ export class DigitalWire extends Wire {
7575
return this.p2.getParent();
7676
}
7777

78-
public getDisplayColor(): string {
78+
public override getDisplayColor(): string {
7979
return (this.getInput()?.getIsOn() ? DEFAULT_ON_COLOR : super.getDisplayColor());
8080
}
8181

src/app/digital/models/ioobjects/PressableComponent.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export abstract class PressableComponent extends DigitalComponent implements Pre
2727
this.on = false;
2828
}
2929

30-
public activate(signal: boolean, i = 0): void {
30+
public override activate(signal: boolean, i = 0): void {
3131
this.on = signal;
3232

3333
super.activate(signal, i);
@@ -51,7 +51,7 @@ export abstract class PressableComponent extends DigitalComponent implements Pre
5151
return RectContains(this.pressableBox, v);
5252
}
5353

54-
public isWithinSelectBounds(v: Vector): boolean {
54+
public override isWithinSelectBounds(v: Vector): boolean {
5555
// Only true if we're normally in bounds and also not in the press bounds
5656
// i.e. prevents selecting when pressing the button part of the Button
5757
return super.isWithinSelectBounds(v) && !this.isWithinPressBounds(v);
@@ -65,7 +65,7 @@ export abstract class PressableComponent extends DigitalComponent implements Pre
6565
return this.on;
6666
}
6767

68-
public getMinPos(): Vector {
68+
public override getMinPos(): Vector {
6969
const min = super.getMinPos();
7070
// Find minimum pos from corners of selection box
7171
const corners = this.pressableBox.getCorners().map((v) =>
@@ -74,7 +74,7 @@ export abstract class PressableComponent extends DigitalComponent implements Pre
7474
return Vector.Min(min, ...corners);
7575
}
7676

77-
public getMaxPos(): Vector {
77+
public override getMaxPos(): Vector {
7878
const max = super.getMaxPos();
7979
// Find maximum pos from corners of selection box
8080
const corners = this.pressableBox.getCorners().map((v) =>
@@ -83,7 +83,7 @@ export abstract class PressableComponent extends DigitalComponent implements Pre
8383
return Vector.Max(max, ...corners);
8484
}
8585

86-
public getImageName(): string {
86+
public override getImageName(): string {
8787
return (this.isOn() ? this.getOnImageName() : this.getOffImageName());
8888
}
8989

src/app/digital/models/ioobjects/flipflops/FlipFlop.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export abstract class FlipFlop extends DigitalComponent {
5252
return this.clock && !this.lastClock;
5353
}
5454

55-
public activate(): void {
55+
public override activate(): void {
5656
this.lastClock = this.clock;
5757

5858
this.clock = this.inputs.get(FlipFlop.CLK_PORT).getIsOn();

src/app/digital/models/ioobjects/gates/ANDGate.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class ANDGate extends Gate {
2828
* Uses the inputs to determine the output signal from this logic gate, that
2929
* is, on only when all of the inputs are on.
3030
*/
31-
public activate(): void {
31+
public override activate(): void {
3232
const on = this.getInputPorts().every((input) => input.getIsOn());
3333
super.activate(on);
3434
}
@@ -48,7 +48,7 @@ export class ANDGate extends Gate {
4848
*
4949
* @returns The image filename.
5050
*/
51-
public getImageName(): string {
51+
public override getImageName(): string {
5252
return "and.svg";
5353
}
5454
}

src/app/digital/models/ioobjects/gates/BUFGate.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class BUFGate extends Gate {
2525
* Activate function, passes the input port state to
2626
* the parent class activate function.
2727
*/
28-
public activate(): void {
28+
public override activate(): void {
2929
super.activate(this.inputs.first.getIsOn());
3030
}
3131

@@ -43,7 +43,7 @@ export class BUFGate extends Gate {
4343
*
4444
* @returns The string "buf.svg".
4545
*/
46-
public getImageName(): string {
46+
public override getImageName(): string {
4747
return "buf.svg";
4848
}
4949
}

0 commit comments

Comments
 (0)