eclair 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d0d70223543904e4ac86fd5f2d87e596d9f6530a461451e194fd8e225a4d0fd6
4
+ data.tar.gz: 9edb60270b4b79f4a620af39cacad513f022aebd2279dec1d95df3ac25f2a240
5
+ SHA512:
6
+ metadata.gz: 1dcbf3e3a03407f07ba09a0aa3f0775c64356bd70ad713d47cc465ee58f8370a857ed0d11a01f9be9ef1f07231391d47dd165ddd51c6b8c309d6006f46240c6c
7
+ data.tar.gz: ba534c667f67d8cfaa81e24059f34ab8012dd771f7d31efab685174ba4aeddcc604435d298c88b2ca2fc70646000551fb8eb8244f21e59cf37b3a395a747b28b
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+ require "sorbet-runtime"
3
+
4
+ module Eclair
5
+ class Element
6
+ extend T::Sig
7
+ extend T::Helpers
8
+ final!
9
+
10
+ class DangerousUnescapedHtml
11
+ extend T::Sig
12
+ extend T::Helpers
13
+ final!
14
+
15
+ sig(:final) { returns(String) }
16
+ attr_reader :html
17
+
18
+ sig(:final) do
19
+ params(html: String).void
20
+ end
21
+ def initialize(html:)
22
+ @html = html
23
+ end
24
+ end
25
+
26
+ module Void
27
+ extend T::Helpers
28
+ final!
29
+ end
30
+
31
+ AttributeValue = T.type_alias { T.any(T::Boolean, String) }
32
+ Attributes = T.type_alias { T::Hash[Symbol, AttributeValue] }
33
+ ElementChild = T.type_alias { T.any(Element, String, DangerousUnescapedHtml) }
34
+ Children = T.type_alias { T.any(T.class_of(Void), T::Array[ElementChild]) }
35
+
36
+ sig(:final) { returns(Symbol) }
37
+ attr_reader :tag
38
+
39
+ sig(:final) { returns(Attributes) }
40
+ attr_reader :attributes
41
+
42
+ sig(:final) { returns(Children) }
43
+ attr_reader :children
44
+
45
+ sig(:final) do
46
+ params(tag: Symbol, attributes: Attributes, children: Children).void
47
+ end
48
+ def initialize(tag:, attributes:, children:)
49
+ @tag = tag
50
+ @attributes = attributes
51
+ @children = children
52
+ end
53
+ end
54
+ end