mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
25 lines
694 B
TypeScript
25 lines
694 B
TypeScript
import type { Doc as BlockSuiteDoc } from '@blocksuite/store';
|
|
|
|
import type { ServiceCollection } from '../di';
|
|
import { createIdentifier } from '../di';
|
|
import type { PageRecord } from './record';
|
|
import { PageScope } from './service-scope';
|
|
|
|
export const BlockSuitePageContext = createIdentifier<BlockSuiteDoc>(
|
|
'BlockSuitePageContext'
|
|
);
|
|
|
|
export const PageRecordContext =
|
|
createIdentifier<PageRecord>('PageRecordContext');
|
|
|
|
export function configurePageContext(
|
|
services: ServiceCollection,
|
|
blockSuitePage: BlockSuiteDoc,
|
|
pageRecord: PageRecord
|
|
) {
|
|
services
|
|
.scope(PageScope)
|
|
.addImpl(PageRecordContext, pageRecord)
|
|
.addImpl(BlockSuitePageContext, blockSuitePage);
|
|
}
|