mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-24 04:27:27 +08:00
@@ -3,7 +3,6 @@ import { ModuleStartupConfigDescriptions } from '../fundamentals/config/types';
|
|||||||
export interface PluginsConfig {}
|
export interface PluginsConfig {}
|
||||||
export type AvailablePlugins = keyof PluginsConfig;
|
export type AvailablePlugins = keyof PluginsConfig;
|
||||||
|
|
||||||
declare module '../fundamentals/config' {}
|
|
||||||
declare module '../fundamentals/config' {
|
declare module '../fundamentals/config' {
|
||||||
interface AppConfig {
|
interface AppConfig {
|
||||||
plugins: PluginsConfig;
|
plugins: PluginsConfig;
|
||||||
@@ -16,5 +15,16 @@ declare module '../fundamentals/config' {
|
|||||||
ModuleStartupConfigDescriptions<PluginsConfig[Plugin]>
|
ModuleStartupConfigDescriptions<PluginsConfig[Plugin]>
|
||||||
>
|
>
|
||||||
): void;
|
): 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`
|
// 2. generate AFFiNE default config and assign to `globalThis.AFFiNE`
|
||||||
globalThis.AFFiNE = getAFFiNEConfigModifier();
|
globalThis.AFFiNE = getAFFiNEConfigModifier();
|
||||||
globalThis.AFFiNE.use = enablePlugin;
|
globalThis.AFFiNE.use = enablePlugin;
|
||||||
|
globalThis.AFFiNE.plugins.use = enablePlugin;
|
||||||
|
|
||||||
// TODO(@forehalo):
|
// TODO(@forehalo):
|
||||||
// Modules may contribute to ENV_MAP, figure out a good way to involve them instead of hardcoding in `./config/affine.env`
|
// 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