-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate to generic construction
- Loading branch information
Showing
16 changed files
with
385 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
import { GridviewPanel } from './gridviewPanel'; | ||
import { ISplitviewStyles, Orientation } from '../splitview/splitview'; | ||
import { | ||
ComponentConstructor, | ||
FrameworkFactory, | ||
} from '../panel/componentFactory'; | ||
import { Orientation } from '../splitview/splitview'; | ||
import { CreateComponentOptions } from '../dockview/options'; | ||
|
||
export interface GridviewComponentOptions { | ||
export interface GridviewOptions { | ||
disableAutoResizing?: boolean; | ||
proportionalLayout: boolean; | ||
orientation: Orientation; | ||
components?: { | ||
[componentName: string]: ComponentConstructor<GridviewPanel>; | ||
}; | ||
frameworkComponents?: { | ||
[componentName: string]: any; | ||
}; | ||
frameworkComponentFactory?: FrameworkFactory<GridviewPanel>; | ||
styles?: ISplitviewStyles; | ||
className?: string; | ||
hideBorders?: boolean; | ||
} | ||
|
||
export interface GridviewFrameworkOptions { | ||
createComponent: (options: CreateComponentOptions) => GridviewPanel; | ||
} | ||
|
||
export type GridviewComponentOptions = GridviewOptions & | ||
GridviewFrameworkOptions; | ||
|
||
export const PROPERTY_KEYS_GRIDVIEW: (keyof GridviewOptions)[] = (() => { | ||
/** | ||
* by readong the keys from an empty value object TypeScript will error | ||
* when we add or remove new properties to `DockviewOptions` | ||
*/ | ||
const properties: Record<keyof GridviewOptions, undefined> = { | ||
disableAutoResizing: undefined, | ||
proportionalLayout: undefined, | ||
orientation: undefined, | ||
hideBorders: undefined, | ||
className: undefined, | ||
}; | ||
|
||
return Object.keys(properties) as (keyof GridviewOptions)[]; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
import { | ||
ComponentConstructor, | ||
FrameworkFactory, | ||
} from '../panel/componentFactory'; | ||
import { CreateComponentOptions } from '../dockview/options'; | ||
import { PaneviewDndOverlayEvent } from './paneviewComponent'; | ||
import { IPaneBodyPart, IPaneHeaderPart, PaneviewPanel } from './paneviewPanel'; | ||
import { IPanePart } from './paneviewPanel'; | ||
|
||
export interface PaneviewComponentOptions { | ||
export interface PaneviewOptions { | ||
disableAutoResizing?: boolean; | ||
components?: { | ||
[componentName: string]: ComponentConstructor<PaneviewPanel>; | ||
}; | ||
frameworkComponents?: { | ||
[componentName: string]: any; | ||
}; | ||
headerComponents?: { | ||
[componentName: string]: ComponentConstructor<PaneviewPanel>; | ||
}; | ||
headerframeworkComponents?: { | ||
[componentName: string]: any; | ||
}; | ||
frameworkWrapper?: { | ||
header: FrameworkFactory<IPaneHeaderPart>; | ||
body: FrameworkFactory<IPaneBodyPart>; | ||
}; | ||
disableDnd?: boolean; | ||
showDndOverlay?: (event: PaneviewDndOverlayEvent) => boolean; | ||
className?: string; | ||
} | ||
|
||
export interface PaneviewFrameworkOptions { | ||
createComponent: (options: CreateComponentOptions) => IPanePart; | ||
createHeaderComponent: ( | ||
options: CreateComponentOptions | ||
) => IPanePart | undefined; | ||
} | ||
|
||
export type PaneviewComponentOptions = PaneviewOptions & | ||
PaneviewFrameworkOptions; | ||
|
||
export const PROPERTY_KEYS_PANEVIEW: (keyof PaneviewOptions)[] = (() => { | ||
/** | ||
* by readong the keys from an empty value object TypeScript will error | ||
* when we add or remove new properties to `DockviewOptions` | ||
*/ | ||
const properties: Record<keyof PaneviewOptions, undefined> = { | ||
disableAutoResizing: undefined, | ||
disableDnd: undefined, | ||
showDndOverlay: undefined, | ||
className: undefined, | ||
}; | ||
|
||
return Object.keys(properties) as (keyof PaneviewOptions)[]; | ||
})(); |
Oops, something went wrong.