-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
protocol.ts
52 lines (44 loc) · 1.9 KB
/
protocol.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { IssueOrPullRequest } from '../../git/models/issue';
import { IpcCommandType, IpcNotificationType } from '../protocol';
export type CommitSummary = {
sha: string;
summary: string;
message?: string;
author: Record<string, any>;
shortSha: string;
avatar?: string;
};
export type CommitDetails = {
committer?: Record<string, any>;
files?: Record<string, any>[];
stats?: Record<string, any>;
} & CommitSummary;
export type RichCommitDetails = {
formattedMessage?: string;
pullRequest?: IssueOrPullRequest;
issues?: IssueOrPullRequest[];
};
export type State = {
commits?: CommitSummary[];
} & Record<string, any>;
export type ShowCommitDetailsViewCommandArgs = string[];
// COMMANDS
export interface FileParams {
path: string;
repoPath: string;
}
export const OpenFileOnRemoteCommandType = new IpcCommandType<FileParams>('commit/file/openOnRemote');
export const OpenFileCommandType = new IpcCommandType<FileParams>('commit/file/open');
export const FileCompareWorkingCommandType = new IpcCommandType<FileParams>('commit/file/compareWorking');
export const FileComparePreviousCommandType = new IpcCommandType<FileParams>('commit/file/comparePrevious');
export const FileMoreActionsCommandType = new IpcCommandType<FileParams>('commit/file/moreActions');
export const CommitActionsCommandType = new IpcCommandType<undefined>('commit/moreActions');
export const PickCommitCommandType = new IpcCommandType<undefined>('commit/pickCommit');
export const SearchCommitCommandType = new IpcCommandType<undefined>('commit/searchCommit');
export const AutolinkSettingsCommandType = new IpcCommandType<undefined>('commit/autolinkSettings');
// NOTIFICATIONS
export interface DidChangeParams {
state: State;
}
export const DidChangeNotificationType = new IpcNotificationType<DidChangeParams>('commit/didChange');
export const RichContentNotificationType = new IpcNotificationType<RichCommitDetails>('commit/richContent');