-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypes.fs
More file actions
179 lines (155 loc) · 4.08 KB
/
Copy pathTypes.fs
File metadata and controls
179 lines (155 loc) · 4.08 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
namespace PasswordManager
(*
TODO: Pages
- Passwords
- Create Password
*)
module Types =
open System
open Avalonia
open Avalonia.FuncUI.Hosts
open Avalonia.Controls
open Avalonia.FuncUI
// PALETTE
let color_base_100 = "#edf7fd"
let color_base_200 = "#acdff2fe"
let color_base_300 = "#b8e6fe"
let color_base_text = "#014a70"
let color_primary = "#009689"
let color_primary_content = "#effcf9"
let color_secondary = "#f34700"
let color_secondary_content = "#fff7ed"
let color_accent = "#7f21fe"
let color_accent_content = "#f2f0fc"
let color_neutral = "#0069a8"
let color_neutral_content = "#edf7fd"
let color_info = "#00b6d9"
let color_info_content = "#ebfdfe"
let color_success = "#00ba7b"
let color_success_content = "#e9faf2"
let color_warning = "#ff6700"
let color_warning_content = "#fff7ed"
let color_error = "#f82834" (** Trocar a cor *)
let color_error_error = "#fcf2f8"
// ======================================================
// UI/Layout/Actions
// ======================================================
type FORM_KEY_PARAM = {
lst_id : string
item_id: string option
}
type Pages =
| HOME
| VAULT_HOME of string
| NEW_KEY of FORM_KEY_PARAM
| TRASH
| INFO // ????????????????????????
type NavPage = {
current_page: Types.IView<Component>
loaded_data: string
first_run:bool
notification: Option<Types.IView<Component>>
modal:Option<Types.IView<Component>>
}
[<StructuralEquality; StructuralComparison>]
[<CompiledName("FSharpResult`2")>]
[<Struct>]
type Result<'T,'TError> =
| Ok of ResultValue:'T
| Error of ErrorValue:'TError
type Message =
| CHANGE_PAGE
| UPDATE_SIDEBAR
| COPY_USERNAME
| COPY_PASSWORD
| COPY_URL
type NotificationTypes =
| SUCCESS
| ERROR
| INFO
type Notification_State_Type = {
id: string
mutable progress: int
is_up: bool
title: string
description: string
kind: NotificationTypes
}
type Notifications_queue = {
queue: Notification_State_Type list
is_running: bool
}
type Password = {
id:string
name:string
username:string
url:string
password:string
created_at: DateTime
updated_at: DateTime
}
// ======================================================
// Database Types
// ======================================================
type ThrashPassword = {
id:string
name:string
username:string
url:string
password:string
created_at: DateTime
updated_at: DateTime
lst_id:string
}
type Password_lst = {
id:string
passwords: List<Password>
name: string
}
type Database = {
lsts:List<Password_lst>
trash:List<ThrashPassword>
}
type Database_State = {
database: Database
filepath:string
password: string
}
type Database_State_Actions =
| UPDATE
| CLOSE
| SAVE
| NEW_PASSWORD
| NEW_LIST
type Password_Row_Data = {
id:string
name:string
url:string
username:string
updated_at:string
created_at:string
}
type Password_Form = {
size:int
show:bool
upper_case:bool
lower_case:bool
numbers:bool
slashes:bool
math_symbols:bool
logograms:bool
}
type DB_CALLBACK = Database -> unit
type MODALS =
| CREATE_LIST of DB_CALLBACK
| EDIT_LIST of string
| CLOSE_MODAL of bool
type layout_actions = {
n_success: string -> string -> unit
n_info: string ->string -> unit
n_error: string -> string -> unit
nav: Pages ->unit
update_database: Database_State_Actions-> Database_State -> unit
get_db: unit -> Database_State
modal_fire: MODALS -> unit
}