0 | module Web.Internal.CssomviewTypes
  1 |
  2 | import JS
  3 |
  4 | %default total
  5 |
  6 |
  7 | --------------------------------------------------------------------------------
  8 | --          Enums
  9 | --------------------------------------------------------------------------------
 10 |
 11 | namespace ScrollBehavior
 12 |
 13 |   public export
 14 |   data ScrollBehavior = Auto | Instant | Smooth
 15 |
 16 |   public export
 17 |   Show ScrollBehavior where
 18 |     show Auto = "auto"
 19 |     show Instant = "instant"
 20 |     show Smooth = "smooth"
 21 |
 22 |   public export
 23 |   Eq ScrollBehavior where
 24 |     (==) = (==) `on` show
 25 |
 26 |   public export
 27 |   Ord ScrollBehavior where
 28 |     compare = compare `on` show
 29 |
 30 |   public export
 31 |   read : String -> Maybe ScrollBehavior
 32 |   read "auto" = Just Auto
 33 |   read "instant" = Just Instant
 34 |   read "smooth" = Just Smooth
 35 |   read _ = Nothing
 36 |
 37 |   export
 38 |   ToFFI ScrollBehavior String where
 39 |     toFFI = show
 40 |
 41 |   export
 42 |   FromFFI ScrollBehavior String where
 43 |     fromFFI = read
 44 |
 45 |
 46 | namespace ScrollLogicalPosition
 47 |
 48 |   public export
 49 |   data ScrollLogicalPosition = Start | Center | End | Nearest
 50 |
 51 |   public export
 52 |   Show ScrollLogicalPosition where
 53 |     show Start = "start"
 54 |     show Center = "center"
 55 |     show End = "end"
 56 |     show Nearest = "nearest"
 57 |
 58 |   public export
 59 |   Eq ScrollLogicalPosition where
 60 |     (==) = (==) `on` show
 61 |
 62 |   public export
 63 |   Ord ScrollLogicalPosition where
 64 |     compare = compare `on` show
 65 |
 66 |   public export
 67 |   read : String -> Maybe ScrollLogicalPosition
 68 |   read "start" = Just Start
 69 |   read "center" = Just Center
 70 |   read "end" = Just End
 71 |   read "nearest" = Just Nearest
 72 |   read _ = Nothing
 73 |
 74 |   export
 75 |   ToFFI ScrollLogicalPosition String where
 76 |     toFFI = show
 77 |
 78 |   export
 79 |   FromFFI ScrollLogicalPosition String where
 80 |     fromFFI = read
 81 |
 82 |
 83 | namespace CSSBoxType
 84 |
 85 |   public export
 86 |   data CSSBoxType = Margin | Border | Padding | Content
 87 |
 88 |   public export
 89 |   Show CSSBoxType where
 90 |     show Margin = "margin"
 91 |     show Border = "border"
 92 |     show Padding = "padding"
 93 |     show Content = "content"
 94 |
 95 |   public export
 96 |   Eq CSSBoxType where
 97 |     (==) = (==) `on` show
 98 |
 99 |   public export
