mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
refactor(editor): remove global types in edgeless (#10092)
Closes: [BS-2553](https://linear.app/affine-design/issue/BS-2553/remove-global-types-in-edgeless)
This commit is contained in:
@@ -34,12 +34,3 @@ export const AIChatBlockSchema = defineBlockSchema({
|
||||
});
|
||||
|
||||
export class AIChatBlockModel extends GfxCompatible<AIChatProps>(BlockModel) {}
|
||||
|
||||
declare global {
|
||||
// oxlint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace BlockSuite {
|
||||
interface EdgelessBlockModelMap {
|
||||
'affine:embed-ai-chat': AIChatBlockModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { getCopilotHistoriesQuery, RequestOptions } from '@affine/graphql';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type { GfxModel } from '@blocksuite/affine/block-std/gfx';
|
||||
import type { BlockModel } from '@blocksuite/affine/store';
|
||||
|
||||
import type { DocContext } from '../chat-panel/chat-context';
|
||||
@@ -72,7 +73,7 @@ declare global {
|
||||
|
||||
// internal context
|
||||
host: EditorHost;
|
||||
models?: (BlockModel | BlockSuite.SurfaceElementModel)[];
|
||||
models?: (BlockModel | GfxModel)[];
|
||||
control: TrackerControl;
|
||||
where: TrackerWhere;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import { mixpanel, track } from '@affine/track';
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import type { GfxPrimitiveElementModel } from '@blocksuite/affine/block-std/gfx';
|
||||
import type { BlockModel } from '@blocksuite/affine/store';
|
||||
import { lowerCase, omit } from 'lodash-es';
|
||||
|
||||
type ElementModel = BlockSuite.SurfaceElementModel;
|
||||
type ElementModel = GfxPrimitiveElementModel;
|
||||
|
||||
type AIActionEventName =
|
||||
| 'AI action invoked'
|
||||
|
||||
Reference in New Issue
Block a user