Skip to content

Commit

Permalink
feat(core): 增加 recognizeImage 类型定义
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Aug 21, 2019
1 parent 28aaced commit 802dec5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/mars-core/types/mars.d.ts
Expand Up @@ -2,7 +2,8 @@ import {
swan,
swanApiOptionsNavigateToSmartProgram,
swanApiOptionsGetStorage,
backgroundAudioManager
backgroundAudioManager,
swanApiOptionsRecognizeImage
} from './swan';
declare global {
const getApp: () => swanApp;
Expand All @@ -28,8 +29,19 @@ export interface marsApis {
redirectTo: (options?: any) => Promise<any>;
navigateTo: (options?: any) => Promise<any>;
navigateBack: (options?: any) => Promise<any>;

chooseImage: (options?: any) => Promise<any>;
recognizeImage: (options?: swanApiOptionsRecognizeImage) => Promise<{
barcodeResult: {
result: string;
codeType: string;
},
imageResult: {
data: {
resultUrl: string;
resultWord: string[];
}[];
}
}>;

createSelectorQuery: () => {
select: (options?: any) => {
Expand Down
16 changes: 16 additions & 0 deletions packages/mars-core/types/swan.d.ts
Expand Up @@ -66,6 +66,22 @@ export interface swanApiOptionsGetStorage extends swanApiOptionsBase {
key: string;
}

export interface swanApiOptionsRecognizeImage extends swanApiOptionsBase {
categoryList: string[];
customTips: {
BARCODE?: {
topTip?: string;
bottomTip?: string;
},
AR?: {
guideTip?: string;
resultTitle?: string;
}
};
index?: number;
showTitle?: boolean;
}

interface systemInfo {
brand: string;
model: string;
Expand Down

0 comments on commit 802dec5

Please sign in to comment.