-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathconsts.go
259 lines (244 loc) · 7.41 KB
/
consts.go
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
package build
import (
"time"
"github.com/delaneyj/toolbelt"
)
type EnumValueDefinition struct {
Name toolbelt.CasedString
Description string
Value string
}
type EnumDefinition struct {
Name toolbelt.CasedString
Description string
Values []*EnumValueDefinition
DefaultIndex int
Default *EnumValueDefinition
}
type DefaultDuration struct {
Name toolbelt.CasedString
Description string
Duration time.Duration
}
type DefaultBool struct {
Name toolbelt.CasedString
Description string
Value bool
}
type DefaultString struct {
Name toolbelt.CasedString
Description string
Value string
}
type Language struct {
Handle string
Name string
Icon string
SdkUrl string
}
type ConstTemplateData struct {
DoNotEdit string
SDKLanguages []Language
Version string
VersionClientByteSize int
VersionClientByteSizeGzip int
DatastarKey string
DatalineLiterals []toolbelt.CasedString
DefaultBools []*DefaultBool
DefaultDurations []*DefaultDuration
DefaultStrings []*DefaultString
Enums []*EnumDefinition
}
var Consts = &ConstTemplateData{
DoNotEdit: "This is auto-generated by Datastar. DO NOT EDIT.",
SDKLanguages: []Language{
{
Handle: "clojure",
Name: "Clojure",
Icon: "vscode-icons:file-type-clojure",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/clojure",
},
{
Handle: "csharp",
Name: "C#",
Icon: "vscode-icons:file-type-csharp2",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/dotnet",
},
{
Handle: "go",
Name: "Go",
Icon: "vscode-icons:file-type-go-gopher",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/go",
},
{
Handle: "haskell",
Name: "Haskell",
Icon: "vscode-icons:file-type-haskell",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/haskell",
},
{
Handle: "java",
Name: "Java",
Icon: "vscode-icons:file-type-java",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/java",
},
{
Handle: "php",
Name: "PHP",
Icon: "vscode-icons:file-type-php",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/php",
},
{
Handle: "python",
Name: "Python",
Icon: "vscode-icons:file-type-python",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/python",
},
{
Handle: "rust",
Name: "Rust",
Icon: "vscode-icons:file-type-rust",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/rust",
},
{
Handle: "ruby",
Name: "Ruby",
Icon: "vscode-icons:file-type-ruby",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/ruby",
},
{
Handle: "typescript",
Name: "TypeScript",
Icon: "vscode-icons:file-type-typescript-official",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/typescript",
},
{
Handle: "zig",
Name: "Zig",
Icon: "vscode-icons:file-type-zig",
SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/zig",
},
},
DatastarKey: "datastar",
DefaultBools: []*DefaultBool{
{
Name: toolbelt.ToCasedString("fragmentsUseViewTransitions"),
Description: "Should fragments be merged using the ViewTransition API?",
Value: false,
},
{
Name: toolbelt.ToCasedString("mergeSignalsOnlyIfMissing"),
Description: "Should a given set of signals merge if they are missing?",
Value: false,
},
{
Name: toolbelt.ToCasedString("executeScriptAutoRemove"),
Description: "Should script element remove itself after execution?",
Value: true,
},
},
DefaultDurations: []*DefaultDuration{
{
Name: toolbelt.ToCasedString("sseRetryDuration"),
Description: "The default duration for retrying SSE on connection reset. This is part of the underlying retry mechanism of SSE.",
Duration: 1 * time.Second,
},
},
DefaultStrings: []*DefaultString{
{
Name: toolbelt.ToCasedString("executeScriptAttributes"),
Description: `The default attributes for <script/> element use when executing scripts. It is a set of key-value pairs delimited by a newline \\n character.`,
Value: "type module",
},
},
DatalineLiterals: []toolbelt.CasedString{
// Shared
toolbelt.ToCasedString("selector"),
// MergeFragments
toolbelt.ToCasedString("mergeMode"),
toolbelt.ToCasedString("fragments"),
toolbelt.ToCasedString("useViewTransition"),
// MergeSignals
toolbelt.ToCasedString("signals"),
toolbelt.ToCasedString("onlyIfMissing"),
// RemoveSignals
toolbelt.ToCasedString("paths"),
// ExecuteScript
toolbelt.ToCasedString("script"),
toolbelt.ToCasedString("attributes"),
toolbelt.ToCasedString("autoRemove"),
},
Enums: []*EnumDefinition{
{
Name: toolbelt.ToCasedString("FragmentMergeMode"),
Description: "The mode in which a fragment is merged into the DOM.",
DefaultIndex: 0,
Values: []*EnumValueDefinition{
{
Value: "morph",
Description: "Morphs the fragment into the existing element using idiomorph.",
},
{
Value: "inner",
Description: "Replaces the inner HTML of the existing element.",
},
{
Value: "outer",
Description: "Replaces the outer HTML of the existing element.",
},
{
Value: "prepend",
Description: "Prepends the fragment to the existing element.",
},
{
Value: "append",
Description: "Appends the fragment to the existing element.",
},
{
Value: "before",
Description: "Inserts the fragment before the existing element.",
},
{
Value: "after",
Description: "Inserts the fragment after the existing element.",
},
{
Value: "upsertAttributes",
Description: "Upserts the attributes of the existing element.",
},
},
},
{
Name: toolbelt.ToCasedString("EventType"),
Description: "The type protocol on top of SSE which allows for core pushed based communication between the server and the client.",
DefaultIndex: -1,
Values: []*EnumValueDefinition{
{
Name: toolbelt.ToCasedString("MergeFragments"),
Description: "An event for merging HTML fragments into the DOM.",
Value: "datastar-merge-fragments",
},
{
Name: toolbelt.ToCasedString("MergeSignals"),
Description: "An event for merging signals.",
Value: "datastar-merge-signals",
},
{
Name: toolbelt.ToCasedString("RemoveFragments"),
Description: "An event for removing HTML fragments from the DOM.",
Value: "datastar-remove-fragments",
},
{
Name: toolbelt.ToCasedString("RemoveSignals"),
Description: "An event for removing signals.",
Value: "datastar-remove-signals",
},
{
Name: toolbelt.ToCasedString("ExecuteScript"),
Description: "An event for executing <script/> elements in the browser.",
Value: "datastar-execute-script",
},
},
},
},
}