chore: merge blocksuite source code (#9213)

This commit is contained in:
Mirone
2024-12-20 15:38:06 +08:00
committed by GitHub
parent 2c9ef916f4
commit 30200ff86d
2031 changed files with 238888 additions and 229 deletions

View File

@@ -0,0 +1,30 @@
import { ConfigIdentifier } from '../identifier.js';
import type { ExtensionType } from './extension.js';
/**
* Create a config extension.
* A config extension provides a configuration object for a block flavour.
* The configuration object can be used like:
* ```ts
* const config = std.provider.get(ConfigIdentifier('my-flavour'));
* ```
*
* @param flavor The flavour of the block that the config is for.
* @param config The configuration object.
*
* @example
* ```ts
* import { ConfigExtension } from '@blocksuite/block-std';
* const MyConfigExtension = ConfigExtension('my-flavour', config);
* ```
*/
export function ConfigExtension(
flavor: BlockSuite.Flavour,
config: Record<string, unknown>
): ExtensionType {
return {
setup: di => {
di.addImpl(ConfigIdentifier(flavor), () => config);
},
};
}