@rimori/client 2.5.28-next.3 → 2.5.28-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { ThirdPartyModule, i18n as i18nType } from 'i18next';
1
+ import { ThirdPartyModule, TOptions } from 'i18next';
2
2
  import { AIModule } from '../plugin/module/AIModule';
3
3
  /**
4
4
  * Translator class for handling internationalization
@@ -32,7 +32,7 @@ export declare class Translator {
32
32
  * @param options - Translation options
33
33
  * @returns Translated string
34
34
  */
35
- t(...args: Parameters<i18nType['t']>): string;
35
+ t(key: string, options?: TOptions): string;
36
36
  /**
37
37
  * Get current language
38
38
  */
@@ -130,11 +130,12 @@ export class Translator {
130
130
  * @param options - Translation options
131
131
  * @returns Translated string
132
132
  */
133
- t(...args) {
133
+ t(key, options) {
134
134
  if (!this.i18n) {
135
135
  throw new Error('Translator is not initialized');
136
136
  }
137
- return this.i18n.t(...args);
137
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
138
+ return this.i18n.t(key, options);
138
139
  }
139
140
  /**
140
141
  * Get current language
@@ -23,6 +23,11 @@ export declare class PluginModule {
23
23
  releaseChannel: string;
24
24
  applicationMode: ApplicationMode;
25
25
  theme: Theme;
26
+ /**
27
+ * Whether text-to-speech is globally enabled (set in rimori-main navbar).
28
+ * Updated automatically when the user toggles TTS.
29
+ */
30
+ ttsEnabled: boolean;
26
31
  constructor(supabase: SupabaseClient, communicationHandler: RimoriCommunicationHandler, info: RimoriInfo, ai: AIModule);
27
32
  /**
28
33
  * Fetches settings based on guild configuration.
@@ -14,6 +14,12 @@ import { Translator } from '../../controller/TranslationController';
14
14
  */
15
15
  export class PluginModule {
16
16
  constructor(supabase, communicationHandler, info, ai) {
17
+ var _a;
18
+ /**
19
+ * Whether text-to-speech is globally enabled (set in rimori-main navbar).
20
+ * Updated automatically when the user toggles TTS.
21
+ */
22
+ this.ttsEnabled = true;
17
23
  this.rimoriInfo = info;
18
24
  this.supabase = supabase;
19
25
  this.pluginId = info.pluginId;
@@ -21,7 +27,12 @@ export class PluginModule {
21
27
  this.communicationHandler = communicationHandler;
22
28
  const currentPlugin = info.installedPlugins.find((plugin) => plugin.id === info.pluginId);
23
29
  this.translator = new Translator(info.interfaceLanguage, (currentPlugin === null || currentPlugin === void 0 ? void 0 : currentPlugin.endpoint) || '', ai);
24
- this.communicationHandler.onUpdate((updatedInfo) => (this.rimoriInfo = updatedInfo));
30
+ this.ttsEnabled = (_a = info.ttsEnabled) !== null && _a !== void 0 ? _a : true;
31
+ this.communicationHandler.onUpdate((updatedInfo) => {
32
+ var _a;
33
+ this.rimoriInfo = updatedInfo;
34
+ this.ttsEnabled = (_a = updatedInfo.ttsEnabled) !== null && _a !== void 0 ? _a : true;
35
+ });
25
36
  this.applicationMode = this.communicationHandler.getQueryParam('applicationMode');
26
37
  this.theme = this.communicationHandler.getQueryParam('rm_theme') || 'light';
27
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimori/client",
3
- "version": "2.5.28-next.3",
3
+ "version": "2.5.28-next.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {