Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 909cac6

Browse files
committed
Type HunkLineComponent.
1 parent 5df0470 commit 909cac6

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

lib/hunk-line-component.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
/** @babel */
1+
/* @flow */
22
/** @jsx etch.dom */
33

44
import etch from 'etch'
55

6+
import type {Position} from './diff-selection'
7+
import type HunkLine from './hunk-line'
8+
69
export default class HunkLineComponent {
7-
constructor ({hunkLine, fileIndex, hunkIndex, lineIndex, selected}) {
10+
hunkLine: HunkLine;
11+
selected: boolean;
12+
fileIndex: number;
13+
hunkIndex: number;
14+
lineIndex: number;
15+
element: HTMLElement;
16+
17+
constructor ({hunkLine, fileIndex, hunkIndex, lineIndex, selected}: {hunkLine: HunkLine, fileIndex: number, hunkIndex: number, lineIndex: number, selected: boolean}) {
818
this.hunkLine = hunkLine
919
this.selected = selected
1020

@@ -16,10 +26,11 @@ export default class HunkLineComponent {
1626
this.hunkLine.onDidChange(update)
1727

1828
etch.createElement(this)
29+
// $FlowFixMe: Adding properties to a sealed type :(
1930
this.element.component = this
2031
}
2132

22-
getPosition () {
33+
getPosition (): Position {
2334
return [this.fileIndex, this.hunkIndex, this.lineIndex]
2435
}
2536

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"spyOn",
4949
"waitsFor",
5050
"MouseEvent",
51-
"localStorage"
51+
"localStorage",
52+
"HTMLElement"
5253
]
5354
}
5455
}

0 commit comments

Comments
 (0)