feat: 全部类型问题解决

This commit is contained in:
claude-code-best
2026-04-11 10:24:00 +08:00
parent 7088fe3c8b
commit 6a70056910
135 changed files with 671 additions and 503 deletions

View File

@@ -2148,7 +2148,7 @@ async function handleScreenshot(
const monitorNote = await buildMonitorNote(
adapter,
shot.displayId,
shot.displayId ?? 0,
overrides.lastScreenshot?.displayId,
overrides.onDisplayPinned !== undefined,
);
@@ -2217,7 +2217,7 @@ async function handleScreenshot(
const monitorNote = await buildMonitorNote(
adapter,
shot.displayId,
shot.displayId ?? 0,
overrides.lastScreenshot?.displayId,
overrides.onDisplayPinned !== undefined,
);

View File

@@ -16,6 +16,12 @@
*/
import bidiFactory from 'bidi-js'
type BidiInstance = {
getEmbeddingLevels: (text: string, defaultDirection?: string) => { paragraphLevel: number; levels: Uint8Array }
getReorderSegments: (text: string, embeddingLevels: { paragraphLevel: number; levels: Uint8Array }, start?: number, end?: number) => [number, number][]
getVisualOrder: (reorderSegments: [number, number][]) => number[]
}
type ClusteredChar = {
value: string
width: number
@@ -23,7 +29,7 @@ type ClusteredChar = {
hyperlink: string | undefined
}
let bidiInstance: ReturnType<typeof bidiFactory> | undefined
let bidiInstance: BidiInstance | undefined
let needsSoftwareBidi: boolean | undefined
function needsBidi(): boolean {
@@ -38,7 +44,7 @@ function needsBidi(): boolean {
function getBidi() {
if (!bidiInstance) {
bidiInstance = bidiFactory()
bidiInstance = (bidiFactory as unknown as () => BidiInstance)()
}
return bidiInstance
}

View File

@@ -1883,8 +1883,8 @@ export default class Ink {
let reentered = false
const intercept = (
chunk: Uint8Array | string,
encodingOrCb?: BufferEncoding | ((err?: Error) => void),
cb?: (err?: Error) => void,
encodingOrCb?: BufferEncoding | ((err?: Error | null) => void),
cb?: (err?: Error | null) => void,
): boolean => {
const callback = typeof encodingOrCb === 'function' ? encodingOrCb : cb
// Reentrancy guard: logger.debug → writeToStderr → here. Pass