Skip to content

Commit

Permalink
添加 dashboard api 对插件的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
irinakk committed Jun 15, 2018
1 parent 3d51fc4 commit 33012ff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/api/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { APIBase, factory, IFactory } from './base'

export interface DashboardAPI {
registerHostNode(): Promise<HTMLElement>
setReady(): Promise<void>
essage(type: 'show' | 'error' | 'log' | 'success' | 'warning', ...params: any[]): Promise<void>
openDetail(type: 'task' | 'date' | 'file' | 'post' | 'bookkeeping', ...params: any[]): Promise<void>
openDetail(type: 'task' | 'event' | 'work' | 'post' | 'entry' | 'collection', ...params: any[]): Promise<void>
openDashboardModal(...params: any[]): Promise<void>
closeFloat(): Promise<void>
transferStyleNode(...params: any[]): Promise<void>
handlePlugin(...params: any[]): Promise<void>
}

class HostAPI extends APIBase {
Expand All @@ -20,6 +22,10 @@ class HostAPI extends APIBase {
return this.call('transferStyleNode', ...params)
}

setReady(...params: any[]) {
return this.call('setReady', ...params)
}

essage(...params: any[]) {
return this.call('essage', ...params)
}
Expand All @@ -36,6 +42,10 @@ class HostAPI extends APIBase {
return this.call('closeFloat', ...params)
}

handlePlugin(...params: any[]) {
return this.call('handlePlugin', ...params)
}

}

export const hostAPI: IFactory<DashboardAPI> = (sdk: AppSDK) => {
Expand Down

0 comments on commit 33012ff

Please sign in to comment.