@attrx/role-morphic 0.1.0 → 0.2.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.
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Area Role - Constants
3
+ *
4
+ * Fatores de conversão, símbolos e aliases para unidades de área.
5
+ *
6
+ * Fontes:
7
+ * - NIST SP 811 (2008)
8
+ * - International Yard and Pound Agreement (1959)
9
+ * - SI Brochure, 9th Edition (2019)
10
+ */
11
+
12
+ type AreaUnit = "square_kilometer" | "hectare" | "are" | "square_meter" | "square_decimeter" | "square_centimeter" | "square_millimeter" | "square_mile" | "acre" | "square_yard" | "square_foot" | "square_inch";
13
+
14
+ /**
15
+ * Length Role - Constants
16
+ *
17
+ * Fatores de conversão, símbolos e aliases para unidades de comprimento.
18
+ *
19
+ * Fontes:
20
+ * - NIST SP 811 (2008)
21
+ * - International Yard and Pound Agreement (1959)
22
+ * - SI Brochure, 9th Edition (2019)
23
+ */
24
+
25
+ type LengthUnit = "kilometer" | "hectometer" | "decameter" | "meter" | "decimeter" | "centimeter" | "millimeter" | "micrometer" | "nanometer" | "inch" | "foot" | "yard" | "mile" | "nautical_mile" | "fathom" | "furlong" | "league";
26
+
27
+ /**
28
+ * Mass Role - Constants
29
+ *
30
+ * Fatores de conversão, símbolos e aliases para unidades de massa.
31
+ *
32
+ * Fontes:
33
+ * - NIST SP 811 (2008)
34
+ * - International Yard and Pound Agreement (1959)
35
+ * - SI Brochure, 9th Edition (2019)
36
+ *
37
+ * Nota: Massa ≠ Peso
38
+ * - Massa: quantidade de matéria (invariante)
39
+ * - Peso: força gravitacional (varia com localização)
40
+ */
41
+
42
+ type MassUnit = "metric_ton" | "kilogram" | "hectogram" | "decagram" | "gram" | "decigram" | "centigram" | "milligram" | "microgram" | "long_ton" | "short_ton" | "stone" | "pound" | "ounce" | "dram" | "grain" | "troy_pound" | "troy_ounce" | "pennyweight";
43
+
44
+ /**
45
+ * Volume Role - Constants
46
+ *
47
+ * Fatores de conversão, símbolos e aliases para unidades de volume.
48
+ *
49
+ * Fontes:
50
+ * - NIST SP 811 (2008)
51
+ * - NIST Handbook 44 (2024)
52
+ * - SI Brochure, 9th Edition (2019)
53
+ *
54
+ * Notas:
55
+ * - Base: liter (L) - unidade aceita para uso com o SI
56
+ * - 1 L = 1 dm³ = 0.001 m³
57
+ * - Galão US vs UK: ~20% diferença (UK é maior)
58
+ */
59
+
60
+ type VolumeUnit = "cubic_meter" | "cubic_decimeter" | "cubic_centimeter" | "cubic_millimeter" | "hectoliter" | "decaliter" | "liter" | "deciliter" | "centiliter" | "milliliter" | "microliter" | "gallon_us" | "quart_us" | "pint_us" | "cup_us" | "fluid_ounce_us" | "tablespoon_us" | "teaspoon_us" | "gallon_uk" | "quart_uk" | "pint_uk" | "fluid_ounce_uk" | "barrel_oil" | "cubic_inch" | "cubic_foot" | "cubic_yard";
61
+
62
+ /**
63
+ * Speed Role - Constants
64
+ *
65
+ * Fatores de conversão, símbolos e aliases para unidades de velocidade.
66
+ *
67
+ * Fontes:
68
+ * - NIST SP 811 (2008)
69
+ * - SI Brochure, 9th Edition (2019)
70
+ * - International Yard and Pound Agreement (1959)
71
+ */
72
+
73
+ type SpeedUnit = "meter_per_second" | "kilometer_per_hour" | "mile_per_hour" | "foot_per_second" | "knot" | "mach" | "speed_of_light";
74
+
75
+ /**
76
+ * Energy Role - Constants
77
+ *
78
+ * Fatores de conversão, símbolos e aliases para unidades de energia.
79
+ *
80
+ * Fontes:
81
+ * - NIST SP 811 (2008)
82
+ * - SI Brochure, 9th Edition (2019)
83
+ * - CODATA 2018 (electronvolt)
84
+ */
85
+
86
+ type EnergyUnit = "gigajoule" | "megajoule" | "kilojoule" | "joule" | "millijoule" | "calorie" | "kilocalorie" | "watt_hour" | "kilowatt_hour" | "megawatt_hour" | "gigawatt_hour" | "btu" | "therm" | "electronvolt" | "kiloelectronvolt" | "megaelectronvolt" | "erg" | "foot_pound";
87
+
88
+ /**
89
+ * Power Role - Constants
90
+ *
91
+ * Fatores de conversão, símbolos e aliases para unidades de potência.
92
+ *
93
+ * Fontes:
94
+ * - NIST SP 811 (2008)
95
+ * - SI Brochure, 9th Edition (2019)
96
+ */
97
+
98
+ type PowerUnit = "gigawatt" | "megawatt" | "kilowatt" | "watt" | "milliwatt" | "microwatt" | "horsepower_mechanical" | "horsepower_metric" | "horsepower_electric" | "horsepower_boiler" | "btu_per_hour" | "btu_per_second" | "ton_of_refrigeration" | "foot_pound_per_second" | "calorie_per_second" | "kilocalorie_per_hour";
99
+
100
+ /**
101
+ * Pressure Role - Constants
102
+ *
103
+ * Fatores de conversão, símbolos e aliases para unidades de pressão.
104
+ *
105
+ * Fontes:
106
+ * - SI Brochure, 9th Edition (2019)
107
+ * - NIST SP 811
108
+ * - 10th CGPM (1954) - definição da atmosfera padrão
109
+ */
110
+
111
+ type PressureUnit = "megapascal" | "kilopascal" | "hectopascal" | "pascal" | "bar" | "millibar" | "atmosphere" | "torr" | "mmhg" | "inhg" | "psi" | "ksi" | "cmh2o" | "inh2o";
112
+
113
+ /**
114
+ * Frequency Role - Constants
115
+ *
116
+ * Fatores de conversão, símbolos e aliases para unidades de frequência.
117
+ *
118
+ * Fontes:
119
+ * - SI Brochure, 9th Edition (2019)
120
+ * - NIST SP 811
121
+ */
122
+
123
+ type FrequencyUnit = "terahertz" | "gigahertz" | "megahertz" | "kilohertz" | "hertz" | "millihertz" | "microhertz" | "rpm" | "bpm" | "radians_per_second" | "cycles_per_minute";
124
+
125
+ /**
126
+ * Angle Role - Constants
127
+ *
128
+ * Fatores de conversão, símbolos e aliases para unidades de ângulo.
129
+ *
130
+ * Base: degree (grau) - mais comum em aplicações práticas.
131
+ * Nota: Embora radiano seja a unidade SI, grau é mais intuitivo para a maioria dos casos.
132
+ *
133
+ * Fontes:
134
+ * - SI Brochure, 9th Edition (2019)
135
+ * - NIST SP 811 (2008)
136
+ */
137
+
138
+ type AngleUnit = "turn" | "degree" | "arcminute" | "arcsecond" | "milliarcsecond" | "radian" | "milliradian" | "gradian";
139
+
140
+ /**
141
+ * Time Role - Constants
142
+ *
143
+ * Fatores de conversão, símbolos e aliases para unidades de tempo/duração.
144
+ *
145
+ * Fontes:
146
+ * - SI Brochure, 9th Edition (2019)
147
+ * - Gregorian calendar (365.2425 dias/ano)
148
+ */
149
+
150
+ type TimeUnit = "nanosecond" | "microsecond" | "millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "year" | "decade" | "century" | "millennium";
151
+
152
+ /**
153
+ * Digital Storage Role - Constants
154
+ *
155
+ * Fatores de conversão, símbolos e aliases para unidades de armazenamento digital.
156
+ *
157
+ * Fontes:
158
+ * - IEC 60027-2 (prefixos binários)
159
+ * - SI Brochure, 9th Edition (2019)
160
+ *
161
+ * IMPORTANTE: Esta biblioteca suporta AMBOS os sistemas:
162
+ * - SI (decimal): kB, MB, GB, TB (base 1000)
163
+ * - IEC (binário): KiB, MiB, GiB, TiB (base 1024)
164
+ */
165
+
166
+ type DigitalUnit = "bit" | "byte" | "kibibyte" | "mebibyte" | "gibibyte" | "tebibyte" | "pebibyte" | "exbibyte" | "kilobyte" | "megabyte" | "gigabyte" | "terabyte" | "petabyte" | "exabyte";
167
+
168
+ export type { AreaUnit as A, DigitalUnit as D, EnergyUnit as E, FrequencyUnit as F, LengthUnit as L, MassUnit as M, PowerUnit as P, SpeedUnit as S, TimeUnit as T, VolumeUnit as V, AngleUnit as a, PressureUnit as b };
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Area Role - Constants
3
+ *
4
+ * Fatores de conversão, símbolos e aliases para unidades de área.
5
+ *
6
+ * Fontes:
7
+ * - NIST SP 811 (2008)
8
+ * - International Yard and Pound Agreement (1959)
9
+ * - SI Brochure, 9th Edition (2019)
10
+ */
11
+
12
+ type AreaUnit = "square_kilometer" | "hectare" | "are" | "square_meter" | "square_decimeter" | "square_centimeter" | "square_millimeter" | "square_mile" | "acre" | "square_yard" | "square_foot" | "square_inch";
13
+
14
+ /**
15
+ * Length Role - Constants
16
+ *
17
+ * Fatores de conversão, símbolos e aliases para unidades de comprimento.
18
+ *
19
+ * Fontes:
20
+ * - NIST SP 811 (2008)
21
+ * - International Yard and Pound Agreement (1959)
22
+ * - SI Brochure, 9th Edition (2019)
23
+ */
24
+
25
+ type LengthUnit = "kilometer" | "hectometer" | "decameter" | "meter" | "decimeter" | "centimeter" | "millimeter" | "micrometer" | "nanometer" | "inch" | "foot" | "yard" | "mile" | "nautical_mile" | "fathom" | "furlong" | "league";
26
+
27
+ /**
28
+ * Mass Role - Constants
29
+ *
30
+ * Fatores de conversão, símbolos e aliases para unidades de massa.
31
+ *
32
+ * Fontes:
33
+ * - NIST SP 811 (2008)
34
+ * - International Yard and Pound Agreement (1959)
35
+ * - SI Brochure, 9th Edition (2019)
36
+ *
37
+ * Nota: Massa ≠ Peso
38
+ * - Massa: quantidade de matéria (invariante)
39
+ * - Peso: força gravitacional (varia com localização)
40
+ */
41
+
42
+ type MassUnit = "metric_ton" | "kilogram" | "hectogram" | "decagram" | "gram" | "decigram" | "centigram" | "milligram" | "microgram" | "long_ton" | "short_ton" | "stone" | "pound" | "ounce" | "dram" | "grain" | "troy_pound" | "troy_ounce" | "pennyweight";
43
+
44
+ /**
45
+ * Volume Role - Constants
46
+ *
47
+ * Fatores de conversão, símbolos e aliases para unidades de volume.
48
+ *
49
+ * Fontes:
50
+ * - NIST SP 811 (2008)
51
+ * - NIST Handbook 44 (2024)
52
+ * - SI Brochure, 9th Edition (2019)
53
+ *
54
+ * Notas:
55
+ * - Base: liter (L) - unidade aceita para uso com o SI
56
+ * - 1 L = 1 dm³ = 0.001 m³
57
+ * - Galão US vs UK: ~20% diferença (UK é maior)
58
+ */
59
+
60
+ type VolumeUnit = "cubic_meter" | "cubic_decimeter" | "cubic_centimeter" | "cubic_millimeter" | "hectoliter" | "decaliter" | "liter" | "deciliter" | "centiliter" | "milliliter" | "microliter" | "gallon_us" | "quart_us" | "pint_us" | "cup_us" | "fluid_ounce_us" | "tablespoon_us" | "teaspoon_us" | "gallon_uk" | "quart_uk" | "pint_uk" | "fluid_ounce_uk" | "barrel_oil" | "cubic_inch" | "cubic_foot" | "cubic_yard";
61
+
62
+ /**
63
+ * Speed Role - Constants
64
+ *
65
+ * Fatores de conversão, símbolos e aliases para unidades de velocidade.
66
+ *
67
+ * Fontes:
68
+ * - NIST SP 811 (2008)
69
+ * - SI Brochure, 9th Edition (2019)
70
+ * - International Yard and Pound Agreement (1959)
71
+ */
72
+
73
+ type SpeedUnit = "meter_per_second" | "kilometer_per_hour" | "mile_per_hour" | "foot_per_second" | "knot" | "mach" | "speed_of_light";
74
+
75
+ /**
76
+ * Energy Role - Constants
77
+ *
78
+ * Fatores de conversão, símbolos e aliases para unidades de energia.
79
+ *
80
+ * Fontes:
81
+ * - NIST SP 811 (2008)
82
+ * - SI Brochure, 9th Edition (2019)
83
+ * - CODATA 2018 (electronvolt)
84
+ */
85
+
86
+ type EnergyUnit = "gigajoule" | "megajoule" | "kilojoule" | "joule" | "millijoule" | "calorie" | "kilocalorie" | "watt_hour" | "kilowatt_hour" | "megawatt_hour" | "gigawatt_hour" | "btu" | "therm" | "electronvolt" | "kiloelectronvolt" | "megaelectronvolt" | "erg" | "foot_pound";
87
+
88
+ /**
89
+ * Power Role - Constants
90
+ *
91
+ * Fatores de conversão, símbolos e aliases para unidades de potência.
92
+ *
93
+ * Fontes:
94
+ * - NIST SP 811 (2008)
95
+ * - SI Brochure, 9th Edition (2019)
96
+ */
97
+
98
+ type PowerUnit = "gigawatt" | "megawatt" | "kilowatt" | "watt" | "milliwatt" | "microwatt" | "horsepower_mechanical" | "horsepower_metric" | "horsepower_electric" | "horsepower_boiler" | "btu_per_hour" | "btu_per_second" | "ton_of_refrigeration" | "foot_pound_per_second" | "calorie_per_second" | "kilocalorie_per_hour";
99
+
100
+ /**
101
+ * Pressure Role - Constants
102
+ *
103
+ * Fatores de conversão, símbolos e aliases para unidades de pressão.
104
+ *
105
+ * Fontes:
106
+ * - SI Brochure, 9th Edition (2019)
107
+ * - NIST SP 811
108
+ * - 10th CGPM (1954) - definição da atmosfera padrão
109
+ */
110
+
111
+ type PressureUnit = "megapascal" | "kilopascal" | "hectopascal" | "pascal" | "bar" | "millibar" | "atmosphere" | "torr" | "mmhg" | "inhg" | "psi" | "ksi" | "cmh2o" | "inh2o";
112
+
113
+ /**
114
+ * Frequency Role - Constants
115
+ *
116
+ * Fatores de conversão, símbolos e aliases para unidades de frequência.
117
+ *
118
+ * Fontes:
119
+ * - SI Brochure, 9th Edition (2019)
120
+ * - NIST SP 811
121
+ */
122
+
123
+ type FrequencyUnit = "terahertz" | "gigahertz" | "megahertz" | "kilohertz" | "hertz" | "millihertz" | "microhertz" | "rpm" | "bpm" | "radians_per_second" | "cycles_per_minute";
124
+
125
+ /**
126
+ * Angle Role - Constants
127
+ *
128
+ * Fatores de conversão, símbolos e aliases para unidades de ângulo.
129
+ *
130
+ * Base: degree (grau) - mais comum em aplicações práticas.
131
+ * Nota: Embora radiano seja a unidade SI, grau é mais intuitivo para a maioria dos casos.
132
+ *
133
+ * Fontes:
134
+ * - SI Brochure, 9th Edition (2019)
135
+ * - NIST SP 811 (2008)
136
+ */
137
+
138
+ type AngleUnit = "turn" | "degree" | "arcminute" | "arcsecond" | "milliarcsecond" | "radian" | "milliradian" | "gradian";
139
+
140
+ /**
141
+ * Time Role - Constants
142
+ *
143
+ * Fatores de conversão, símbolos e aliases para unidades de tempo/duração.
144
+ *
145
+ * Fontes:
146
+ * - SI Brochure, 9th Edition (2019)
147
+ * - Gregorian calendar (365.2425 dias/ano)
148
+ */
149
+
150
+ type TimeUnit = "nanosecond" | "microsecond" | "millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "year" | "decade" | "century" | "millennium";
151
+
152
+ /**
153
+ * Digital Storage Role - Constants
154
+ *
155
+ * Fatores de conversão, símbolos e aliases para unidades de armazenamento digital.
156
+ *
157
+ * Fontes:
158
+ * - IEC 60027-2 (prefixos binários)
159
+ * - SI Brochure, 9th Edition (2019)
160
+ *
161
+ * IMPORTANTE: Esta biblioteca suporta AMBOS os sistemas:
162
+ * - SI (decimal): kB, MB, GB, TB (base 1000)
163
+ * - IEC (binário): KiB, MiB, GiB, TiB (base 1024)
164
+ */
165
+
166
+ type DigitalUnit = "bit" | "byte" | "kibibyte" | "mebibyte" | "gibibyte" | "tebibyte" | "pebibyte" | "exbibyte" | "kilobyte" | "megabyte" | "gigabyte" | "terabyte" | "petabyte" | "exabyte";
167
+
168
+ export type { AreaUnit as A, DigitalUnit as D, EnergyUnit as E, FrequencyUnit as F, LengthUnit as L, MassUnit as M, PowerUnit as P, SpeedUnit as S, TimeUnit as T, VolumeUnit as V, AngleUnit as a, PressureUnit as b };