@rimori/client 2.5.18-next.2 → 2.5.18-next.4
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.
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { Translator } from './controller/TranslationController';
|
|
|
15
15
|
export type { TriggerAction } from './plugin/module/ExerciseModule';
|
|
16
16
|
export type { Message, ToolInvocation } from './plugin/module/AIModule';
|
|
17
17
|
export type { Theme, ApplicationMode } from './plugin/module/PluginModule';
|
|
18
|
-
export type { UserInfo, Language, UserRole, ExplicitUndefined } from './plugin/module/PluginModule';
|
|
18
|
+
export type { UserInfo, Language, UserRole, ExplicitUndefined, BasePluginSettings } from './plugin/module/PluginModule';
|
|
19
19
|
export type { SharedContent, BasicSharedContent, ContentStatus } from './plugin/module/SharedContentController';
|
|
20
20
|
export type { MacroAccomplishmentPayload, MicroAccomplishmentPayload } from './controller/AccomplishmentController';
|
|
21
21
|
export { StorageModule } from './plugin/module/StorageModule';
|
|
@@ -32,7 +32,7 @@ export class EventModule {
|
|
|
32
32
|
const topicParts = preliminaryTopic.split('.');
|
|
33
33
|
if (topicParts.length === 3) {
|
|
34
34
|
if (!topicParts[0].startsWith('pl') && topicParts[0] !== 'global') {
|
|
35
|
-
throw new Error(
|
|
35
|
+
throw new Error(`Invalid event topic '${preliminaryTopic}'. The topic must start with the plugin id, 'self' or 'global'.`);
|
|
36
36
|
}
|
|
37
37
|
return preliminaryTopic;
|
|
38
38
|
}
|
|
@@ -44,7 +44,7 @@ export declare class PluginModule {
|
|
|
44
44
|
* @param defaultSettings The default settings to use if no settings are found.
|
|
45
45
|
* @returns The settings for the plugin.
|
|
46
46
|
*/
|
|
47
|
-
getSettings<T>(defaultSettings: ExplicitUndefined<T>): Promise<ExplicitUndefined<T>>;
|
|
47
|
+
getSettings<T extends BasePluginSettings>(defaultSettings: ExplicitUndefined<T>): Promise<ExplicitUndefined<T>>;
|
|
48
48
|
/**
|
|
49
49
|
* Get the current user info.
|
|
50
50
|
* Note: For reactive updates in React components, use the userInfo from useRimori() hook instead.
|
|
@@ -110,6 +110,13 @@ export type LearningReason = (typeof LEARNING_REASONS)[number];
|
|
|
110
110
|
export type ExplicitUndefined<T> = {
|
|
111
111
|
[K in Exclude<keyof T, never>]-?: {} extends Pick<T, K> ? T[K] | undefined : T[K];
|
|
112
112
|
};
|
|
113
|
+
/**
|
|
114
|
+
* All plugin settings must include is_inited so rimori-main can detect
|
|
115
|
+
* plugins whose one-time worker init did not complete and re-trigger them.
|
|
116
|
+
*/
|
|
117
|
+
export type BasePluginSettings = {
|
|
118
|
+
is_inited: boolean;
|
|
119
|
+
};
|
|
113
120
|
export interface UserInfo {
|
|
114
121
|
/**
|
|
115
122
|
* The user's unique ID
|