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

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

* v2.15.3
main
Seongmoon Jeong 3 years ago committed by GitHub
parent 352501c003
commit 6464069bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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": {

@ -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;
@ -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;

@ -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;

@ -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;

@ -24,7 +24,7 @@ export class MergeHandlerImpl implements MergeHandler {
private constraints: {
labelID: number;
shapeType: string;
};
} | null;
private addConstraints(): void {
const shape = this.statesToBeMerged[0];

@ -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;

Loading…
Cancel
Save