-
Notifications
You must be signed in to change notification settings - Fork 26
/
pages.ts
48 lines (43 loc) · 1.4 KB
/
pages.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
40
41
42
43
44
45
46
47
48
import { isInstanceOf } from '../helpers'
import { PropsUIFooter, PropsUIHeader } from './elements'
import {
PropsUIPromptFileInput,
PropsUIPromptConfirm,
PropsUIPromptConsentForm,
PropsUIPromptRadioInput,
PropsUIPromptQuestionnaire
} from './prompts'
export type PropsUIPage =
PropsUIPageDonation |
PropsUIPageEnd |
PropsUIPageError
export function isPropsUIPage (arg: any): arg is PropsUIPage {
return (
isPropsUIPageDonation(arg) ||
isPropsUIPageEnd(arg) ||
isPropsUIPageError(arg)
)
}
export interface PropsUIPageDonation {
__type__: 'PropsUIPageDonation'
platform: string
header: PropsUIHeader
body: PropsUIPromptFileInput | PropsUIPromptConfirm | PropsUIPromptConsentForm | PropsUIPromptRadioInput | PropsUIPromptQuestionnaire
footer?: PropsUIFooter
}
export function isPropsUIPageDonation (arg: any): arg is PropsUIPageDonation {
return isInstanceOf<PropsUIPageDonation>(arg, 'PropsUIPageDonation', ['platform', 'header', 'body'])
}
export interface PropsUIPageEnd {
__type__: 'PropsUIPageEnd'
}
export function isPropsUIPageEnd (arg: any): arg is PropsUIPageEnd {
return isInstanceOf<PropsUIPageEnd>(arg, 'PropsUIPageEnd', [])
}
export interface PropsUIPageError {
__type__: 'PropsUIPageError'
stacktrace: string
}
export function isPropsUIPageError (arg: any): arg is PropsUIPageError {
return isInstanceOf<PropsUIPageError>(arg, 'PropsUIPageError', ['stacktrace'])
}