mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
feat: 全部类型问题解决
This commit is contained in:
15
src/types/internal-modules.d.ts
vendored
15
src/types/internal-modules.d.ts
vendored
@@ -15,4 +15,17 @@ declare module "bun:ffi" {
|
||||
export function dlopen<T extends Record<string, { args: readonly string[]; returns: string }>>(path: string, symbols: T): { symbols: { [K in keyof T]: (...args: unknown[]) => unknown }; close(): void };
|
||||
}
|
||||
|
||||
//
|
||||
// Third-party modules without @types packages
|
||||
declare module 'bidi-js' {
|
||||
function getEmbeddingLevels(text: string, defaultDirection?: string): { paragraphLevel: number; levels: Uint8Array }
|
||||
function getReorderSegments(text: string, embeddingLevels: { paragraphLevel: number; levels: Uint8Array }, start?: number, end?: number): [number, number][]
|
||||
function getVisualOrder(reorderSegments: [number, number][]): number[]
|
||||
export { getEmbeddingLevels, getReorderSegments, getVisualOrder }
|
||||
export default { getEmbeddingLevels, getReorderSegments, getVisualOrder }
|
||||
}
|
||||
|
||||
declare module 'asciichart' {
|
||||
function plot(series: number[] | number[][], config?: Record<string, unknown>): string
|
||||
export { plot }
|
||||
export default { plot }
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export type Message = {
|
||||
isCompactSummary?: boolean
|
||||
toolUseResult?: unknown
|
||||
isVisibleInTranscriptOnly?: boolean
|
||||
attachment?: { type: string; toolUseID?: string; [key: string]: unknown }
|
||||
attachment?: { type: string; toolUseID?: string; [key: string]: unknown; addedNames: string[]; addedLines: string[]; removedNames: string[] }
|
||||
message?: {
|
||||
role?: string
|
||||
id?: string
|
||||
@@ -48,12 +48,19 @@ export type Message = {
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AssistantMessage = Message & { type: 'assistant' }
|
||||
export type AttachmentMessage<T = unknown> = Message & { type: 'attachment'; attachment: { type: string; [key: string]: unknown } }
|
||||
export type AssistantMessage = Message & {
|
||||
type: 'assistant'
|
||||
message: NonNullable<Message['message']>
|
||||
}
|
||||
export type AttachmentMessage<T = { type: string; [key: string]: unknown }> = Message & { type: 'attachment'; attachment: T }
|
||||
export type ProgressMessage<T = unknown> = Message & { type: 'progress'; data: T }
|
||||
export type SystemLocalCommandMessage = Message & { type: 'system' }
|
||||
export type SystemMessage = Message & { type: 'system' }
|
||||
export type UserMessage = Message & { type: 'user' }
|
||||
export type UserMessage = Message & {
|
||||
type: 'user'
|
||||
message: NonNullable<Message['message']>
|
||||
imagePasteIds?: number[]
|
||||
}
|
||||
export type NormalizedUserMessage = UserMessage
|
||||
export type RequestStartEvent = { type: string; [key: string]: unknown }
|
||||
export type StreamEvent = { type: string; [key: string]: unknown }
|
||||
|
||||
Reference in New Issue
Block a user