100 |   Ord CSSBoxType where
101 |     compare = compare `on` show
102 |
103 |   public export
104 |   read : String -> Maybe CSSBoxType
105 |   read "margin" = Just Margin
106 |   read "border" = Just Border
107 |   read "padding" = Just Padding
108 |   read "content" = Just Content
109 |   read _ = Nothing
110 |
111 |   export
112 |   ToFFI CSSBoxType String where
113 |     toFFI = show
114 |
115 |   export
116 |   FromFFI CSSBoxType String where
117 |     fromFFI = read
118 |
119 |
120 |
121 | --------------------------------------------------------------------------------
122 | --          Interfaces
123 | --------------------------------------------------------------------------------
124 |
125 | export data CaretPosition : Type where [external]
126 |
127 | export
128 | ToFFI CaretPosition CaretPosition where toFFI = id
129 |
130 | export
131 | FromFFI CaretPosition CaretPosition where fromFFI = Just
132 |
133 | export
134 | SafeCast CaretPosition where
135 |   safeCast = unsafeCastOnPrototypeName "CaretPosition"
136 |
137 | export data MediaQueryList : Type where [external]
138 |
139 | export
140 | ToFFI MediaQueryList MediaQueryList where toFFI = id
141 |
142 | export
143 | FromFFI MediaQueryList MediaQueryList where fromFFI = Just
144 |
145 | export
146 | SafeCast MediaQueryList where
147 |   safeCast = unsafeCastOnPrototypeName "MediaQueryList"
148 |
149 | export data MediaQueryListEvent : Type where [external]
150 |
151 | export
152 | ToFFI MediaQueryListEvent MediaQueryListEvent where toFFI = id
153 |
154 | export
155 | FromFFI MediaQueryListEvent MediaQueryListEvent where fromFFI = Just
156 |
157 | export
158 | SafeCast MediaQueryListEvent where
159 |   safeCast = unsafeCastOnPrototypeName "MediaQueryListEvent"
160 |
161 | export data Screen : Type where [external]
162 |
163 | export
164 | ToFFI Screen Screen where toFFI = id
165 |
166 | export
167 | FromFFI Screen Screen where fromFFI = Just
168 |
169 | export
170 | SafeCast Screen where
171 |   safeCast = unsafeCastOnPrototypeName "Screen"
172 |
173 | export data VisualViewport : Type where [external]
174 |
175 | export
176 | ToFFI VisualViewport VisualViewport where toFFI = id
177 |
178 | export
179 | FromFFI VisualViewport VisualViewport where fromFFI = Just
180 |
181 | export
182 | SafeCast VisualViewport where
183 |   safeCast = unsafeCastOnPrototypeName "VisualViewport"
184 |
185 |
186 | --------------------------------------------------------------------------------
187 | --          Dictionaries
188 | --------------------------------------------------------------------------------
189 |
190 | export data BoxQuadOptions : Type where [external]
191 |
192 | export
193 | ToFFI BoxQuadOptions BoxQuadOptions where toFFI = id
194 |
195 | export
196 | FromFFI BoxQuadOptions BoxQuadOptions where fromFFI = Just
197 |
198 | export data CheckVisibilityOptions : Type where [external]
199 |
200 | export
201 | ToFFI CheckVisibilityOptions CheckVisibilityOptions where toFFI = id
202 |
203 | export
204 | FromFFI CheckVisibilityOptions CheckVisibilityOptions where fromFFI = Just
205 |
206 | export data ConvertCoordinateOptions : Type where [external]
207 |
208 | export
209 | ToFFI ConvertCoordinateOptions ConvertCoordinateOptions where toFFI = id
210 |
211 | export
212 | FromFFI ConvertCoordinateOptions ConvertCoordinateOptions where fromFFI = Just
213 |
214 | export data MediaQueryListEventInit : Type where [external]
215 |
216 | export
217 | ToFFI MediaQueryListEventInit MediaQueryListEventInit where toFFI = id
218 |
219 | export
220 | FromFFI MediaQueryListEventInit MediaQueryListEventInit where fromFFI = Just
221 |
222 | export data ScrollIntoViewOptions : Type where [external]
223 |
224 | export
225 | ToFFI ScrollIntoViewOptions ScrollIntoViewOptions where toFFI = id
226 |
227 | export
228 | FromFFI ScrollIntoViewOptions ScrollIntoViewOptions where fromFFI = Just
229 |
230 | export data ScrollOptions : Type where [external]
231 |
232 | export
233 | ToFFI ScrollOptions ScrollOptions where toFFI = id
234 |
235 | export
236 | FromFFI ScrollOptions ScrollOptions where fromFFI = Just
237 |
238 | export data ScrollToOptions : Type where [external]
239 |
240 | export
241 | ToFFI ScrollToOptions ScrollToOptions where toFFI = id
242 |
243 | export
244 | FromFFI ScrollToOptions ScrollToOptions where fromFFI = Just
245 |
246 |
247 | --------------------------------------------------------------------------------
248 | --          Mixins
249 | --------------------------------------------------------------------------------
250 |
251 | export data GeometryUtils : Type where [external]
252 |
253 | export
254 | ToFFI GeometryUtils GeometryUtils where toFFI = id
255 |
256 | export
257 | FromFFI GeometryUtils GeometryUtils where fromFFI = Just
258 |