docs(editor): scaffolding docs generator (#10925)

This commit is contained in:
Saul-Mirone
2025-03-17 12:51:08 +00:00
parent 363c9799f3
commit 1d04438049
59 changed files with 2101 additions and 9 deletions

View File

@@ -1,11 +1,6 @@
import type { Container } from '@blocksuite/global/di';
/**
* Generic extension.
* Extensions are used to set up the dependency injection container.
* In most cases, you won't need to use this class directly.
* We provide helper classes like `CommandExtension` and `BlockViewExtension` to make it easier to create extensions.
*
* # Understanding Extensions
*
* Extensions provide a way to extend the functionality of a system using dependency injection.
@@ -125,6 +120,8 @@ import type { Container } from '@blocksuite/global/di';
* pattern can be applied to any entity that can be configured by third parties, not just blocks.
* This includes different tools in the whiteboard, different column types in database blocks,
* and many other extensible components. The pattern remains the same regardless of what you're extending.
*
* @category Extension
*/
export abstract class Extension {
static setup(_di: Container): void {

View File

@@ -10,15 +10,31 @@ export const StoreExtensionIdentifier =
export const storeExtensionSymbol = Symbol('StoreExtension');
/**
* Store extensions are used to extend the store.
* They should be registered to the store. And they should be able to run in a none-dom environment.
*
* @category Extension
*/
export class StoreExtension extends Extension {
/**
* The key of the store extension.
* **You must override this property with a unique string.**
*/
static readonly key: string;
constructor(readonly store: Store) {
super();
}
/**
* Lifecycle hook when the yjs document is loaded.
*/
loaded() {}
/**
* Lifecycle hook when the yjs document is disposed.
*/
disposed() {}
static readonly [storeExtensionSymbol] = true;

View File

@@ -42,6 +42,7 @@ export type DocCollectionOptions = {
};
/**
* @internal
* Test only
* Do not use this in production
*/