|
|
import libs from './lib'; |
|
|
import getContext from './scripts/st-context'; |
|
|
import { power_user } from './scripts/power-user'; |
|
|
import { QuickReplyApi } from './scripts/extensions/quick-reply/api/QuickReplyApi'; |
|
|
import { oai_settings } from './scripts/openai'; |
|
|
import { textgenerationwebui_settings } from './scripts/textgen-settings'; |
|
|
import { FileAttachment } from './scripts/chats'; |
|
|
import { ReasoningMessageExtra } from './scripts/reasoning'; |
|
|
|
|
|
declare global { |
|
|
|
|
|
type InstructSettings = typeof power_user.instruct; |
|
|
type ContextSettings = typeof power_user.context; |
|
|
type ReasoningSettings = typeof power_user.reasoning; |
|
|
type ChatCompletionSettings = typeof oai_settings; |
|
|
type TextCompletionSettings = typeof textgenerationwebui_settings; |
|
|
type MessageTimestamp = string | number | Date; |
|
|
|
|
|
interface ChatMessage { |
|
|
name?: string; |
|
|
mes?: string; |
|
|
title?: string; |
|
|
gen_started?: MessageTimestamp; |
|
|
gen_finished?: MessageTimestamp; |
|
|
send_date?: MessageTimestamp; |
|
|
is_user?: boolean; |
|
|
is_system?: boolean; |
|
|
force_avatar?: string; |
|
|
original_avatar?: string; |
|
|
swipes?: string[]; |
|
|
swipe_info?: Record<string, any>; |
|
|
swipe_id?: number; |
|
|
extra?: ChatMessageExtra & Partial<ReasoningMessageExtra> & Record<string, any>; |
|
|
}; |
|
|
|
|
|
interface ChatMessageExtra { |
|
|
bias?: string; |
|
|
uses_system_ui?: boolean; |
|
|
memory?: string; |
|
|
display_text?: string; |
|
|
reasoning_display_text?: string; |
|
|
tool_invocations?: any[]; |
|
|
title?: string; |
|
|
isSmallSys?: boolean; |
|
|
token_count?: number; |
|
|
files?: FileAttachment[]; |
|
|
inline_image?: boolean; |
|
|
media_display?: string; |
|
|
media_index?: number; |
|
|
media?: MediaAttachment[], |
|
|
|
|
|
file?: FileAttachment; |
|
|
|
|
|
image?: string; |
|
|
|
|
|
video?: string; |
|
|
|
|
|
image_swipes?: string[]; |
|
|
|
|
|
append_title?: boolean; |
|
|
|
|
|
generationType?: number; |
|
|
|
|
|
negative?: string; |
|
|
} |
|
|
|
|
|
type MediaAttachment = MediaAttachmentProps & ImageGenerationAttachmentProps & ImageCaptionAttachmentProps; |
|
|
|
|
|
interface MediaAttachmentProps { |
|
|
url: string; |
|
|
title?: string; |
|
|
type: string; |
|
|
source?: string; |
|
|
} |
|
|
|
|
|
interface ImageGenerationAttachmentProps { |
|
|
generation_type?: number; |
|
|
negative?: string; |
|
|
} |
|
|
|
|
|
interface ImageCaptionAttachmentProps { |
|
|
|
|
|
append_title?: boolean; |
|
|
|
|
|
captioned?: boolean; |
|
|
} |
|
|
|
|
|
|
|
|
interface MediaState { |
|
|
|
|
|
currentTime: number; |
|
|
|
|
|
paused: boolean; |
|
|
} |
|
|
|
|
|
|
|
|
interface Window { |
|
|
ai: any; |
|
|
} |
|
|
|
|
|
var pdfjsLib; |
|
|
var ePub; |
|
|
var quickReplyApi: QuickReplyApi; |
|
|
|
|
|
var SillyTavern: { |
|
|
getContext(): typeof getContext; |
|
|
llm: any; |
|
|
libs: typeof libs; |
|
|
}; |
|
|
|
|
|
|
|
|
interface JQuery { |
|
|
nanogallery2(options?: any): JQuery; |
|
|
nanogallery2(method: string, options?: any): JQuery; |
|
|
pagination(method: 'getCurrentPageNum'): number; |
|
|
pagination(method: string, options?: any): JQuery; |
|
|
pagination(options?: any): JQuery; |
|
|
izoomify(options?: any): JQuery; |
|
|
} |
|
|
|
|
|
|
|
|
interface JQueryTransitOptions { |
|
|
queue?: boolean; |
|
|
} |
|
|
|
|
|
namespace Select2 { |
|
|
interface Options<Result = DataFormat | GroupedDataFormat, RemoteResult = any> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchInputPlaceholder?: string; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchInputCssClass?: string; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function translate(text: string, lang: string, provider?: string | null): Promise<string>; |
|
|
|
|
|
interface ConvertVideoArgs { |
|
|
buffer: Uint8Array; |
|
|
name: string; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function convertVideoToAnimatedWebp(args: ConvertVideoArgs): Promise<Uint8Array>; |
|
|
|
|
|
type ColorPickerEvent = Omit<JQuery.ChangeEvent<HTMLElement>, "detail"> & { |
|
|
detail: { |
|
|
rgba: string; |
|
|
} |
|
|
}; |
|
|
} |
|
|
|