@@ -699,15 +699,13 @@ export interface IEditorProxy extends Record<string, any> {
699699 * @param opts
700700 */
701701 insertBlock : (
702- srcBlock : BlockIdentity ,
702+ srcBlock : BlockIdentity | EntityID ,
703703 content : string ,
704704 opts ?: Partial < {
705705 before : boolean
706706 sibling : boolean
707707 start : boolean
708708 end : boolean
709- isPageBlock : boolean
710- focus : boolean
711709 customUUID : string
712710 properties : { }
713711 } >
@@ -725,30 +723,20 @@ export interface IEditorProxy extends Record<string, any> {
725723 ) => Promise < Array < BlockEntity > | null >
726724
727725 updateBlock : (
728- srcBlock : BlockIdentity ,
726+ srcBlock : BlockIdentity | EntityID ,
729727 content : string ,
730728 opts ?: Partial < { properties : { } } >
731729 ) => Promise < void >
732730
733- removeBlock : ( srcBlock : BlockIdentity ) => Promise < void >
731+ removeBlock : ( srcBlock : BlockIdentity | EntityID ) => Promise < void >
734732
735733 getBlock : (
736734 srcBlock : BlockIdentity | EntityID ,
737735 opts ?: Partial < { includeChildren : boolean } >
738736 ) => Promise < BlockEntity | null >
739737
740- /**
741- * @example
742- *
743- * ```ts
744- * logseq.Editor.setBlockCollapsed('uuid', true)
745- * logseq.Editor.setBlockCollapsed('uuid', 'toggle')
746- * ```
747- * @param uuid
748- * @param opts
749- */
750738 setBlockCollapsed : (
751- uuid : BlockUUID ,
739+ srcBlock : BlockIdentity | EntityID ,
752740 opts : { flag : boolean | 'toggle' } | boolean | 'toggle'
753741 ) => Promise < void >
754742
@@ -782,7 +770,8 @@ export interface IEditorProxy extends Record<string, any> {
782770 getAllProperties : ( ) => Promise < PageEntity [ ] | null >
783771 getTagObjects : ( nameOrIdent : string ) => Promise < BlockEntity [ ] | null >
784772 createTag : ( tagName : string , opts ?: Partial < { uuid : string } > ) => Promise < PageEntity | null >
785- getTag : ( nameOrIdent : string ) => Promise < PageEntity | null >
773+ getTag : ( nameOrIdent : string | EntityID ) => Promise < PageEntity | null >
774+ getTagsByName : ( tagName : string ) => Promise < Array < PageEntity > | null >
786775 addTagProperty : ( tagId : BlockIdentity , propertyIdOrName : BlockIdentity ) => Promise < void >
787776 removeTagProperty : ( tagId : BlockIdentity , propertyIdOrName : BlockIdentity ) => Promise < void >
788777 addTagExtends : ( tagId : BlockIdentity , parentTagIdOrName : BlockIdentity ) => Promise < void >
@@ -808,11 +797,11 @@ export interface IEditorProxy extends Record<string, any> {
808797 ) => Promise < BlockEntity | null >
809798
810799 getPreviousSiblingBlock : (
811- srcBlock : BlockIdentity
800+ srcBlock : BlockIdentity | EntityID
812801 ) => Promise < BlockEntity | null >
813802
814803 getNextSiblingBlock : (
815- srcBlock : BlockIdentity
804+ srcBlock : BlockIdentity | EntityID
816805 ) => Promise < BlockEntity | null >
817806
818807 moveBlock : (
@@ -845,17 +834,15 @@ export interface IEditorProxy extends Record<string, any> {
845834
846835 // block property related APIs
847836 upsertBlockProperty : (
848- block : BlockIdentity ,
837+ block : BlockIdentity | EntityID ,
849838 key : string ,
850839 value : any
851840 ) => Promise < void >
852841
853- removeBlockProperty : ( block : BlockIdentity , key : string ) => Promise < void >
854-
855- getBlockProperty : ( block : BlockIdentity , key : string ) => Promise < BlockEntity | unknown >
856-
857- getBlockProperties : ( block : BlockIdentity ) => Promise < Record < string , any > | null >
858- getPageProperties : ( page : PageIdentity ) => Promise < Record < string , any > | null >
842+ removeBlockProperty : ( block : BlockIdentity | EntityID , key : string ) => Promise < void >
843+ getBlockProperty : ( block : BlockIdentity | EntityID , key : string ) => Promise < BlockEntity | null >
844+ getBlockProperties : ( block : BlockIdentity | EntityID ) => Promise < Record < string , any > | null >
845+ getPageProperties : ( page : PageIdentity | EntityID ) => Promise < Record < string , any > | null >
859846
860847 scrollToBlockInPage : (
861848 pageName : BlockPageName ,
@@ -864,6 +851,7 @@ export interface IEditorProxy extends Record<string, any> {
864851 ) => void
865852
866853 openInRightSidebar : ( id : BlockUUID | EntityID ) => void
854+ openPDFViewer : ( assetBlockIdOrFileUrl : string | EntityID ) => Promise < void >
867855
868856 /**
869857 * @example https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-a-translator
0 commit comments