mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 11:36:25 +08:00
refactor(editor): remove global types in config (#10143)
Closes: [BS-2554](https://linear.app/affine-design/issue/BS-2554/remove-global-types-in-block-config)
This commit is contained in:
@@ -18,7 +18,6 @@ import { SurfaceMiddlewareExtension } from '../gfx/surface-middleware.js';
|
||||
import { ViewManager } from '../gfx/view/view-manager.js';
|
||||
import {
|
||||
BlockViewIdentifier,
|
||||
ConfigIdentifier,
|
||||
LifeCycleWatcherIdentifier,
|
||||
StdIdentifier,
|
||||
} from '../identifier.js';
|
||||
@@ -137,19 +136,6 @@ export class BlockStdScope {
|
||||
});
|
||||
}
|
||||
|
||||
getConfig<Key extends BlockSuite.ConfigKeys>(
|
||||
flavour: Key
|
||||
): BlockSuite.BlockConfigs[Key] | null;
|
||||
|
||||
getConfig(flavour: string) {
|
||||
const config = this.provider.getOptional(ConfigIdentifier(flavour));
|
||||
if (!config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
getView(flavour: string) {
|
||||
return this.getOptional(BlockViewIdentifier(flavour));
|
||||
}
|
||||
@@ -191,11 +177,3 @@ export class BlockStdScope {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace BlockSuite {
|
||||
interface BlockConfigs {}
|
||||
|
||||
type ConfigKeys = string & keyof BlockConfigs;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user