Skip to content

Commit 8be960c

Browse files
committed
Add explicit initilization for void properties
Needed for current TS 4.4 builds but should not cause issues for older TS versions
1 parent 74be13f commit 8be960c

File tree

29 files changed

+51
-51
lines changed

29 files changed

+51
-51
lines changed

src/vs/base/common/color.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function roundFloat(number: number, decimalPoints: number): number {
1111
}
1212

1313
export class RGBA {
14-
_rgbaBrand: void;
14+
_rgbaBrand: void = undefined;
1515

1616
/**
1717
* Red: integer in [0-255]
@@ -47,7 +47,7 @@ export class RGBA {
4747

4848
export class HSLA {
4949

50-
_hslaBrand: void;
50+
_hslaBrand: void = undefined;
5151

5252
/**
5353
* Hue: integer in [0, 360]
@@ -160,7 +160,7 @@ export class HSLA {
160160

161161
export class HSVA {
162162

163-
_hsvaBrand: void;
163+
_hsvaBrand: void = undefined;
164164

165165
/**
166166
* Hue: integer in [0, 360]

src/vs/base/common/scrollable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface ScrollEvent {
4141
}
4242

4343
export class ScrollState implements IScrollDimensions, IScrollPosition {
44-
_scrollStateBrand: void;
44+
_scrollStateBrand: void = undefined;
4545

4646
public readonly rawScrollLeft: number;
4747
public readonly rawScrollTop: number;
@@ -204,7 +204,7 @@ export interface INewScrollPosition {
204204

205205
export class Scrollable extends Disposable {
206206

207-
_scrollableBrand: void;
207+
_scrollableBrand: void = undefined;
208208

209209
private _smoothScrollDuration: number;
210210
private readonly _scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable;

src/vs/editor/browser/controller/textAreaHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface ITextAreaHandlerHelper {
3737
}
3838

3939
class VisibleTextAreaData {
40-
_visibleTextAreaBrand: void;
40+
_visibleTextAreaBrand: void = undefined;
4141

4242
public readonly top: number;
4343
public readonly left: number;

src/vs/editor/browser/editorDom.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
1212
* Coordinates relative to the whole document (e.g. mouse event's pageX and pageY)
1313
*/
1414
export class PageCoordinates {
15-
_pageCoordinatesBrand: void;
15+
_pageCoordinatesBrand: void = undefined;
1616

1717
constructor(
1818
public readonly x: number,
@@ -32,7 +32,7 @@ export class PageCoordinates {
3232
* of whether the page is scrolled horizontally.
3333
*/
3434
export class ClientCoordinates {
35-
_clientCoordinatesBrand: void;
35+
_clientCoordinatesBrand: void = undefined;
3636

3737
constructor(
3838
public readonly clientX: number,
@@ -48,7 +48,7 @@ export class ClientCoordinates {
4848
* The position of the editor in the page.
4949
*/
5050
export class EditorPagePosition {
51-
_editorPagePositionBrand: void;
51+
_editorPagePositionBrand: void = undefined;
5252

5353
constructor(
5454
public readonly x: number,
@@ -64,7 +64,7 @@ export function createEditorPagePosition(editorViewDomNode: HTMLElement): Editor
6464
}
6565

6666
export class EditorMouseEvent extends StandardMouseEvent {
67-
_editorMouseEventBrand: void;
67+
_editorMouseEventBrand: void = undefined;
6868

6969
/**
7070
* Coordinates relative to the whole document.

src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { IDimension } from 'vs/editor/common/editorCommon';
1818

1919

2020
class Coordinate {
21-
_coordinateBrand: void;
21+
_coordinateBrand: void = undefined;
2222

2323
public readonly top: number;
2424
public readonly left: number;

src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { EditorOption } from 'vs/editor/common/config/editorOptions';
1212

1313

1414
export class DecorationToRender {
15-
_decorationToRenderBrand: void;
15+
_decorationToRenderBrand: void = undefined;
1616

1717
public startLineNumber: number;
1818
public endLineNumber: number;

src/vs/editor/browser/viewParts/lines/rangeUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Constants } from 'vs/base/common/uint';
77
import { HorizontalRange } from 'vs/editor/common/view/renderingContext';
88

99
class FloatHorizontalRange {
10-
_floatHorizontalRangeBrand: void;
10+
_floatHorizontalRangeBrand: void = undefined;
1111

1212
public readonly left: number;
1313
public readonly width: number;

src/vs/editor/browser/viewParts/minimap/minimapCharRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Constants, getCharIndex } from './minimapCharSheet';
88
import { toUint8 } from 'vs/base/common/uint';
99

1010
export class MinimapCharRenderer {
11-
_minimapCharRendererBrand: void;
11+
_minimapCharRendererBrand: void = undefined;
1212

1313
private readonly charDataNormal: Uint8ClampedArray;
1414
private readonly charDataLight: Uint8ClampedArray;

src/vs/editor/common/config/fontInfo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;
1919
const MINIMUM_LINE_HEIGHT = 8;
2020

2121
export class BareFontInfo {
22-
readonly _bareFontInfoBrand: void;
22+
readonly _bareFontInfoBrand: void = undefined;
2323

2424
/**
2525
* @internal
@@ -140,7 +140,7 @@ export class BareFontInfo {
140140
export const SERIALIZED_FONT_INFO_VERSION = 1;
141141

142142
export class FontInfo extends BareFontInfo {
143-
readonly _editorStylingBrand: void;
143+
readonly _editorStylingBrand: void = undefined;
144144

145145
readonly version: number = SERIALIZED_FONT_INFO_VERSION;
146146
readonly isTrusted: boolean;

src/vs/editor/common/controller/cursorCommon.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const autoCloseNever = () => false;
5858
const autoCloseBeforeWhitespace = (chr: string) => (chr === ' ' || chr === '\t');
5959

6060
export class CursorConfiguration {
61-
_cursorMoveConfigurationBrand: void;
61+
_cursorMoveConfigurationBrand: void = undefined;
6262

6363
public readonly readOnly: boolean;
6464
public readonly tabSize: number;
@@ -233,7 +233,7 @@ export interface ICursorSimpleModel {
233233
* Represents the cursor state on either the model or on the view model.
234234
*/
235235
export class SingleCursorState {
236-
_singleCursorStateBrand: void;
236+
_singleCursorStateBrand: void = undefined;
237237

238238
// --- selection can start as a range (think double click and drag)
239239
public readonly selectionStart: Range;
@@ -318,7 +318,7 @@ export class SingleCursorState {
318318
}
319319

320320
export class CursorContext {
321-
_cursorContextBrand: void;
321+
_cursorContextBrand: void = undefined;
322322

323323
public readonly model: ITextModel;
324324
public readonly coordinatesConverter: ICoordinatesConverter;
@@ -354,7 +354,7 @@ export class PartialViewCursorState {
354354
export type PartialCursorState = CursorState | PartialModelCursorState | PartialViewCursorState;
355355

356356
export class CursorState {
357-
_cursorStateBrand: void;
357+
_cursorStateBrand: void = undefined;
358358

359359
public static fromModelState(modelState: SingleCursorState): PartialModelCursorState {
360360
return new PartialModelCursorState(modelState);
@@ -398,7 +398,7 @@ export class CursorState {
398398
}
399399

400400
export class EditOperationResult {
401-
_editOperationResultBrand: void;
401+
_editOperationResultBrand: void = undefined;
402402

403403
readonly type: EditOperationType;
404404
readonly commands: Array<ICommand | null>;

0 commit comments

Comments
 (0)