mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Extend getContext API
This commit is contained in:
@@ -227,7 +227,7 @@ import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, de
|
|||||||
import { initPresetManager } from './scripts/preset-manager.js';
|
import { initPresetManager } from './scripts/preset-manager.js';
|
||||||
import { MacrosParser, evaluateMacros } from './scripts/macros.js';
|
import { MacrosParser, evaluateMacros } from './scripts/macros.js';
|
||||||
import { currentUser, setUserControls } from './scripts/user.js';
|
import { currentUser, setUserControls } from './scripts/user.js';
|
||||||
import { POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js';
|
import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js';
|
||||||
import { renderTemplate, renderTemplateAsync } from './scripts/templates.js';
|
import { renderTemplate, renderTemplateAsync } from './scripts/templates.js';
|
||||||
import { ScraperManager } from './scripts/scrapers.js';
|
import { ScraperManager } from './scripts/scrapers.js';
|
||||||
import { SlashCommandParser } from './scripts/slash-commands/SlashCommandParser.js';
|
import { SlashCommandParser } from './scripts/slash-commands/SlashCommandParser.js';
|
||||||
@@ -7184,7 +7184,8 @@ function onScenarioOverrideRemoveClick() {
|
|||||||
* @param {string} inputValue - Value to set the input to.
|
* @param {string} inputValue - Value to set the input to.
|
||||||
* @param {PopupOptions} options - Options for the popup.
|
* @param {PopupOptions} options - Options for the popup.
|
||||||
* @typedef {{okButton?: string, rows?: number, wide?: boolean, wider?: boolean, large?: boolean, allowHorizontalScrolling?: boolean, allowVerticalScrolling?: boolean, cropAspect?: number }} PopupOptions - Options for the popup.
|
* @typedef {{okButton?: string, rows?: number, wide?: boolean, wider?: boolean, large?: boolean, allowHorizontalScrolling?: boolean, allowVerticalScrolling?: boolean, cropAspect?: number }} PopupOptions - Options for the popup.
|
||||||
* @returns
|
* @returns {Promise<any>} A promise that resolves when the popup is closed.
|
||||||
|
* @deprecated Use `callGenericPopup` instead.
|
||||||
*/
|
*/
|
||||||
export function callPopup(text, type, inputValue = '', { okButton, rows, wide, wider, large, allowHorizontalScrolling, allowVerticalScrolling, cropAspect } = {}) {
|
export function callPopup(text, type, inputValue = '', { okButton, rows, wide, wider, large, allowHorizontalScrolling, allowVerticalScrolling, cropAspect } = {}) {
|
||||||
function getOkButtonText() {
|
function getOkButtonText() {
|
||||||
@@ -7815,6 +7816,7 @@ window['SillyTavern'].getContext = function () {
|
|||||||
eventTypes: event_types,
|
eventTypes: event_types,
|
||||||
addOneMessage: addOneMessage,
|
addOneMessage: addOneMessage,
|
||||||
generate: Generate,
|
generate: Generate,
|
||||||
|
stopGeneration: stopGeneration,
|
||||||
getTokenCount: getTokenCount,
|
getTokenCount: getTokenCount,
|
||||||
extensionPrompts: extension_prompts,
|
extensionPrompts: extension_prompts,
|
||||||
setExtensionPrompt: setExtensionPrompt,
|
setExtensionPrompt: setExtensionPrompt,
|
||||||
@@ -7870,6 +7872,8 @@ window['SillyTavern'].getContext = function () {
|
|||||||
* @deprecated Legacy snake-case naming, compatibility with old extensions
|
* @deprecated Legacy snake-case naming, compatibility with old extensions
|
||||||
*/
|
*/
|
||||||
event_types: event_types,
|
event_types: event_types,
|
||||||
|
POPUP_TYPE: POPUP_TYPE,
|
||||||
|
POPUP_RESULT: POPUP_RESULT,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user