Browse Source

Updates types

main
Eric Amodio 1 year ago
parent
commit
acf45fd3fd
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/constants.ts
  2. +2
    -2
      src/views/viewBase.ts

+ 2
- 2
src/constants.ts View File

@ -471,7 +471,7 @@ export type TreeViewTypes =
| 'tags'
| 'workspaces'
| 'worktrees';
export type TreeViewIds = `gitlens.views.${TreeViewTypes}`;
export type TreeViewIds<T extends TreeViewTypes = TreeViewTypes> = `gitlens.views.${T}`;
export type WebviewTypes = 'focus' | 'graph' | 'patchDetails' | 'settings' | 'timeline' | 'welcome';
export type WebviewIds = `gitlens.${WebviewTypes}`;
@ -484,7 +484,7 @@ export type WebviewViewTypes =
| 'home'
| 'patchDetails'
| 'timeline';
export type WebviewViewIds = `gitlens.views.${WebviewViewTypes}`;
export type WebviewViewIds<T extends WebviewViewTypes = WebviewViewTypes> = `gitlens.views.${T}`;
export type ViewTypes = TreeViewTypes | WebviewViewTypes;
export type ViewIds = TreeViewIds | WebviewViewIds;

+ 2
- 2
src/views/viewBase.ts View File

@ -28,7 +28,7 @@ import type {
WorktreesViewConfig,
} from '../config';
import { viewsCommonConfigKeys, viewsConfigKeys } from '../config';
import type { TreeViewCommandSuffixesByViewType, TreeViewTypes } from '../constants';
import type { TreeViewCommandSuffixesByViewType, TreeViewIds, TreeViewTypes } from '../constants';
import type { Container } from '../container';
import { executeCoreCommand } from '../system/command';
import { configuration } from '../system/configuration';
@ -113,7 +113,7 @@ export abstract class ViewBase<
>
implements TreeDataProvider<ViewNode>, Disposable
{
get id(): `gitlens.views.${Type}` {
get id(): TreeViewIds<Type> {
return `gitlens.views.${this.type}`;
}

Loading…
Cancel
Save