mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 09:52:49 +08:00
@@ -3,7 +3,6 @@ import { ModuleStartupConfigDescriptions } from '../fundamentals/config/types';
|
||||
export interface PluginsConfig {}
|
||||
export type AvailablePlugins = keyof PluginsConfig;
|
||||
|
||||
declare module '../fundamentals/config' {}
|
||||
declare module '../fundamentals/config' {
|
||||
interface AppConfig {
|
||||
plugins: PluginsConfig;
|
||||
@@ -16,5 +15,16 @@ declare module '../fundamentals/config' {
|
||||
ModuleStartupConfigDescriptions<PluginsConfig[Plugin]>
|
||||
>
|
||||
): void;
|
||||
plugins: {
|
||||
/**
|
||||
* @deprecated use `AFFiNE.use` instead
|
||||
*/
|
||||
use<Plugin extends AvailablePlugins>(
|
||||
plugin: Plugin,
|
||||
config?: DeepPartial<
|
||||
ModuleStartupConfigDescriptions<PluginsConfig[Plugin]>
|
||||
>
|
||||
): void;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ async function load() {
|
||||
// 2. generate AFFiNE default config and assign to `globalThis.AFFiNE`
|
||||
globalThis.AFFiNE = getAFFiNEConfigModifier();
|
||||
globalThis.AFFiNE.use = enablePlugin;
|
||||
globalThis.AFFiNE.plugins.use = enablePlugin;
|
||||
|
||||
// TODO(@forehalo):
|
||||
// Modules may contribute to ENV_MAP, figure out a good way to involve them instead of hardcoding in `./config/affine.env`
|
||||
|
||||
Reference in New Issue
Block a user