Extend getContext API

c0436f4a321fc38ba94177f297608acb2a398136

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +6 -2Showing whitespace changes
public/script.js+6 -2
@@ -227,7 +227,7 @@ import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, de
227227import { initPresetManager } from './scripts/preset-manager.js';
228228import { MacrosParser, evaluateMacros } from './scripts/macros.js';
229229import { currentUser, setUserControls } from './scripts/user.js';
230230import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js';
231231import { renderTemplate, renderTemplateAsync } from './scripts/templates.js';
232232import { ScraperManager } from './scripts/scrapers.js';
233233import { SlashCommandParser } from './scripts/slash-commands/SlashCommandParser.js';
@@ -7184,7 +7184,8 @@ function onScenarioOverrideRemoveClick() {
71847184 * @param {string} inputValue - Value to set the input to.
71857185 * @param {PopupOptions} options - Options for the popup.
71867186 * @typedef {{okButton?: string, rows?: number, wide?: boolean, wider?: boolean, large?: boolean, allowHorizontalScrolling?: boolean, allowVerticalScrolling?: boolean, cropAspect?: number }} PopupOptions - Options for the popup.
7187- * @returns
7187+ * @returns {Promise<any>} A promise that resolves when the popup is closed.
7188+ * @deprecated Use `callGenericPopup` instead.
71887189 */
71897190export function callPopup(text, type, inputValue = '', { okButton, rows, wide, wider, large, allowHorizontalScrolling, allowVerticalScrolling, cropAspect } = {}) {
71907191 function getOkButtonText() {
@@ -7815,6 +7816,7 @@ window['SillyTavern'].getContext = function () {
78157816 eventTypes: event_types,
78167817 addOneMessage: addOneMessage,
78177818 generate: Generate,
7819+ stopGeneration: stopGeneration,
78187820 getTokenCount: getTokenCount,
78197821 extensionPrompts: extension_prompts,
78207822 setExtensionPrompt: setExtensionPrompt,
@@ -7870,6 +7872,8 @@ window['SillyTavern'].getContext = function () {
78707872 * @deprecated Legacy snake-case naming, compatibility with old extensions
78717873 */
78727874 event_types: event_types,
7875+ POPUP_TYPE: POPUP_TYPE,
7876+ POPUP_RESULT: POPUP_RESULT,
78737877 };
78747878};
78757879