Fix compiler errors in public/global.d.ts (#4464) * Fix TS1038 errors "A 'declare' modifier cannot be used in an already ambient context." * Fix TS1040 errors "'async' modifier cannot be used in an ambient context." * Fix TS2371 errors "A parameter initializer is only allowed in a function or constructor implementation." * Fix TS2430 errors "Interface 'ColorPickerEvent' incorrectly extends interface 'ChangeEvent<HTMLElement, any, any, any>'". The issue here is that the "ColorPickerEvent" objects provided by toolcool-color-picker.js are vanilla JS CustomEvent objects, not JQuery event objects. We need to mangle the types here a bit to make JQuery happy. (At runtime, JQuery is happy to pass along the vanilla Event object; JQuery's types just don't reflect this.) * Remove variable and type exports --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

9f257b602f6d56016c75de18a63bb8da4c43c669

epyllia <229406611+epyllia@users.noreply.github.com>

Signed
1 files changed, +10 -10Showing whitespace changes
public/global.d.ts+10 -10
@@ -5,20 +5,20 @@ import { QuickReplyApi } from './scripts/extensions/quick-reply/api/QuickReplyAp
55
66declare global {
77 // Custom types
88 declare type InstructSettings = typeof power_user.instruct;
99 declare type ContextSettings = typeof power_user.context;
1010 declare type ReasoningSettings = typeof power_user.reasoning;
1111
1212 // Global namespace modules
1313 interface Window {
1414 ai: any;
1515 }
1616
1717 declare var pdfjsLib;
1818 declare var ePub;
1919 declare var quickReplyApi: QuickReplyApi;
2020
2121 declare var SillyTavern: {
2222 getContext(): typeof getContext;
2323 llm: any;
2424 libs: typeof libs;
@@ -63,7 +63,7 @@ declare global {
6363 * @param lang Target language
6464 * @param provider Translation provider
6565 */
6666 async function translate(text: string, lang: string, provider?: string =| null): Promise<string>;
6767
6868 interface ConvertVideoArgs {
6969 buffer: Uint8Array;
@@ -76,9 +76,9 @@ declare global {
7676 */
7777 function convertVideoToAnimatedWebp(args: ConvertVideoArgs): Promise<Uint8Array>;
7878
7979 interfacetype ColorPickerEvent extends= Omit<JQuery.ChangeEvent<HTMLElement>, "detail"> & {
8080 detail: {
8181 rgba: string;
82- };
8382 }
83+ };
8484}