mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 05:45:51 +00:00
feat: 完成一大波类型修复, 虽然 any 很多
This commit is contained in:
@@ -18,7 +18,7 @@ let pump: ReturnType<typeof setInterval> | undefined
|
||||
let pending = 0
|
||||
|
||||
function drainTick(cu: ReturnType<typeof requireComputerUseSwift>): void {
|
||||
cu._drainMainRunLoop()
|
||||
;(cu as any)._drainMainRunLoop()
|
||||
}
|
||||
|
||||
function retain(): void {
|
||||
|
||||
@@ -25,7 +25,7 @@ let registered = false
|
||||
export function registerEscHotkey(onEscape: () => void): boolean {
|
||||
if (registered) return true
|
||||
const cu = requireComputerUseSwift()
|
||||
if (!cu.hotkey.registerEscape(onEscape)) {
|
||||
if (!(cu as any).hotkey.registerEscape(onEscape)) {
|
||||
// CGEvent.tapCreate failed — typically missing Accessibility permission.
|
||||
// CU still works, just without ESC abort. Mirrors Cowork's escAbort.ts:81.
|
||||
logForDebugging('[cu-esc] registerEscape returned false', { level: 'warn' })
|
||||
@@ -40,7 +40,7 @@ export function registerEscHotkey(onEscape: () => void): boolean {
|
||||
export function unregisterEscHotkey(): void {
|
||||
if (!registered) return
|
||||
try {
|
||||
requireComputerUseSwift().hotkey.unregister()
|
||||
(requireComputerUseSwift() as any).hotkey.unregister()
|
||||
} finally {
|
||||
releasePump()
|
||||
registered = false
|
||||
@@ -50,5 +50,5 @@ export function unregisterEscHotkey(): void {
|
||||
|
||||
export function notifyExpectedEscape(): void {
|
||||
if (!registered) return
|
||||
requireComputerUseSwift().hotkey.notifyExpectedEscape()
|
||||
(requireComputerUseSwift() as any).hotkey.notifyExpectedEscape()
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ export function getComputerUseHostAdapter(): ComputerUseHostAdapter {
|
||||
}),
|
||||
ensureOsPermissions: async () => {
|
||||
const cu = requireComputerUseSwift()
|
||||
const accessibility = cu.tcc.checkAccessibility()
|
||||
const screenRecording = cu.tcc.checkScreenRecording()
|
||||
const accessibility = (cu as any).tcc.checkAccessibility()
|
||||
const screenRecording = (cu as any).tcc.checkScreenRecording()
|
||||
return accessibility && screenRecording
|
||||
? { granted: true }
|
||||
: { granted: false, accessibility, screenRecording }
|
||||
|
||||
Reference in New Issue
Block a user