Преглед на файлове

Cleans up types & renames Usage to RecentUsage

main
Eric Amodio преди 2 години
родител
ревизия
3805b17593
променени са 2 файла, в които са добавени 8 реда и са изтрити 21 реда
  1. +2
    -2
      src/commands/gitCommands.utils.ts
  2. +6
    -19
      src/storage.ts

+ 2
- 2
src/commands/gitCommands.utils.ts Целия файл

@ -3,7 +3,7 @@ import { configuration } from '../configuration';
import { ContextKeys } from '../constants';
import type { Container } from '../container';
import { getContext } from '../context';
import type { Usage } from '../storage';
import type { RecentUsage } from '../storage';
import { BranchGitCommand } from './git/branch';
import { CherryPickGitCommand } from './git/cherry-pick';
import { CoAuthorsGitCommand } from './git/coauthors';
@ -140,7 +140,7 @@ export class PickCommandStep implements QuickPickStep {
private async updateCommandUsage(id: string, timestamp: number) {
let usage = this.container.storage.getWorkspace(`gitComandPalette:usage`);
if (usage === undefined) {
usage = Object.create(null) as Usage;
usage = Object.create(null) as RecentUsage;
}
usage[id] = timestamp;

+ 6
- 19
src/storage.ts Целия файл

@ -144,17 +144,13 @@ export interface WorkspaceStorage {
branch: {
comparisons?: StoredBranchComparisons;
};
connected: {
[key: string]: boolean;
};
connected: Record<string, boolean>;
gitComandPalette: {
usage?: Usage;
usage?: RecentUsage;
};
gitPath?: string;
graph: {
columns?: {
[key: string]: GraphColumnConfig;
};
columns?: Record<string, GraphColumnConfig>;
preview?: boolean;
};
remote: {
@ -234,18 +230,9 @@ export interface StoredPinnedSearch {
}
export type StoredPinnedItem = StoredPinnedComparison | StoredPinnedSearch;
export interface StoredPinnedItems {
[id: string]: StoredPinnedItem;
}
export interface StoredStarred {
[id: string]: boolean;
}
export interface Usage {
[id: string]: number;
}
export type StoredPinnedItems = Record<string, StoredPinnedItem>;
export type StoredStarred = Record<string, boolean>;
export type RecentUsage = Record<string, number>;
interface DeprecatedPinnedComparison {
path: string;

Зареждане…
Отказ
Запис