-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.ts
128 lines (107 loc) · 2.48 KB
/
types.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { ReactNode} from "react";
export enum StepType {
BASIC = "BASIC",
CONNECT_AND_VERIFY = "CONNET_AND_VERIFY"
}
export enum RequestType {
BASIC = "BASIC",
OOB = "OOB"
}
export interface Attribute {
name: string;
value: string;
type?: string;
}
export interface Credential {
issuer_name: string;
name: string;
version: string;
icon: string;
attributes: Attribute[];
}
export interface Credentials {
[key: string]: Credential;
}
interface RevocationInfo {
credentialName: string;
credentialIcon: string;
title: string;
description: string;
}
interface ProgressBarItem {
name: string;
onboardingStep: string;
iconLight: string;
iconDark: string;
}
export interface OnboardingStep {
screenId: string;
title: string;
text: string;
image?: string;
credentials?: string[];
}
export interface ProofRequestAttributes {
attributes: string[];
restrictions?: string[];
}
export interface ProofRequestPredicates {
name: string;
type: string;
value: number;
restrictions: string[];
}
export interface ProofRequest {
attributes: {
[key: string]: ProofRequestAttributes;
};
predicates: {
[key: string]: ProofRequestPredicates;
};
}
export interface RequestOptions {
type: RequestType;
title: string;
text: string;
proofRequest: ProofRequest;
}
export interface ScenarioStep {
screenId: string;
type: StepType.BASIC | StepType.CONNECT_AND_VERIFY;
title: string;
text: string;
requestOptions: RequestOptions;
}
export interface ScenarioOverview {
title: string;
text: string;
image: string;
}
export interface Scenario {
id: string;
name: string;
status?: 'draft' | 'published' | 'archived';
overview: ScenarioOverview;
summary: ScenarioOverview;
steps: ScenarioStep[];
}
export interface Persona {
name: string;
type: string;
headshot_image: string;
body_image: string;
description: string;
credentials: Credentials;
revocationInfo: RevocationInfo[];
progressBar: ProgressBarItem[];
onboarding: OnboardingStep[];
scenarios: Scenario[];
}
export interface ShowcaseJSON {
personas: Persona[];
}
export type CredentialElement = [Exclude<keyof Credential, 'attributes'>] | ['attributes', keyof Attribute];
export type ScenarioStepState = "none-selected" | "adding-step" | "basic-step-edit" | "proof-step-edit" | "editing-scenario" | "editing-issue" | null;
export type ElementPath = string | [string, string];
export type Locale = "en" | "fr"
export type PageParams = Promise<{ locale: Locale }>