-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from minh-rakuten/feature/MiniAppInterface_Uniq…
…ueId Feature/interface_uniqueID
- Loading branch information
Showing
9 changed files
with
1,174 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ | |
}, | ||
"homepage": "https://github.com/rakutentech/js-miniapp#readme" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/** This is a description of the foo function. */ | ||
function foo() { | ||
console.log('foo'); | ||
} | ||
import { MiniApp } from './miniapp'; | ||
|
||
const miniAppInstance = new MiniApp(); | ||
|
||
// tslint:disable-next-line:no-default-export | ||
export default miniAppInstance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* A module layer for webapps and mobile native interaction. | ||
*/ | ||
interface MiniAppInterface { | ||
/** @returns The Promise of provided id of mini app from injected side. */ | ||
getUniqueId(): Promise<string>; | ||
} | ||
|
||
/* tslint:disable:no-any */ | ||
export class MiniApp implements MiniAppInterface { | ||
getUniqueId(): Promise<string> { | ||
return (window as any).MiniAppBridge.getUniqueId(); | ||
} | ||
} | ||
|
||
// tslint:disable-next-line:no-default-export | ||
export default MiniApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { expect } from 'chai'; | ||
|
||
describe('sample test', () => { | ||
it('sample add', () => { | ||
expect(2 + 2).to.equal(4); | ||
}); | ||
}); | ||
// import { expect } from 'chai'; | ||
// | ||
// describe('sample test', () => { | ||
// it('sample add', () => { | ||
// expect(2 + 2).to.equal(4); | ||
// }); | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{ | ||
"private": true, | ||
"workspaces": ["js-miniapp-sdk", "js-miniapp-sample", "js-miniapp-bridge"], | ||
"workspaces": [ | ||
"js-miniapp-sdk", | ||
"js-miniapp-sample", | ||
"js-miniapp-bridge" | ||
], | ||
"scripts": { | ||
"sdk": "yarn workspace js-miniapp-sdk", | ||
"sample": "yarn workspace js-miniapp-sample", | ||
"bridge": "yarn workspace js-miniapp-bridge" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"compilerOptions": { | ||
"strict": false, | ||
"target": "ES5", | ||
"lib": ["dom"], | ||
"esModuleInterop": true | ||
} | ||
} |
Oops, something went wrong.