mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Add more folders to strict compile (#8954)
* add more folders to strictire compile, add more strict compile options * update ci * remove unnecessary assertion
This commit is contained in:
@@ -80,7 +80,7 @@ export class VirtualizedCollection<T extends Slick.SlickData> implements IObserv
|
||||
private _bufferWindowAfter: DataWindow<T>;
|
||||
private _lengthChanged = false;
|
||||
|
||||
private collectionChangedCallback: (startIndex: number, count: number) => void;
|
||||
private collectionChangedCallback?: (startIndex: number, count: number) => void;
|
||||
|
||||
constructor(
|
||||
private readonly windowSize: number,
|
||||
|
||||
@@ -6,11 +6,13 @@
|
||||
import { escape } from 'sql/base/common/strings';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
export class DBCellValue {
|
||||
export interface DBCellValue {
|
||||
displayValue: string;
|
||||
isNull: boolean;
|
||||
}
|
||||
|
||||
public static isDBCellValue(object: any): boolean {
|
||||
export namespace DBCellValue {
|
||||
export function isDBCellValue(object: any): boolean {
|
||||
return (object !== undefined && object.displayValue !== undefined && object.isNull !== undefined);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
* Implements the various additional navigation keybindings we want out of slickgrid
|
||||
*/
|
||||
export class AdditionalKeyBindings<T> implements Slick.Plugin<T> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private handler = new Slick.EventHandler();
|
||||
|
||||
public init(grid: Slick.Grid<T>) {
|
||||
|
||||
@@ -14,10 +14,10 @@ const defaultOptions: IAutoColumnSizeOptions = {
|
||||
autoSizeOnRender: false
|
||||
};
|
||||
|
||||
export class AutoColumnSize<T extends Object> implements Slick.Plugin<T> {
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _$container: JQuery;
|
||||
private _context: CanvasRenderingContext2D;
|
||||
export class AutoColumnSize<T extends Slick.SlickData> implements Slick.Plugin<T> {
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _$container!: JQuery;
|
||||
private _context!: CanvasRenderingContext2D;
|
||||
private _options: IAutoColumnSizeOptions;
|
||||
private onPostEventHandler = new Slick.EventHandler();
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ export interface ICellRangeDecorator {
|
||||
}
|
||||
|
||||
export class CellRangeSelector<T> implements ICellRangeSelector<T> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private dragging: boolean;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private dragging?: boolean;
|
||||
private handler = new Slick.EventHandler();
|
||||
private decorator: ICellRangeDecorator;
|
||||
private canvas: HTMLCanvasElement;
|
||||
private currentlySelectedRange: { start: Slick.Cell, end?: Slick.Cell };
|
||||
private decorator!: ICellRangeDecorator;
|
||||
private canvas!: HTMLCanvasElement;
|
||||
private currentlySelectedRange?: { start: Slick.Cell, end?: Slick.Cell };
|
||||
|
||||
public onBeforeCellRangeSelected = new Slick.Event<Slick.Cell>();
|
||||
public onCellRangeSelected = new Slick.Event<Slick.Range>();
|
||||
|
||||
@@ -16,7 +16,7 @@ const defaults: ICellSelectionModelOptions = {
|
||||
};
|
||||
|
||||
export class CellSelectionModel<T> implements Slick.SelectionModel<T, Array<Slick.Range>> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private selector: ICellRangeSelector<T>;
|
||||
private ranges: Array<Slick.Range> = [];
|
||||
private _handler = new Slick.EventHandler();
|
||||
|
||||
@@ -47,10 +47,10 @@ const checkboxTemplate = `<div style="display: flex; align-items: center; flex-d
|
||||
|
||||
export class CheckboxSelectColumn<T extends Slick.SlickData> implements Slick.Plugin<T> {
|
||||
private _options: ICheckboxSelectColumnOptions;
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _handler = new Slick.EventHandler();
|
||||
private _selectedRowsLookup: dict.INumberDictionary<boolean> = {};
|
||||
private _selectedCheckBoxLookup = {};
|
||||
private _selectedCheckBoxLookup: {[key: string]: boolean} = {};
|
||||
private _useState = false;
|
||||
|
||||
private _onChange = new Emitter<ICheckboxCellActionEventArgs>();
|
||||
@@ -274,7 +274,7 @@ export class CheckboxSelectColumn<T extends Slick.SlickData> implements Slick.Pl
|
||||
|
||||
// use data for first time rendering
|
||||
// note: make sure Init is called before using this._grid
|
||||
let rowVal = (this._grid) ? this._grid.getDataItem(row) : null;
|
||||
let rowVal = this._grid?.getDataItem(row);
|
||||
if (rowVal && this._options.title && rowVal[this._options.title] === true) {
|
||||
this._selectedCheckBoxLookup[row] = true;
|
||||
return strings.format(checkboxTemplate, 'checked', this.getAriaLabel(true));
|
||||
|
||||
@@ -12,7 +12,7 @@ import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
* Implements the various additional navigation keybindings we want out of slickgrid
|
||||
*/
|
||||
export class CopyKeybind<T> implements Slick.Plugin<T> {
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private handler = new Slick.EventHandler();
|
||||
|
||||
private _onCopy = new Emitter<Slick.Range[]>();
|
||||
|
||||
@@ -19,16 +19,16 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
public onFilterApplied = new Slick.Event();
|
||||
public onCommand = new Slick.Event();
|
||||
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
private handler = new Slick.EventHandler();
|
||||
|
||||
private $menu?: JQuery<HTMLElement>;
|
||||
private okButton: Button;
|
||||
private clearButton: Button;
|
||||
private cancelButton: Button;
|
||||
private workingFilters: Array<string>;
|
||||
private columnDef: IExtendedColumn<T>;
|
||||
private buttonStyles: IButtonStyles;
|
||||
private okButton?: Button;
|
||||
private clearButton?: Button;
|
||||
private cancelButton?: Button;
|
||||
private workingFilters!: Array<string>;
|
||||
private columnDef!: IExtendedColumn<T>;
|
||||
private buttonStyles?: IButtonStyles;
|
||||
|
||||
private disposableStore = new DisposableStore();
|
||||
|
||||
@@ -286,7 +286,7 @@ export class HeaderFilter<T extends Slick.SlickData> {
|
||||
|
||||
if ($checkbox.prop('checked') && index < 0) {
|
||||
workingFilters.push(filterItems[value]);
|
||||
const nextRow = filterItems[(parseInt(<string><any>value) + 1).toString()]; // for some reason parseInt is defined as only supporting strings even though it works fine for numbers
|
||||
const nextRow = filterItems[Number((parseInt(<string><any>value) + 1).toString())]; // for some reason parseInt is defined as only supporting strings even though it works fine for numbers
|
||||
if (nextRow && nextRow.indexOf('Error:') >= 0) {
|
||||
workingFilters.push(nextRow);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ const defaultOptions: IMouseWheelSupportOptions = {
|
||||
|
||||
export class MouseWheelSupport implements Slick.Plugin<any> {
|
||||
|
||||
private viewport: HTMLElement;
|
||||
private canvas: HTMLElement;
|
||||
private viewport!: HTMLElement;
|
||||
private canvas!: HTMLElement;
|
||||
private options: IMouseWheelSupportOptions;
|
||||
|
||||
private _disposables = new DisposableStore();
|
||||
|
||||
@@ -51,11 +51,11 @@ export class RowDetailView<T extends Slick.SlickData> {
|
||||
public readonly onAfterRowDetailToggle = new Slick.Event<{ grid: Slick.Grid<T>, item: T }>();
|
||||
public readonly onBeforeRowDetailToggle = new Slick.Event<{ grid: Slick.Grid<T>, item: T }>();
|
||||
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _expandedRows: Array<ExtendedItem<T>> = [];
|
||||
private _handler = new Slick.EventHandler();
|
||||
|
||||
private _dataView: AugmentedDataView<T>;
|
||||
private _dataView!: AugmentedDataView<T>;
|
||||
private _options: IRowDetailViewOptions<T>;
|
||||
|
||||
constructor(options: IRowDetailViewOptions<T>) {
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface IRowNumberColumnOptions {
|
||||
|
||||
export class RowNumberColumn<T> implements Slick.Plugin<T> {
|
||||
private handler = new Slick.EventHandler();
|
||||
private grid: Slick.Grid<T>;
|
||||
private grid!: Slick.Grid<T>;
|
||||
|
||||
constructor(private options: IRowNumberColumnOptions) {
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface IRowSelectionModelOptions extends Slick.PluginOptions {
|
||||
|
||||
export class RowSelectionModel<T extends Slick.SlickData> implements Slick.SelectionModel<T, Array<Slick.Range>> {
|
||||
private _options: IRowSelectionModelOptions;
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _handler = new Slick.EventHandler();
|
||||
private _ranges: Array<Slick.Range> = [];
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _columns: Slick.Column<T>[];
|
||||
private _data: IDisposableDataProvider<T>;
|
||||
private _sorter: ITableSorter<T>;
|
||||
private _sorter?: ITableSorter<T>;
|
||||
|
||||
private _autoscroll: boolean;
|
||||
private _autoscroll?: boolean;
|
||||
private _container: HTMLElement;
|
||||
private _tableContainer: HTMLElement;
|
||||
|
||||
@@ -97,7 +97,7 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
|
||||
if (configuration && configuration.sorter) {
|
||||
this._sorter = configuration.sorter;
|
||||
this._grid.onSort.subscribe((e, args) => {
|
||||
this._sorter(args);
|
||||
this._sorter!(args);
|
||||
this._grid.invalidate();
|
||||
this._grid.render();
|
||||
});
|
||||
|
||||
@@ -45,9 +45,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
//The data exposed publicly, when filter is enabled, _data holds the filtered data.
|
||||
private _data: Array<T>;
|
||||
//Used when filtering is enabled, _allData holds the complete set of data.
|
||||
private _allData: Array<T>;
|
||||
private _findArray: Array<IFindPosition>;
|
||||
private _findIndex: number;
|
||||
private _allData!: Array<T>;
|
||||
private _findArray?: Array<IFindPosition>;
|
||||
private _findIndex?: number;
|
||||
private _filterEnabled: boolean;
|
||||
|
||||
private _onRowCountChange = new Emitter<number>();
|
||||
@@ -166,7 +166,7 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
if (exp) {
|
||||
return new Promise<IFindPosition>((resolve) => {
|
||||
const disp = this.onFindCountChange(e => {
|
||||
resolve(this._findArray[e - 1]);
|
||||
resolve(this._findArray![e - 1]);
|
||||
disp.dispose();
|
||||
});
|
||||
this._startSearch(exp, maxMatches);
|
||||
@@ -185,9 +185,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
for (let j = 0; j < result.length; j++) {
|
||||
const pos = result[j];
|
||||
const index = { col: pos, row: i };
|
||||
this._findArray.push(index);
|
||||
this._onFindCountChange.fire(this._findArray.length);
|
||||
if (maxMatches > 0 && this._findArray.length === maxMatches) {
|
||||
this._findArray!.push(index);
|
||||
this._onFindCountChange.fire(this._findArray!.length);
|
||||
if (maxMatches > 0 && this._findArray!.length === maxMatches) {
|
||||
breakout = true;
|
||||
break;
|
||||
}
|
||||
@@ -211,9 +211,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
if (this._findIndex === this._findArray.length - 1) {
|
||||
this._findIndex = 0;
|
||||
} else {
|
||||
++this._findIndex;
|
||||
++this._findIndex!;
|
||||
}
|
||||
return Promise.resolve(this._findArray[this._findIndex]);
|
||||
return Promise.resolve(this._findArray[this._findIndex!]);
|
||||
} else {
|
||||
return Promise.reject(new Error('no search running'));
|
||||
}
|
||||
@@ -224,9 +224,9 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
if (this._findIndex === 0) {
|
||||
this._findIndex = this._findArray.length - 1;
|
||||
} else {
|
||||
--this._findIndex;
|
||||
--this._findIndex!;
|
||||
}
|
||||
return Promise.resolve(this._findArray[this._findIndex]);
|
||||
return Promise.resolve(this._findArray[this._findIndex!]);
|
||||
} else {
|
||||
return Promise.reject(new Error('no search running'));
|
||||
}
|
||||
@@ -234,7 +234,7 @@ export class TableDataView<T extends Slick.SlickData> implements IDisposableData
|
||||
|
||||
get currentFindPosition(): Thenable<IFindPosition> {
|
||||
if (this._findArray && this._findArray.length !== 0) {
|
||||
return Promise.resolve(this._findArray[this._findIndex]);
|
||||
return Promise.resolve(this._findArray[this._findIndex!]);
|
||||
} else {
|
||||
return Promise.reject(new Error('no search running'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user