@react-native/codegen 0.74.0-nightly-20231204-e9b80971c → 0.74.0-nightly-20231206-eb661df2a

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.
Files changed (35) hide show
  1. package/lib/generators/components/GenerateComponentDescriptorH.js +2 -4
  2. package/lib/generators/components/GenerateComponentDescriptorH.js.flow +2 -4
  3. package/lib/generators/components/GenerateEventEmitterCpp.js +2 -4
  4. package/lib/generators/components/GenerateEventEmitterCpp.js.flow +2 -4
  5. package/lib/generators/components/GenerateEventEmitterH.js +2 -4
  6. package/lib/generators/components/GenerateEventEmitterH.js.flow +2 -4
  7. package/lib/generators/components/GeneratePropsCpp.js +2 -4
  8. package/lib/generators/components/GeneratePropsCpp.js.flow +2 -4
  9. package/lib/generators/components/GeneratePropsH.js +2 -4
  10. package/lib/generators/components/GeneratePropsH.js.flow +2 -4
  11. package/lib/generators/components/GenerateShadowNodeCpp.js +2 -4
  12. package/lib/generators/components/GenerateShadowNodeCpp.js.flow +2 -4
  13. package/lib/generators/components/GenerateShadowNodeH.js +2 -4
  14. package/lib/generators/components/GenerateShadowNodeH.js.flow +2 -4
  15. package/lib/generators/components/GenerateStateCpp.js +2 -4
  16. package/lib/generators/components/GenerateStateCpp.js.flow +2 -4
  17. package/lib/generators/components/GenerateStateH.js +2 -4
  18. package/lib/generators/components/GenerateStateH.js.flow +2 -4
  19. package/lib/generators/modules/GenerateModuleCpp.js +2 -4
  20. package/lib/generators/modules/GenerateModuleCpp.js.flow +2 -4
  21. package/lib/generators/modules/GenerateModuleH.js +2 -4
  22. package/lib/generators/modules/GenerateModuleH.js.flow +2 -4
  23. package/lib/generators/modules/GenerateModuleJniCpp.js +2 -4
  24. package/lib/generators/modules/GenerateModuleJniCpp.js.flow +2 -4
  25. package/lib/generators/modules/GenerateModuleJniH.js +2 -4
  26. package/lib/generators/modules/GenerateModuleJniH.js.flow +2 -4
  27. package/lib/generators/modules/GenerateModuleObjCpp/index.js +9 -11
  28. package/lib/generators/modules/GenerateModuleObjCpp/index.js.flow +9 -11
  29. package/lib/generators/modules/GenerateModuleObjCpp/source/serializeModule.js +25 -27
  30. package/lib/generators/modules/GenerateModuleObjCpp/source/serializeModule.js.flow +25 -27
  31. package/lib/generators/modules/__test_fixtures__/fixtures.js +685 -64
  32. package/lib/generators/modules/__test_fixtures__/fixtures.js.flow +686 -64
  33. package/lib/parsers/parsers-commons.js +1 -1
  34. package/lib/parsers/parsers-commons.js.flow +1 -1
  35. package/package.json +1 -1
