Fix lint issues in enum providers

fbcd546db2ed9c31d661bea2c9a72aff1887a087

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +8 -6Showing whitespace changes
public/scripts/slash-commands/SlashCommandCommonEnumsProvider.js+8 -6
@@ -6,7 +6,9 @@ import { searchCharByName, getTagsList, tags } from '../tags.js';
66import { world_names } from '../world-info.js';
77import { SlashCommandClosure } from './SlashCommandClosure.js';
88import { SlashCommandEnumValue, enumTypes } from './SlashCommandEnumValue.js';
9-import { SlashCommandScope } from "./SlashCommandScope.js";
9+
10+/** @typedef {import('./SlashCommandExecutor.js').SlashCommandExecutor} SlashCommandExecutor */
11+/** @typedef {import('./SlashCommandScope.js').SlashCommandScope} SlashCommandScope */
1012
1113/**
1214 * A collection of regularly used enum icons
@@ -140,7 +142,7 @@ export const commonEnumProviders = {
140142 * @param {...('global'|'local'|'scope'|'all')} type - The type of variables to include in the array. Can be 'all', 'global', or 'local'.
141143 * @returns {(executor:SlashCommandExecutor, scope:SlashCommandScope) => SlashCommandEnumValue[]}
142144 */
143145 variables: (...type) => (executor_, scope) => {
144146 const types = type.flat();
145147 const isAll = types.includes('all');
146148 return [
@@ -184,7 +186,7 @@ export const commonEnumProviders = {
184186 * @param {('all' | 'existing' | 'not-existing')?} [mode='all'] - Which types of tags to show
185187 * @returns {() => SlashCommandEnumValue[]}
186188 */
187189 tagsForChar: (mode = 'all') => (/** @type {import('./SlashCommandExecutor.js').SlashCommandExecutor} */ executor) => {
188190 // Try to see if we can find the char during execution to filter down the tags list some more. Otherwise take all tags.
189191 const charName = executor.namedArgumentList.find(it => it.name == 'name')?.value;
190192 if (charName instanceof SlashCommandClosure) throw new Error('Argument \'name\' does not support closures');
@@ -202,13 +204,13 @@ export const commonEnumProviders = {
202204 * @param {object} [options={}] - Optional arguments
203205 * @param {boolean} [options.allowIdAfter=false] - Whether to add an enum option for the new message id after the last message
204206 * @param {boolean} [options.allowVars=false] - Whether to add enum option for variable names
205207 * @returns {(executor:SlashCommandExecutor, scope:SlashCommandScope) => SlashCommandEnumValue[]}
206208 */
207209 messages: ({ allowIdAfter = false, allowVars = false } = {}) => (_, scope) => {
208210 return [
209211 ...chat.map((message, index) => new SlashCommandEnumValue(String(index), `${message.name}: ${message.mes}`, enumTypes.number, message.is_user ? enumIcons.user : message.is_system ? enumIcons.system : enumIcons.assistant)),
210212 ...allowIdAfter ? [new SlashCommandEnumValue(String(chat.length), '>> After Last Message >>', enumTypes.enum, '➕')] : [],
211213 ...allowVars ? commonEnumProviders.variables('all')(_, scope) : [],
212214 ];
213215 },
214216