mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-14 08:36:22 +08:00
refactor(editor): remove service global type (#10129)
Closes: [BS-2566](https://linear.app/affine-design/issue/BS-2566/remove-global-types-in-service)
This commit is contained in:
@@ -11,6 +11,7 @@ import { html } from 'lit/static-html.js';
|
||||
|
||||
import type { EventName, UIEventHandler } from '../../event/index.js';
|
||||
import type { BlockService } from '../../extension/index.js';
|
||||
import { BlockServiceIdentifier } from '../../identifier.js';
|
||||
import type { BlockStdScope } from '../../scope/index.js';
|
||||
import { BlockSelection } from '../../selection/index.js';
|
||||
import { PropTypes, requiredProperties } from '../decorators/index.js';
|
||||
@@ -146,9 +147,11 @@ export class BlockComponent<
|
||||
if (this._service) {
|
||||
return this._service;
|
||||
}
|
||||
const service = this.std.getService(this.model.flavour) as Service;
|
||||
this._service = service;
|
||||
return service;
|
||||
const service = this.std.getOptional(
|
||||
BlockServiceIdentifier(this.model.flavour)
|
||||
);
|
||||
this._service = service as Service;
|
||||
return service as Service;
|
||||
}
|
||||
|
||||
get topContenteditableElement(): BlockComponent | null {
|
||||
|
||||
Reference in New Issue
Block a user