@@ -1560,7 +1560,117 @@ const CXX_ONLY_NATIVE_MODULES = {
1560
1560
  NativeSampleTurboModule: {
1561
1561
  type: 'NativeModule',
1562
1562
  aliasMap: {
1563
- ObjectAlias: {
1563
+ ConstantsStruct: {
1564
+ type: 'ObjectTypeAnnotation',
1565
+ properties: [
1566
+ {
1567
+ name: 'const1',
1568
+ optional: false,
1569
+ typeAnnotation: {
1570
+ type: 'BooleanTypeAnnotation',
1571
+ },
1572
+ },
1573
+ {
1574
+ name: 'const2',
1575
+ optional: false,
1576
+ typeAnnotation: {
1577
+ type: 'NumberTypeAnnotation',
1578
+ },
1579
+ },
1580
+ {
1581
+ name: 'const3',
1582
+ optional: false,
1583
+ typeAnnotation: {
1584
+ type: 'StringTypeAnnotation',
1585
+ },
1586
+ },
1587
+ ],
1588
+ },
1589
+ CustomHostObject: {
1590
+ type: 'ObjectTypeAnnotation',
1591
+ properties: [],
1592
+ },
1593
+ BinaryTreeNode: {
1594
+ type: 'ObjectTypeAnnotation',
1595
+ properties: [
1596
+ {
1597
+ name: 'left',
1598
+ optional: true,
1599
+ typeAnnotation: {
1600
+ type: 'TypeAliasTypeAnnotation',
1601
+ name: 'BinaryTreeNode',
1602
+ },
1603
+ },
1604
+ {
1605
+ name: 'value',
1606
+ optional: false,
1607
+ typeAnnotation: {
1608
+ type: 'NumberTypeAnnotation',
1609
+ },
1610
+ },
1611
+ {
1612
+ name: 'right',
1613
+ optional: true,
1614
+ typeAnnotation: {
1615
+ type: 'TypeAliasTypeAnnotation',
1616
+ name: 'BinaryTreeNode',
1617
+ },
1618
+ },
1619
+ ],
1620
+ },
1621
+ GraphNode: {
1622
+ type: 'ObjectTypeAnnotation',
1623
+ properties: [
1624
+ {
1625
+ name: 'label',
1626
+ optional: false,
1627
+ typeAnnotation: {
1628
+ type: 'StringTypeAnnotation',
1629
+ },
1630
+ },
1631
+ {
1632
+ name: 'neighbors',
1633
+ optional: true,
1634
+ typeAnnotation: {
1635
+ type: 'ArrayTypeAnnotation',
1636
+ elementType: {
1637
+ type: 'TypeAliasTypeAnnotation',
1638
+ name: 'GraphNode',
1639
+ },
1640
+ },
1641
+ },
1642
+ ],
1643
+ },
1644
+ ObjectStruct: {
1645
+ type: 'ObjectTypeAnnotation',
1646
+ properties: [
1647
+ {
1648
+ name: 'a',
1649
+ optional: false,
1650
+ typeAnnotation: {
1651
+ type: 'NumberTypeAnnotation',
1652
+ },
1653
+ },
1654
+ {
1655
+ name: 'b',
1656
+ optional: false,
1657
+ typeAnnotation: {
1658
+ type: 'StringTypeAnnotation',
1659
+ },
1660
+ },
1661
+ {
1662
+ name: 'c',
1663
+ optional: true,
1664
+ typeAnnotation: {
1665
+ type: 'NullableTypeAnnotation',
1666
+ typeAnnotation: {
1667
+ type: 'StringTypeAnnotation',
1668
+ },
1669
+ },
1670
+ },
1671
+ ],
1672
+ },
1673
+ ValueStruct: {
1564
1674
  type: 'ObjectTypeAnnotation',
1565
1675
  properties: [
1566
1676
  {
@@ -1570,56 +1680,141 @@ const CXX_ONLY_NATIVE_MODULES = {
1570
1680
  type: 'NumberTypeAnnotation',
1571
1681
  },
1572
1682
  },
1683
+ {
1684
+ name: 'y',
1685
+ optional: false,
1686
+ typeAnnotation: {
1687
+ type: 'StringTypeAnnotation',
1688
+ },
1689
+ },
1690
+ {
1691
+ name: 'z',
1692
+ optional: false,
1693
+ typeAnnotation: {
1694
+ type: 'TypeAliasTypeAnnotation',
1695
+ name: 'ObjectStruct',
1696
+ },
1697
+ },
1698
+ ],
1699
+ },
1700
+ MenuItem: {
1701
+ type: 'ObjectTypeAnnotation',
1702
+ properties: [
1703
+ {
1704
+ name: 'label',
1705
+ optional: false,
1706
+ typeAnnotation: {
1707
+ type: 'StringTypeAnnotation',
1708
+ },
1709
+ },
1710
+ {
1711
+ name: 'onPress',
1712
+ optional: false,
1713
+ typeAnnotation: {
1714
+ type: 'FunctionTypeAnnotation',
1715
+ returnTypeAnnotation: {
1716
+ type: 'VoidTypeAnnotation',
1717
+ },
1718
+ params: [
1719
+ {
1720
+ name: 'value',
1721
+ optional: false,
1722
+ typeAnnotation: {
1723
+ type: 'StringTypeAnnotation',
1724
+ },
1725
+ },
1726
+ {
1727
+ name: 'flag',
1728
+ optional: false,
1729
+ typeAnnotation: {
1730
+ type: 'BooleanTypeAnnotation',
1731
+ },
1732
+ },
1733
+ ],
1734
+ },
1735
+ },
1736
+ {
1737
+ name: 'shortcut',
1738
+ optional: true,
1739
+ typeAnnotation: {
1740
+ type: 'NullableTypeAnnotation',
1741
+ typeAnnotation: {
1742
+ type: 'StringTypeAnnotation',
1743
+ },
1744
+ },
1745
+ },
1746
+ {
1747
+ name: 'items',
1748
+ optional: true,
1749
+ typeAnnotation: {
1750
+ type: 'ArrayTypeAnnotation',
1751
+ elementType: {
1752
+ type: 'TypeAliasTypeAnnotation',
1753
+ name: 'MenuItem',
1754
+ },
1755
+ },
1756
+ },
1573
1757
  ],
1574
1758
  },
1575
1759
  },
1576
1760
  enumMap: {
1577
- NumEnum: {
1761
+ EnumInt: {
1762
+ name: 'EnumInt',
1578
1763
  type: 'EnumDeclarationWithMembers',
1579
- name: 'NumEnum',
1580
1764
  memberType: 'NumberTypeAnnotation',
1581
1765
  members: [
1582
1766
  {
1583
- name: 'ONE',
1584
- value: '1',
1767
+ name: 'IA',
1768
+ value: '23',
1585
1769
  },
1586
1770
  {
1587
- name: 'TWO',
1588
- value: '2',
1771
+ name: 'IB',
1772
+ value: '42',
1589
1773
  },
1590
1774
  ],
1591
1775
  },
1592
- FloatEnum: {
1776
+ EnumFloat: {
1777
+ name: 'EnumFloat',
1593
1778
  type: 'EnumDeclarationWithMembers',
1594
- name: 'FloatEnum',
1595
1779
  memberType: 'NumberTypeAnnotation',
1596
1780
  members: [
1597
1781
  {
1598
- name: 'POINT_ZERO',
1599
- value: '0.0',
1782
+ name: 'FA',
1783
+ value: '1.23',
1600
1784
  },
1601
1785
  {
1602
- name: 'POINT_ONE',
1603
- value: '0.1',
1786
+ name: 'FB',
1787
+ value: '4.56',
1604
1788
  },
1789
+ ],
1790
+ },
1791
+ EnumNone: {
1792
+ name: 'EnumNone',
1793
+ type: 'EnumDeclarationWithMembers',
1794
+ memberType: 'StringTypeAnnotation',
1795
+ members: [
1605
1796
  {
1606
- name: 'POINT_TWO',
1607
- value: '0.2',
1797
+ name: 'NA',
1798
+ value: 'NA',
1799
+ },
1800
+ {
1801
+ name: 'NB',
1802
+ value: 'NB',
1608
1803
  },
1609
1804
  ],
1610
1805
  },
1611
- StringEnum: {
1806
+ EnumStr: {
1807
+ name: 'EnumStr',
1612
1808
  type: 'EnumDeclarationWithMembers',
1613
- name: 'StringEnum',
1614
1809
  memberType: 'StringTypeAnnotation',
1615
1810
  members: [
1616
1811
  {
1617
- name: 'HELLO',
1618
- value: 'hello',
1812
+ name: 'SA',
1813
+ value: 's---a',
1619
1814
  },
1620
1815
  {
1621
- name: 'GoodBye',
1622
- value: 'goodbye',
1816
+ name: 'SB',
1817
+ value: 's---b',
1623
1818
  },
1624
1819
  ],
1625
1820
  },
@@ -1627,147 +1822,573 @@ const CXX_ONLY_NATIVE_MODULES = {
1627
1822
  spec: {
1628
1823
  properties: [
1629
1824
  {
1630
- name: 'getMixed',
1825
+ name: 'getArray',
1631
1826
  optional: false,
1632
1827
  typeAnnotation: {
1633
1828
  type: 'FunctionTypeAnnotation',
1634
1829
  returnTypeAnnotation: {
1635
- type: 'MixedTypeAnnotation',
1830
+ type: 'ArrayTypeAnnotation',
1636
1831
  },
1637
1832
  params: [
1638
1833
  {
1639
1834
  name: 'arg',
1640
1835
  optional: false,
1641
1836
  typeAnnotation: {
1642
- type: 'MixedTypeAnnotation',
1837
+ type: 'ArrayTypeAnnotation',
1643
1838
  },
1644
1839
  },
1645
1840
  ],
1646
1841
  },
1647
1842
  },
1648
1843
  {
1649
- name: 'getNullableNumberFromNullableAlias',
1844
+ name: 'getBool',
1650
1845
  optional: false,
1651
1846
  typeAnnotation: {
1652
1847
  type: 'FunctionTypeAnnotation',
1653
1848
  returnTypeAnnotation: {
1654
- type: 'NullableTypeAnnotation',
1655
- typeAnnotation: {
1656
- type: 'NumberTypeAnnotation',
1657
- },
1849
+ type: 'BooleanTypeAnnotation',
1658
1850
  },
1659
1851
  params: [
1660
1852
  {
1661
- name: 'a',
1853
+ name: 'arg',
1662
1854
  optional: false,
1663
1855
  typeAnnotation: {
1664
- type: 'NullableTypeAnnotation',
1665
- typeAnnotation: {
1666
- type: 'TypeAliasTypeAnnotation',
1667
- name: 'ObjectAlias',
1668
- },
1856
+ type: 'BooleanTypeAnnotation',
1669
1857
  },
1670
1858
  },
1671
1859
  ],
1672
1860
  },
1673
1861
  },
1674
1862
  {
1675
- name: 'getEnums',
1863
+ name: 'getConstants',
1676
1864
  optional: false,
1677
1865
  typeAnnotation: {
1678
1866
  type: 'FunctionTypeAnnotation',
1679
1867
  returnTypeAnnotation: {
1680
- type: 'StringTypeAnnotation',
1868
+ type: 'TypeAliasTypeAnnotation',
1869
+ name: 'ConstantsStruct',
1870
+ },
1871
+ params: [],
1872
+ },
1873
+ },
1874
+ {
1875
+ name: 'getCustomEnum',
1876
+ optional: false,
1877
+ typeAnnotation: {
1878
+ type: 'FunctionTypeAnnotation',
1879
+ returnTypeAnnotation: {
1880
+ name: 'EnumInt',
1881
+ type: 'EnumDeclaration',
1882
+ memberType: 'NumberTypeAnnotation',
1681
1883
  },
1682
1884
  params: [
1683
1885
  {
1684
- name: 'enumInt',
1886
+ name: 'arg',
1685
1887
  optional: false,
1686
1888
  typeAnnotation: {
1687
- name: 'NumEnum',
1889
+ name: 'EnumInt',
1688
1890
  type: 'EnumDeclaration',
1689
1891
  memberType: 'NumberTypeAnnotation',
1690
1892
  },
1691
1893
  },
1894
+ ],
1895
+ },
1896
+ },
1897
+ {
1898
+ name: 'getCustomHostObject',
1899
+ optional: false,
1900
+ typeAnnotation: {
1901
+ type: 'FunctionTypeAnnotation',
1902
+ returnTypeAnnotation: {
1903
+ type: 'TypeAliasTypeAnnotation',
1904
+ name: 'CustomHostObject',
1905
+ },
1906
+ params: [],
1907
+ },
1908
+ },
1909
+ {
1910
+ name: 'consumeCustomHostObject',
1911
+ optional: false,
1912
+ typeAnnotation: {
1913
+ type: 'FunctionTypeAnnotation',
1914
+ returnTypeAnnotation: {
1915
+ type: 'StringTypeAnnotation',
1916
+ },
1917
+ params: [
1692
1918
  {
1693
- name: 'enumFloat',
1919
+ name: 'customHostObject',
1694
1920
  optional: false,
1695
1921
  typeAnnotation: {
1696
- name: 'FloatEnum',
1697
- type: 'EnumDeclaration',
1698
- memberType: 'NumberTypeAnnotation',
1922
+ type: 'TypeAliasTypeAnnotation',
1923
+ name: 'CustomHostObject',
1699
1924
  },
1700
1925
  },
1926
+ ],
1927
+ },
1928
+ },
1929
+ {
1930
+ name: 'getBinaryTreeNode',
1931
+ optional: false,
1932
+ typeAnnotation: {
1933
+ type: 'FunctionTypeAnnotation',
1934
+ returnTypeAnnotation: {
1935
+ type: 'TypeAliasTypeAnnotation',
1936
+ name: 'BinaryTreeNode',
1937
+ },
1938
+ params: [
1701
1939
  {
1702
- name: 'enumString',
1940
+ name: 'arg',
1703
1941
  optional: false,
1704
1942
  typeAnnotation: {
1705
- name: 'StringEnum',
1706
- type: 'EnumDeclaration',
1707
- memberType: 'StringTypeAnnotation',
1943
+ type: 'TypeAliasTypeAnnotation',
1944
+ name: 'BinaryTreeNode',
1708
1945
  },
1709
1946
  },
1710
1947
  ],
1711
1948
  },
1712
1949
  },
1713
1950
  {
1714
- name: 'getUnion',
1951
+ name: 'getGraphNode',
1715
1952
  optional: false,
1716
1953
  typeAnnotation: {
1717
1954
  type: 'FunctionTypeAnnotation',
1718
1955
  returnTypeAnnotation: {
1719
- type: 'UnionTypeAnnotation',
1720
- memberType: 'ObjectTypeAnnotation',
1956
+ type: 'TypeAliasTypeAnnotation',
1957
+ name: 'GraphNode',
1721
1958
  },
1722
1959
  params: [
1723
1960
  {
1724
- name: 'chooseInt',
1961
+ name: 'arg',
1725
1962
  optional: false,
1726
1963
  typeAnnotation: {
1727
- type: 'UnionTypeAnnotation',
1728
- memberType: 'NumberTypeAnnotation',
1964
+ type: 'TypeAliasTypeAnnotation',
1965
+ name: 'GraphNode',
1729
1966
  },
1730
1967
  },
1731
- {
1732
- name: 'chooseFloat',
1733
- optional: false,
1968
+ ],
1969
+ },
1970
+ },
1971
+ {
1972
+ name: 'getNumEnum',
1973
+ optional: false,
1974
+ typeAnnotation: {
1975
+ type: 'FunctionTypeAnnotation',
1976
+ returnTypeAnnotation: {
1977
+ name: 'EnumFloat',
1978
+ type: 'EnumDeclaration',
1979
+ memberType: 'NumberTypeAnnotation',
1980
+ },
1981
+ params: [
1982
+ {
1983
+ name: 'arg',
1984
+ optional: false,
1734
1985
  typeAnnotation: {
1735
- type: 'UnionTypeAnnotation',
1986
+ name: 'EnumInt',
1987
+ type: 'EnumDeclaration',
1736
1988
  memberType: 'NumberTypeAnnotation',
1737
1989
  },
1738
1990
  },
1991
+ ],
1992
+ },
1993
+ },
1994
+ {
1995
+ name: 'getStrEnum',
1996
+ optional: false,
1997
+ typeAnnotation: {
1998
+ type: 'FunctionTypeAnnotation',
1999
+ returnTypeAnnotation: {
2000
+ name: 'EnumStr',
2001
+ type: 'EnumDeclaration',
2002
+ memberType: 'StringTypeAnnotation',
2003
+ },
2004
+ params: [
2005
+ {
2006
+ name: 'arg',
2007
+ optional: false,
2008
+ typeAnnotation: {
2009
+ name: 'EnumNone',
2010
+ type: 'EnumDeclaration',
2011
+ memberType: 'StringTypeAnnotation',
2012
+ },
2013
+ },
2014
+ ],
2015
+ },
2016
+ },
2017
+ {
2018
+ name: 'getMap',
2019
+ optional: false,
2020
+ typeAnnotation: {
2021
+ type: 'FunctionTypeAnnotation',
2022
+ returnTypeAnnotation: {
2023
+ type: 'GenericObjectTypeAnnotation',
2024
+ dictionaryValueType: {
2025
+ type: 'NullableTypeAnnotation',
2026
+ typeAnnotation: {
2027
+ type: 'NumberTypeAnnotation',
2028
+ },
2029
+ },
2030
+ },
2031
+ params: [
2032
+ {
2033
+ name: 'arg',
2034
+ optional: false,
2035
+ typeAnnotation: {
2036
+ type: 'GenericObjectTypeAnnotation',
2037
+ dictionaryValueType: {
2038
+ type: 'NullableTypeAnnotation',
2039
+ typeAnnotation: {
2040
+ type: 'NumberTypeAnnotation',
2041
+ },
2042
+ },
2043
+ },
2044
+ },
2045
+ ],
2046
+ },
2047
+ },
2048
+ {
2049
+ name: 'getNumber',
2050
+ optional: false,
2051
+ typeAnnotation: {
2052
+ type: 'FunctionTypeAnnotation',
2053
+ returnTypeAnnotation: {
2054
+ type: 'NumberTypeAnnotation',
2055
+ },
2056
+ params: [
2057
+ {
2058
+ name: 'arg',
2059
+ optional: false,
2060
+ typeAnnotation: {
2061
+ type: 'NumberTypeAnnotation',
2062
+ },
2063
+ },
2064
+ ],
2065
+ },
2066
+ },
2067
+ {
2068
+ name: 'getObject',
2069
+ optional: false,
2070
+ typeAnnotation: {
2071
+ type: 'FunctionTypeAnnotation',
2072
+ returnTypeAnnotation: {
2073
+ type: 'TypeAliasTypeAnnotation',
2074
+ name: 'ObjectStruct',
2075
+ },
2076
+ params: [
2077
+ {
2078
+ name: 'arg',
2079
+ optional: false,
2080
+ typeAnnotation: {
2081
+ type: 'TypeAliasTypeAnnotation',
2082
+ name: 'ObjectStruct',
2083
+ },
2084
+ },
2085
+ ],
2086
+ },
2087
+ },
2088
+ {
2089
+ name: 'getSet',
2090
+ optional: false,
2091
+ typeAnnotation: {
2092
+ type: 'FunctionTypeAnnotation',
2093
+ returnTypeAnnotation: {
2094
+ type: 'ArrayTypeAnnotation',
2095
+ elementType: {
2096
+ type: 'NumberTypeAnnotation',
2097
+ },
2098
+ },
2099
+ params: [
2100
+ {
2101
+ name: 'arg',
2102
+ optional: false,
2103
+ typeAnnotation: {
2104
+ type: 'ArrayTypeAnnotation',
2105
+ elementType: {
2106
+ type: 'NumberTypeAnnotation',
2107
+ },
2108
+ },
2109
+ },
2110
+ ],
2111
+ },
2112
+ },
2113
+ {
2114
+ name: 'getString',
2115
+ optional: false,
2116
+ typeAnnotation: {
2117
+ type: 'FunctionTypeAnnotation',
2118
+ returnTypeAnnotation: {
2119
+ type: 'StringTypeAnnotation',
2120
+ },
2121
+ params: [
2122
+ {
2123
+ name: 'arg',
2124
+ optional: false,
2125
+ typeAnnotation: {
2126
+ type: 'StringTypeAnnotation',
2127
+ },
2128
+ },
2129
+ ],
2130
+ },
2131
+ },
2132
+ {
2133
+ name: 'getUnion',
2134
+ optional: false,
2135
+ typeAnnotation: {
2136
+ type: 'FunctionTypeAnnotation',
2137
+ returnTypeAnnotation: {
2138
+ type: 'StringTypeAnnotation',
2139
+ },
2140
+ params: [
1739
2141
  {
1740
- name: 'chooseObject',
2142
+ name: 'x',
1741
2143
  optional: false,
1742
2144
  typeAnnotation: {
1743
2145
  type: 'UnionTypeAnnotation',
1744
- memberType: 'ObjectTypeAnnotation',
2146
+ memberType: 'NumberTypeAnnotation',
1745
2147
  },
1746
2148
  },
1747
2149
  {
1748
- name: 'chooseString',
2150
+ name: 'y',
1749
2151
  optional: false,
1750
2152
  typeAnnotation: {
1751
2153
  type: 'UnionTypeAnnotation',
1752
2154
  memberType: 'StringTypeAnnotation',
1753
2155
  },
1754
2156
  },
2157
+ {
2158
+ name: 'z',
2159
+ optional: false,
2160
+ typeAnnotation: {
2161
+ type: 'UnionTypeAnnotation',
2162
+ memberType: 'ObjectTypeAnnotation',
2163
+ },
2164
+ },
1755
2165
  ],
1756
2166
  },
1757
2167
  },
1758
2168
  {
1759
- name: 'getEnumReturn',
2169
+ name: 'getValue',
1760
2170
  optional: false,
1761
2171
  typeAnnotation: {
1762
2172
  type: 'FunctionTypeAnnotation',
1763
2173
  returnTypeAnnotation: {
1764
- type: 'EnumDeclaration',
1765
- name: 'NumEnum',
1766
- memberType: 'NumberTypeAnnotation',
2174
+ type: 'TypeAliasTypeAnnotation',
2175
+ name: 'ValueStruct',
2176
+ },
2177
+ params: [
2178
+ {
2179
+ name: 'x',
2180
+ optional: false,
2181
+ typeAnnotation: {
2182
+ type: 'NumberTypeAnnotation',
2183
+ },
2184
+ },
2185
+ {
2186
+ name: 'y',
2187
+ optional: false,
2188
+ typeAnnotation: {
2189
+ type: 'StringTypeAnnotation',
2190
+ },
2191
+ },
2192
+ {
2193
+ name: 'z',
2194
+ optional: false,
2195
+ typeAnnotation: {
2196
+ type: 'TypeAliasTypeAnnotation',
2197
+ name: 'ObjectStruct',
2198
+ },
2199
+ },
2200
+ ],
2201
+ },
2202
+ },
2203
+ {
2204
+ name: 'getValueWithCallback',
2205
+ optional: false,
2206
+ typeAnnotation: {
2207
+ type: 'FunctionTypeAnnotation',
2208
+ returnTypeAnnotation: {
2209
+ type: 'VoidTypeAnnotation',
2210
+ },
2211
+ params: [
2212
+ {
2213
+ name: 'callback',
2214
+ optional: false,
2215
+ typeAnnotation: {
2216
+ type: 'FunctionTypeAnnotation',
2217
+ returnTypeAnnotation: {
2218
+ type: 'VoidTypeAnnotation',
2219
+ },
2220
+ params: [
2221
+ {
2222
+ name: 'value',
2223
+ optional: false,
2224
+ typeAnnotation: {
2225
+ type: 'StringTypeAnnotation',
2226
+ },
2227
+ },
2228
+ ],
2229
+ },
2230
+ },
2231
+ ],
2232
+ },
2233
+ },
2234
+ {
2235
+ name: 'getValueWithPromise',
2236
+ optional: false,
2237
+ typeAnnotation: {
2238
+ type: 'FunctionTypeAnnotation',
2239
+ returnTypeAnnotation: {
2240
+ type: 'PromiseTypeAnnotation',
2241
+ elementType: {
2242
+ type: 'StringTypeAnnotation',
2243
+ },
2244
+ },
2245
+ params: [
2246
+ {
2247
+ name: 'error',
2248
+ optional: false,
2249
+ typeAnnotation: {
2250
+ type: 'BooleanTypeAnnotation',
2251
+ },
2252
+ },
2253
+ ],
2254
+ },
2255
+ },
2256
+ {
2257
+ name: 'getWithWithOptionalArgs',
2258
+ optional: false,
2259
+ typeAnnotation: {
2260
+ type: 'FunctionTypeAnnotation',
2261
+ returnTypeAnnotation: {
2262
+ type: 'NullableTypeAnnotation',
2263
+ typeAnnotation: {
2264
+ type: 'BooleanTypeAnnotation',
2265
+ },
2266
+ },
2267
+ params: [
2268
+ {
2269
+ name: 'optionalArg',
2270
+ optional: true,
2271
+ typeAnnotation: {
2272
+ type: 'BooleanTypeAnnotation',
2273
+ },
2274
+ },
2275
+ ],
2276
+ },
2277
+ },
2278
+ {
2279
+ name: 'voidFunc',
2280
+ optional: false,
2281
+ typeAnnotation: {
2282
+ type: 'FunctionTypeAnnotation',
2283
+ returnTypeAnnotation: {
2284
+ type: 'VoidTypeAnnotation',
2285
+ },
2286
+ params: [],
2287
+ },
2288
+ },
2289
+ {
2290
+ name: 'setMenu',
2291
+ optional: false,
2292
+ typeAnnotation: {
2293
+ type: 'FunctionTypeAnnotation',
2294
+ returnTypeAnnotation: {
2295
+ type: 'VoidTypeAnnotation',
2296
+ },
2297
+ params: [
2298
+ {
2299
+ name: 'menuItem',
2300
+ optional: false,
2301
+ typeAnnotation: {
2302
+ type: 'TypeAliasTypeAnnotation',
2303
+ name: 'MenuItem',
2304
+ },
2305
+ },
2306
+ ],
2307
+ },
2308
+ },
2309
+ {
2310
+ name: 'emitCustomDeviceEvent',
2311
+ optional: false,
2312
+ typeAnnotation: {
2313
+ type: 'FunctionTypeAnnotation',
2314
+ returnTypeAnnotation: {
2315
+ type: 'VoidTypeAnnotation',
2316
+ },
2317
+ params: [
2318
+ {
2319
+ name: 'eventName',
2320
+ optional: false,
2321
+ typeAnnotation: {
2322
+ type: 'StringTypeAnnotation',
2323
+ },
2324
+ },
2325
+ ],
2326
+ },
2327
+ },
2328
+ {
2329
+ name: 'voidFuncThrows',
2330
+ optional: false,
2331
+ typeAnnotation: {
2332
+ type: 'FunctionTypeAnnotation',
2333
+ returnTypeAnnotation: {
2334
+ type: 'VoidTypeAnnotation',
1767
2335
  },
1768
2336
  params: [],
1769
2337
  },
1770
2338
  },
2339
+ {
2340
+ name: 'getObjectThrows',
2341
+ optional: false,
2342
+ typeAnnotation: {
2343
+ type: 'FunctionTypeAnnotation',
2344
+ returnTypeAnnotation: {
2345
+ type: 'TypeAliasTypeAnnotation',
2346
+ name: 'ObjectStruct',
2347
+ },
2348
+ params: [
2349
+ {
2350
+ name: 'arg',
2351
+ optional: false,
2352
+ typeAnnotation: {
2353
+ type: 'TypeAliasTypeAnnotation',
2354
+ name: 'ObjectStruct',
2355
+ },
2356
+ },
2357
+ ],
2358
+ },
2359
+ },
2360
+ {
2361
+ name: 'voidFuncAssert',
2362
+ optional: false,
2363
+ typeAnnotation: {
2364
+ type: 'FunctionTypeAnnotation',
2365
+ returnTypeAnnotation: {
2366
+ type: 'VoidTypeAnnotation',
2367
+ },
2368
+ params: [],
2369
+ },
2370
+ },
2371
+ {
2372
+ name: 'getObjectAssert',
2373
+ optional: false,
2374
+ typeAnnotation: {
2375
+ type: 'FunctionTypeAnnotation',
2376
+ returnTypeAnnotation: {
2377
+ type: 'TypeAliasTypeAnnotation',
2378
+ name: 'ObjectStruct',
2379
+ },
2380
+ params: [
2381
+ {
2382
+ name: 'arg',
2383
+ optional: false,
2384
+ typeAnnotation: {
2385
+ type: 'TypeAliasTypeAnnotation',
2386
+ name: 'ObjectStruct',
2387
+ },
2388
+ },
2389
+ ],
2390
+ },
2391
+ },
1771
2392
  ],
1772
2393
  },
1773
2394
  moduleName: 'SampleTurboModuleCxx',