Skip to content

Commit

Permalink
feat(core): 增加类型定义
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Aug 28, 2019
1 parent 9042b34 commit dc3242d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/mars-core/types/mars.d.ts
Expand Up @@ -4,7 +4,8 @@ import {
swanApiOptionsGetStorage,
backgroundAudioManager,
swanApiOptionsRecognizeImage,
swanApiOptionsSetKeepScreenOn
swanApiOptionsSetKeepScreenOn,
systemInfo
} from './swan';
declare global {
const getApp: () => swanApp;
Expand Down Expand Up @@ -54,4 +55,5 @@ export interface marsApis {
exec: (options?: any) => void;
};
setKeepScreenOn: (options?: swanApiOptionsSetKeepScreenOn) => Promise<any>;
getSystemInfo: () => Promise<systemInfo>;
}
4 changes: 2 additions & 2 deletions packages/mars-core/types/swan.d.ts
Expand Up @@ -8,6 +8,7 @@ export interface swan {
navigateToSmartProgram: (options: swanApiOptionsNavigateToSmartProgram) => void;
getStorage: (options: swanApiOptionsGetStorage) => void;
setNavigationBarTitle: (options: swanApiOptionsSetNavigationBarTitle) => void;
isLoginSync: (options?: any) => {isLogin: boolean};
}

interface swanApiOptionsBase {
Expand Down Expand Up @@ -86,7 +87,7 @@ export interface swanApiOptionsRecognizeImage extends swanApiOptionsBase {
showTitle?: boolean;
}

interface systemInfo {
export interface systemInfo {
brand: string;
model: string;
pixelRatio: string;
Expand Down Expand Up @@ -115,4 +116,3 @@ export interface backgroundAudioManager {
pause: () => void;
src: string;
}

0 comments on commit dc3242d

Please sign in to comment.