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:
Saul-Mirone
2025-02-13 04:35:35 +00:00
parent dbf1d0038a
commit 9321ce94a7
34 changed files with 98 additions and 153 deletions
@@ -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;
}
}