Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type declaration of private fields in cvat-canvas which are possibly null #4932

Merged
merged 2 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cvat-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-canvas",
"version": "2.15.2",
"version": "2.15.3",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions cvat-canvas/src/typescript/drawHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class DrawHandlerImpl implements DrawHandler {
y: number;
};
private crosshair: Crosshair;
private drawData: DrawData;
private drawData: DrawData | null;
private geometry: Geometry;
private autoborderHandler: AutoborderHandler;
private autobordersEnabled: boolean;
Expand All @@ -100,7 +100,7 @@ export class DrawHandlerImpl implements DrawHandler {
private initialized: boolean;
private canceled: boolean;
private pointsGroup: SVG.G | null;
private shapeSizeElement: ShapeSizeElement;
private shapeSizeElement: ShapeSizeElement | null;

private getFinalEllipseCoordinates(points: number[], fitIntoFrame: boolean): number[] {
const { offset } = this.geometry;
Expand Down
8 changes: 4 additions & 4 deletions cvat-canvas/src/typescript/editHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export interface EditHandler {
export class EditHandlerImpl implements EditHandler {
private onEditDone: (state: any, points: number[]) => void;
private autoborderHandler: AutoborderHandler;
private geometry: Geometry;
private geometry: Geometry | null;
private canvas: SVG.Container;
private editData: EditData;
private editedShape: SVG.Shape;
private editLine: SVG.PolyLine;
private editData: EditData | null;
private editedShape: SVG.Shape | null;
private editLine: SVG.PolyLine | null;
private clones: SVG.Polygon[];
private controlPointsSize: number;
private autobordersEnabled: boolean;
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/src/typescript/groupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class GroupHandlerImpl implements GroupHandler {
private bindedOnSelectStart: (event: MouseEvent) => void;
private bindedOnSelectUpdate: (event: MouseEvent) => void;
private bindedOnSelectStop: (event: MouseEvent) => void;
private selectionRect: SVG.Rect;
private selectionRect: SVG.Rect | null;
private startSelectionPoint: {
x: number;
y: number;
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/src/typescript/mergeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class MergeHandlerImpl implements MergeHandler {
private constraints: {
labelID: number;
shapeType: string;
};
} | null;

private addConstraints(): void {
const shape = this.statesToBeMerged[0];
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/src/typescript/splitHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class SplitHandlerImpl implements SplitHandler {
private onSplitDone: (object: any) => void;
private onFindObject: (event: MouseEvent) => void;
private canvas: SVG.Container;
private highlightedShape: SVG.Shape;
private highlightedShape: SVG.Shape | null;
private initialized: boolean;
private splitDone: boolean;

Expand Down