( sender: WebContents, methodName: MethodNames<VCS>, workspaceId: string, ...args: unknown[] )
| 101 | ...args: VCS[K] extends (...args: any[]) => any ? Parameters<VCS[K]> : never |
| 102 | ): Promise<VCS[K] extends (...args: any[]) => any ? Awaited<ReturnType<VCS[K]>> : never>; |
| 103 | export async function invokeVCSForWorkspace( |
| 104 | sender: WebContents, |
| 105 | methodName: MethodNames<VCS>, |
| 106 | workspaceId: string, |
| 107 | ...args: unknown[] |
| 108 | ) { |
| 109 | const vcs = getVCSForWorkspace(workspaceId); |
| 110 | const method = vcs[methodName]; |
| 111 | |
| 112 | if (typeof method !== 'function') { |
| 113 | throw new TypeError(`Unknown VCS method: ${String(methodName)}`); |
| 114 | } |
| 115 | |
| 116 | return runWithSyncRenderer(sender, () => (method as (...args: unknown[]) => unknown).apply(vcs, args)); |
| 117 | } |
| 118 | |
| 119 | export const resolvePendingSyncConflict = ({ |
| 120 | handlerId, |
no test coverage detected