zaileys 4.8.9 → 4.9.0
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/client/client.d.ts +7 -3
- package/dist/client/types.d.ts +21 -1
- package/dist/command/dispatcher.d.ts +6 -0
- package/dist/command/guards.d.ts +17 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/registry.d.ts +5 -3
- package/dist/command/types.d.ts +34 -0
- package/dist/index.cjs +16 -16
- package/dist/index.mjs +16 -16
- package/dist/plugin/registry.d.ts +3 -3
- package/dist/plugin/types.d.ts +4 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Logger } from '../client/types.js';
|
|
2
2
|
import type { Plugin, PluginContext } from './types.js';
|
|
3
3
|
export interface PluginHost {
|
|
4
|
-
command(spec:
|
|
5
|
-
unregisterCommand(spec:
|
|
4
|
+
command(spec: Parameters<PluginContext['command']>[0], handler: Parameters<PluginContext['command']>[1]): unknown;
|
|
5
|
+
unregisterCommand(spec: Parameters<PluginContext["command"]>[0]): void;
|
|
6
6
|
use(mw: Parameters<PluginContext['use']>[0]): unknown;
|
|
7
7
|
unuse(mw: Parameters<PluginContext['use']>[0]): unknown;
|
|
8
8
|
on: PluginContext['on'];
|
|
@@ -18,7 +18,7 @@ export declare class PluginRegistry {
|
|
|
18
18
|
});
|
|
19
19
|
has(name: string): boolean;
|
|
20
20
|
list(): string[];
|
|
21
|
-
loadPlugin(plugin: Plugin, file: string): Promise<void>;
|
|
21
|
+
loadPlugin(plugin: Plugin, file: string, rootDir?: string): Promise<void>;
|
|
22
22
|
unload(name: string): Promise<void>;
|
|
23
23
|
unloadAll(): Promise<void>;
|
|
24
24
|
}
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Client } from '../client/client.js';
|
|
2
2
|
import type { Logger, ClientEventMap } from '../client/types.js';
|
|
3
|
-
import type { CommandHandler, Middleware } from '../command/index.js';
|
|
3
|
+
import type { CommandHandler, CommandSpec, Middleware } from '../command/index.js';
|
|
4
4
|
export interface PluginContext {
|
|
5
5
|
client: Client;
|
|
6
6
|
logger: Logger | undefined;
|
|
7
7
|
pluginDir: string;
|
|
8
|
-
|
|
8
|
+
/** The subfolder this plugin lives in. Commands default their `category` to it. */
|
|
9
|
+
category: string | undefined;
|
|
10
|
+
command(spec: string | CommandSpec, handler: CommandHandler): void;
|
|
9
11
|
use(middleware: Middleware): void;
|
|
10
12
|
on<E extends keyof ClientEventMap>(event: E, handler: (payload: ClientEventMap[E]) => void): () => void;
|
|
11
13
|
once<E extends keyof ClientEventMap>(event: E, handler: (payload: ClientEventMap[E]) => void): () => void;
|