Skip to content

Commit

Permalink
feat: 新增 report app API
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoqiao committed Jun 13, 2018
1 parent 4a3c814 commit e3059e1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/api/report-app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { AppSDK } from '../sdk/AppSDK'
import { APIBase, factory, IFactory } from './base'

export interface ReportAppAPI {
start(...params: any[]): Promise<void>
essage(type: 'show' | 'error' | 'log' | 'success' | 'warning', ...params: any[]): Promise<void>
finish(...params: any[]): Promise<void>
}

class HostAPI extends APIBase {

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

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

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

}

export const hostAPI: IFactory<ReportAppAPI> = (sdk: AppSDK) => {
return factory<HostAPI>(sdk, HostAPI)
}

0 comments on commit e3059e1

Please sign in to comment.