diff --git a/libs/src/LSPlugin.d.ts b/libs/src/LSPlugin.d.ts index 0a17129d3..1bef3a38c 100644 --- a/libs/src/LSPlugin.d.ts +++ b/libs/src/LSPlugin.d.ts @@ -82,26 +82,36 @@ interface AppUserConfigs { interface BlockEntity { id: number // db id uuid: string - anchor: string - body: any - children: Array - container: string - content: string - format: 'markdown' | 'org' - file: IEntityID left: IEntityID - level: number - meta: { timestamps: any, properties: any, startPos: number, endPos: number } - page: IEntityID + format: 'markdown' | 'org' parent: IEntityID - title: Array unordered: boolean + page: IEntityID + anchor?: string + body?: any + children?: Array + container?: string + content?: string + file?: IEntityID + level?: number + meta?: { timestamps: any, properties: any, startPos: number, endPos: number } + title?: Array [key: string]: any } +interface PageEntity extends IEntityID { + file: IEntityID + name: string + originalName: string + uuid: string + journal?: boolean + journalDay?: string +} + type BlockIdentity = BlockUUID | Pick type BlockPageName = string +type PageIdentity = BlockPageName | BlockIdentity type SlashCommandActionCmd = 'editor/input' | 'editor/hook' @@ -144,16 +154,18 @@ interface IEditorProxy { restoreEditingCursor: () => Promise exitEditingMode: (selectBlock?: boolean) => Promise getEditingCursorPosition: () => Promise - getCurrentPage: () => Promise | null> + getCurrentPage: () => Promise getCurrentBlock: () => Promise getCurrentBlockContent: () => Promise getCurrentPageBlocksTree: () => Promise> - getPageBlocksTree: (pageName: BlockPageName) => Promise> + getPageBlocksTree: (srcPage: PageIdentity) => Promise> insertBlock: (srcBlock: BlockIdentity, content: string, opts?: Partial<{ before: boolean, sibling: boolean, props: {} }>) => Promise updateBlock: (srcBlock: BlockIdentity, content: string, opts?: Partial<{ props: {} }>) => Promise removeBlock: (srcBlock: BlockIdentity, opts?: Partial<{ includeChildren: boolean }>) => Promise getBlock: (srcBlock: BlockIdentity | BlockID, opts?: Partial<{ includeChildren: boolean }>) => Promise + getPage: (srcPage: PageIdentity, opts?: Partial<{ includeChildren: boolean }>) => Promise + getPreviousSiblingBlock: (srcBlock: BlockIdentity) => Promise getNextSiblingBlock: (srcBlock: BlockIdentity) => Promise moveBlock: (srcBlock: BlockIdentity, targetBlock: BlockIdentity, opts?: Partial<{ before: boolean, children: boolean }>) => Promise