import { Command } from 'vscode' ; import { BranchSelection , CommittedFile , LogEntry } from '../types' ; export const ILogService = Symbol . for ( 'ILogService' ) ; export interface ILogService { log ( ... args ) : void ; trace ( ... args ) : void ; error ( ... args ) : void ; } export const IUiService = Symbol . for ( 'IUiService' ) ; export interface IUiService { getBranchSelection ( ) : Promise < BranchSelection | undefined > ; selectFileCommitCommandAction ( fileCommit ) : Promise < ICommand < FileCommitDetails > | undefined > ; selectCommitCommandAction ( commit ) : Promise < ICommand < CommitDetails > | undefined > ; } export enum CallContextSource { viewer = 0 , commandPalette = 1 } export class CallContext < T > { constructor ( public readonly source , public readonly data ) { } } export class BranchDetails { constructor ( public readonly workspaceFolder , public readonly branch ) { } } export class CommitDetails extends BranchDetails { constructor ( workspaceFolder , branch , public readonly logEntry ) { super ( workspaceFolder , branch ) ; } } export class CompareCommitDetails extends CommitDetails { constructor ( leftCommit , public readonly rightCommit , public readonly committedFiles ) { super ( leftCommit . workspaceFolder , leftCommit . branch , leftCommit . logEntry ) ; } } export class FileCommitDetails extends CommitDetails { constructor ( workspaceFolder , branch , logEntry , public readonly committedFile ) { super ( workspaceFolder , branch , logEntry ) ; } } export class CompareFileCommitDetails extends FileCommitDetails { constructor ( leftCommit , public readonly rightCommit , public readonly committedFile ) { super ( leftCommit . workspaceFolder , leftCommit . branch , leftCommit . logEntry , committedFile ) ; } } export interface ICommand < T > extends Command { data : T ; /**
     * Title of the command, like `save`.
     */ label : string ; /**
     * A human readable string which is rendered less prominent.
     */ description : string ; /**
     * A human readable string which is rendered less prominent.
     */ detail ? : string ; preExecute ( ) : Promise < boolean > ; execute ( ) : void | Promise < any > | Thenable < any > ; }