mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
improve(plugin): update types
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
safetyPathJoin,
|
||||
} from './helpers'
|
||||
import { LSPluginCaller } from './LSPlugin.caller'
|
||||
import * as callableAPIs from './callable.apis'
|
||||
import {
|
||||
IAppProxy,
|
||||
IDBProxy,
|
||||
@@ -48,6 +49,9 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
type callableMethods =
|
||||
keyof typeof callableAPIs | string // host exported SDK apis & host platform related apis
|
||||
|
||||
const PROXY_CONTINUE = Symbol.for('proxy-continue')
|
||||
const debug = Debug('LSPlugin:user')
|
||||
|
||||
@@ -623,14 +627,14 @@ export class LSPluginUser
|
||||
})
|
||||
}
|
||||
|
||||
_execCallableAPIAsync(method, ...args) {
|
||||
_execCallableAPIAsync(method: callableMethods, ...args) {
|
||||
return this._caller.callAsync(`api:call`, {
|
||||
method,
|
||||
args,
|
||||
})
|
||||
}
|
||||
|
||||
_execCallableAPI(method, ...args) {
|
||||
_execCallableAPI(method: callableMethods, ...args) {
|
||||
this._caller.call(`api:call`, {
|
||||
method,
|
||||
args,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { PluginLocal } from './LSPlugin.core'
|
||||
|
||||
/**
|
||||
* Run in host
|
||||
*/
|
||||
export function setSDKMetadata(this: PluginLocal, data: any) {
|
||||
if (this?.sdk && data) {
|
||||
this.sdk = Object.assign({}, this.sdk, data)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
[:div.flex.flex-row.items-center.mr-2.ml-1 {:style {:height 24}}
|
||||
[:span.bullet-container.cursor
|
||||
[:span.bullet]]]
|
||||
[:div.flex.flex-1 {:tabindex 0
|
||||
[:div.flex.flex-1 {:tabIndex 0
|
||||
:on-key-press (fn [e]
|
||||
(when (= "Enter" (util/ekey e))
|
||||
(handler-fn)))
|
||||
|
||||
Reference in New Issue
Block a user