|
|
@@ -79,6 +79,10 @@ export type BlockUUIDTuple = ['uuid', BlockUUID]
|
|
|
export type IEntityID = { id: BlockID }
|
|
|
export type IBatchBlock = { content: string, properties?: Record<string, any>, children?: Array<IBatchBlock> }
|
|
|
|
|
|
+export interface AppUserInfo {
|
|
|
+ [key: string]: any
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* User's app configurations
|
|
|
*/
|
|
|
@@ -91,6 +95,14 @@ export interface AppUserConfigs {
|
|
|
[key: string]: any
|
|
|
}
|
|
|
|
|
|
+export interface AppGraphInfo {
|
|
|
+ name: string
|
|
|
+ url: string
|
|
|
+ path: string
|
|
|
+
|
|
|
+ [key: string]: any
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Block - Logseq's fundamental data structure.
|
|
|
*/
|
|
|
@@ -148,7 +160,7 @@ export type BlockCursorPosition = { left: number, top: number, height: number, p
|
|
|
* App level APIs
|
|
|
*/
|
|
|
export interface IAppProxy {
|
|
|
- getUserInfo: () => Promise<any>
|
|
|
+ getUserInfo: () => Promise<AppUserInfo | null>
|
|
|
|
|
|
getUserConfigs: () => Promise<AppUserConfigs>
|
|
|
|
|
|
@@ -156,6 +168,9 @@ export interface IAppProxy {
|
|
|
relaunch: () => Promise<void>
|
|
|
quit: () => Promise<void>
|
|
|
|
|
|
+ // graph
|
|
|
+ getCurrentGraph: () => Promise<AppGraphInfo | null>
|
|
|
+
|
|
|
// router
|
|
|
pushState: (k: string, params?: {}) => void
|
|
|
replaceState: (k: string, params?: {}) => void
|
|
|
@@ -165,6 +180,7 @@ export interface IAppProxy {
|
|
|
setZoomFactor: (factor: number) => void
|
|
|
|
|
|
// events
|
|
|
+ onCurrentGraphChanged: IUserHook
|
|
|
onThemeModeChanged: IUserHook<{ mode: 'dark' | 'light' }>
|
|
|
onBlockRendererMounted: IUserSlotHook<{ uuid: BlockUUID }>
|
|
|
onRouteChanged: IUserHook<{ path: string, template: string }>
|