feat: improve types

This commit is contained in:
mathuo 2022-02-16 20:21:04 +00:00
parent 5c2a0cf93d
commit 017e6856f9
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
2 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ export type GridviewComponentUpdateOptions = Pick<
export interface IGridviewComponent extends IBaseGrid<GridviewPanel> { export interface IGridviewComponent extends IBaseGrid<GridviewPanel> {
readonly orientation: Orientation; readonly orientation: Orientation;
updateOptions(options: GridviewComponentUpdateOptions): void; updateOptions(options: Partial<GridviewComponentUpdateOptions>): void;
addPanel(options: AddComponentOptions): void; addPanel(options: AddComponentOptions): void;
removePanel(panel: IGridviewPanel, sizing?: Sizing): void; removePanel(panel: IGridviewPanel, sizing?: Sizing): void;
toggleVisibility(panel: IGridviewPanel): void; toggleVisibility(panel: IGridviewPanel): void;
@ -128,7 +128,7 @@ export class GridviewComponent
} }
} }
updateOptions(options: GridviewComponentUpdateOptions): void { updateOptions(options: Partial<GridviewComponentUpdateOptions>): void {
const hasOrientationChanged = const hasOrientationChanged =
typeof options.orientation === 'string' && typeof options.orientation === 'string' &&
this.options.orientation !== options.orientation; this.options.orientation !== options.orientation;

View File

@ -58,7 +58,7 @@ export interface ISplitviewComponent extends IDisposable {
readonly width: number; readonly width: number;
readonly length: number; readonly length: number;
readonly orientation: Orientation; readonly orientation: Orientation;
updateOptions(options: SplitviewComponentUpdateOptions): void; updateOptions(options: Partial<SplitviewComponentUpdateOptions>): void;
addPanel(options: AddSplitviewComponentOptions): void; addPanel(options: AddSplitviewComponentOptions): void;
layout(width: number, height: number): void; layout(width: number, height: number): void;
onDidLayoutChange: Event<void>; onDidLayoutChange: Event<void>;
@ -159,7 +159,7 @@ export class SplitviewComponent
this.addDisposables(this._disposable); this.addDisposables(this._disposable);
} }
updateOptions(options: SplitviewComponentUpdateOptions): void { updateOptions(options: Partial<SplitviewComponentUpdateOptions>): void {
const hasOrientationChanged = const hasOrientationChanged =
typeof options.orientation === 'string' && typeof options.orientation === 'string' &&
this.options.orientation !== options.orientation; this.options.orientation !== options.orientation;