Przeglądaj źródła

Include isPageBlock property in insertBlock

Currently, using the isPageBlock property when using insertBlock allows you to insert a block on an empty page. However, there will be a TS error as shown below:
```
Argument of type '{ isPageBlock: boolean; }' is not assignable to parameter of type 'Partial<{ before: boolean; sibling: boolean; properties: {}; }>'.
  Object literal may only specify known properties, and 'isPageBlock' does not exist in type 'Partial<{ before: boolean; sibling: boolean; properties: {}; }>'.
```
This PR attempts to remove this lint error.
hkgnp 4 lat temu
rodzic
commit
0824a1bbd6
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      libs/src/LSPlugin.ts

+ 1 - 1
libs/src/LSPlugin.ts

@@ -346,7 +346,7 @@ export interface IEditorProxy extends Record<string, any> {
   insertBlock: (
     srcBlock: BlockIdentity,
     content: string,
-    opts?: Partial<{ before: boolean; sibling: boolean; properties: {} }>
+    opts?: Partial<{ before: boolean; sibling: boolean; isPageBlock: boolean; properties: {} }>
   ) => Promise<BlockEntity | null>
 
   insertBatchBlock: (