-
Notifications
You must be signed in to change notification settings - Fork 2
/
HomeUrl.ts
39 lines (33 loc) · 836 Bytes
/
HomeUrl.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @module HomeUrl
*/
import { Abstract } from './Abstract'
export enum WebviewShareButton {
SHOW = 'show',
HIDE = 'hide'
}
export interface HomeUrlOption {
webviewShareButton?: WebviewShareButton | 'show' | 'hide'
}
/**
* @see {@link https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/get-started-button}
*/
export class HomeUrl extends Abstract {
constructor (url: String, inTest: Boolean, option: HomeUrlOption = {}) {
const constructure = {
home_url: {
url,
webview_height_ratio: 'tall',
webview_share_button: option.webviewShareButton,
in_test: inTest
}
}
super(constructure)
}
static get WebviewShareButton () {
return WebviewShareButton
}
get WebviewShareButton () {
return WebviewShareButton
}
}