Skip to content

Commit 3b4e485

Browse files
committed
fix: use TypeScript style of optional properties
1 parent 3581a6d commit 3b4e485

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src-commons-ui/float-pane/FloatPane.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ export class PinnedDatatip {
4848
_boundDispose: Function
4949
_boundHandleMouseDown: Function
5050
_boundHandleCapturedClick: Function
51-
_mouseUpTimeout: ?NodeJS.Timeout
51+
_mouseUpTimeout: NodeJS.Timeout | null = null
5252
_hostElement: HTMLElement
53-
_marker: ?DisplayMarker
54-
_rangeDecoration: ?Decoration
55-
_mouseSubscription: ?Subscription
53+
_marker?: DisplayMarker
54+
_rangeDecoration?: Decoration
55+
_mouseSubscription: Subscription | null = null
5656
_subscriptions: CompositeDisposable
5757
_datatip: Datatip
5858
_editor: TextEditor
59-
_dragOrigin: ?Position
59+
_dragOrigin: Position | null = null
6060
_isDragging: boolean
6161
_offset: Position
6262
_isHovering: boolean
@@ -71,8 +71,6 @@ export class PinnedDatatip {
7171
this._subscriptions.add(new Disposable(() => params.onDispose(this)))
7272
this._datatip = datatip
7373
this._editor = editor
74-
this._marker = null
75-
this._rangeDecoration = null
7674
this._hostElement = document.createElement("div")
7775
this._hostElement.className = "datatip-element"
7876
this._boundDispose = this.dispose.bind(this)
@@ -102,10 +100,8 @@ export class PinnedDatatip {
102100
this._hostElement.removeEventListener("mouseleave", (e) => this.handleMouseLeave(e))
103101
})
104102
)
105-
this._mouseUpTimeout = null
106103
this._offset = { x: 0, y: 0 }
107104
this._isDragging = false
108-
this._dragOrigin = null
109105
this._isHovering = false
110106
this._hideDataTips = params.hideDataTips
111107
this._position = params.position == null ? "end-of-line" : params.position

0 commit comments

Comments
 (0)