refactor(editor): should not rely on doc collection type (#9501)

This commit is contained in:
Saul-Mirone
2025-01-03 06:30:27 +00:00
parent cb5d7eaabc
commit 897c7d4284
55 changed files with 200 additions and 158 deletions

View File

@@ -1,7 +1,7 @@
// This file should has not side effect
// oxlint-disable-next-line
// @ts-ignore FIXME: typecheck error
import type { DocCollection } from '@blocksuite/affine/store';
import type { Workspace } from '@blocksuite/affine/store';
declare global {
// oxlint-disable-next-line no-var
@@ -91,10 +91,10 @@ export const Messages = {
};
export class PageNotFoundError extends TypeError {
readonly docCollection: DocCollection;
readonly docCollection: Workspace;
readonly pageId: string;
constructor(docCollection: DocCollection, pageId: string) {
constructor(docCollection: Workspace, pageId: string) {
super();
this.docCollection = docCollection;
this.pageId = pageId;

View File

@@ -1,4 +1,4 @@
import type { DocCollection } from '@blocksuite/affine/store';
import type { DocsPropertiesMeta } from '@blocksuite/affine/store';
import { z } from 'zod';
export const literalValueSchema: z.ZodType<LiteralValue, z.ZodTypeDef> =
@@ -29,7 +29,6 @@ export type Ref = {
name: keyof VariableMap;
};
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface VariableMap {}
export const literalSchema = z.object({
@@ -85,4 +84,4 @@ export const tagSchema = z.object({
});
export type Tag = z.input<typeof tagSchema>;
export type PropertiesMeta = DocCollection['meta']['properties'];
export type PropertiesMeta = DocsPropertiesMeta;