@lynx-js/lynx-library-headers 0.0.1-alpha.4 → 0.0.1

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 (136) hide show
  1. package/index.js +1 -0
  2. package/package.json +3 -26
  3. package/README.md +0 -53
  4. package/include/base/include/value/lynx_api_types.h +0 -57
  5. package/include/base/include/value/lynx_value_api.h +0 -204
  6. package/include/base/include/value/lynx_value_types.h +0 -73
  7. package/include/capi/lynx_env_capi.h +0 -47
  8. package/include/capi/lynx_event_reporter_service_capi.h +0 -67
  9. package/include/capi/lynx_export.h +0 -27
  10. package/include/capi/lynx_extension_module_capi.h +0 -148
  11. package/include/capi/lynx_extension_module_types_capi.h +0 -17
  12. package/include/capi/lynx_generic_resource_fetcher_capi.h +0 -124
  13. package/include/capi/lynx_group_capi.h +0 -42
  14. package/include/capi/lynx_http_service_capi.h +0 -113
  15. package/include/capi/lynx_load_meta_capi.h +0 -52
  16. package/include/capi/lynx_log_capi.h +0 -69
  17. package/include/capi/lynx_memory_capi.h +0 -28
  18. package/include/capi/lynx_native_module_capi.h +0 -51
  19. package/include/capi/lynx_native_view_capi.h +0 -163
  20. package/include/capi/lynx_resource_request_capi.h +0 -71
  21. package/include/capi/lynx_resource_response_capi.h +0 -92
  22. package/include/capi/lynx_runtime_lifecycle_observer_capi.h +0 -62
  23. package/include/capi/lynx_security_service_capi.h +0 -52
  24. package/include/capi/lynx_service_center_capi.h +0 -50
  25. package/include/capi/lynx_template_bundle_capi.h +0 -39
  26. package/include/capi/lynx_template_data_capi.h +0 -33
  27. package/include/capi/lynx_trace_capi.h +0 -62
  28. package/include/capi/lynx_trail_service_capi.h +0 -35
  29. package/include/capi/lynx_types.h +0 -750
  30. package/include/capi/lynx_update_meta_capi.h +0 -33
  31. package/include/capi/lynx_view_builder_capi.h +0 -113
  32. package/include/capi/lynx_view_capi.h +0 -174
  33. package/include/capi/lynx_view_client_capi.h +0 -81
  34. package/include/capi/lynx_vsync_monitor_capi.h +0 -38
  35. package/include/capi/lynx_windowless_renderer_capi.h +0 -213
  36. package/include/js_native_api.h +0 -608
  37. package/include/js_native_api_types.h +0 -202
  38. package/include/lynx/base/include/value/lynx_api_types.h +0 -57
  39. package/include/lynx/base/include/value/lynx_value_api.h +0 -204
  40. package/include/lynx/base/include/value/lynx_value_types.h +0 -73
  41. package/include/lynx/extension.h +0 -6
  42. package/include/lynx/platform/embedder/public/capi/lynx_env_capi.h +0 -47
  43. package/include/lynx/platform/embedder/public/capi/lynx_event_reporter_service_capi.h +0 -67
  44. package/include/lynx/platform/embedder/public/capi/lynx_export.h +0 -27
  45. package/include/lynx/platform/embedder/public/capi/lynx_extension_module_capi.h +0 -148
  46. package/include/lynx/platform/embedder/public/capi/lynx_extension_module_types_capi.h +0 -17
  47. package/include/lynx/platform/embedder/public/capi/lynx_generic_resource_fetcher_capi.h +0 -124
  48. package/include/lynx/platform/embedder/public/capi/lynx_group_capi.h +0 -42
  49. package/include/lynx/platform/embedder/public/capi/lynx_http_service_capi.h +0 -113
  50. package/include/lynx/platform/embedder/public/capi/lynx_load_meta_capi.h +0 -52
  51. package/include/lynx/platform/embedder/public/capi/lynx_log_capi.h +0 -69
  52. package/include/lynx/platform/embedder/public/capi/lynx_memory_capi.h +0 -28
  53. package/include/lynx/platform/embedder/public/capi/lynx_native_module_capi.h +0 -51
  54. package/include/lynx/platform/embedder/public/capi/lynx_native_view_capi.h +0 -163
  55. package/include/lynx/platform/embedder/public/capi/lynx_resource_request_capi.h +0 -71
  56. package/include/lynx/platform/embedder/public/capi/lynx_resource_response_capi.h +0 -92
  57. package/include/lynx/platform/embedder/public/capi/lynx_runtime_lifecycle_observer_capi.h +0 -62
  58. package/include/lynx/platform/embedder/public/capi/lynx_security_service_capi.h +0 -52
  59. package/include/lynx/platform/embedder/public/capi/lynx_service_center_capi.h +0 -50
  60. package/include/lynx/platform/embedder/public/capi/lynx_template_bundle_capi.h +0 -39
  61. package/include/lynx/platform/embedder/public/capi/lynx_template_data_capi.h +0 -33
  62. package/include/lynx/platform/embedder/public/capi/lynx_trace_capi.h +0 -62
  63. package/include/lynx/platform/embedder/public/capi/lynx_trail_service_capi.h +0 -35
  64. package/include/lynx/platform/embedder/public/capi/lynx_types.h +0 -750
  65. package/include/lynx/platform/embedder/public/capi/lynx_update_meta_capi.h +0 -33
  66. package/include/lynx/platform/embedder/public/capi/lynx_view_builder_capi.h +0 -113
  67. package/include/lynx/platform/embedder/public/capi/lynx_view_capi.h +0 -174
  68. package/include/lynx/platform/embedder/public/capi/lynx_view_client_capi.h +0 -81
  69. package/include/lynx/platform/embedder/public/capi/lynx_vsync_monitor_capi.h +0 -38
  70. package/include/lynx/platform/embedder/public/capi/lynx_windowless_renderer_capi.h +0 -213
  71. package/include/lynx/platform/embedder/public/lynx_env.h +0 -104
  72. package/include/lynx/platform/embedder/public/lynx_event_reporter_service.h +0 -96
  73. package/include/lynx/platform/embedder/public/lynx_event_simulation_proxy.h +0 -31
  74. package/include/lynx/platform/embedder/public/lynx_extension_module.h +0 -521
  75. package/include/lynx/platform/embedder/public/lynx_generic_resource_fetcher.h +0 -178
  76. package/include/lynx/platform/embedder/public/lynx_group.h +0 -70
  77. package/include/lynx/platform/embedder/public/lynx_http_service.h +0 -211
  78. package/include/lynx/platform/embedder/public/lynx_load_meta.h +0 -120
  79. package/include/lynx/platform/embedder/public/lynx_native_module.h +0 -9
  80. package/include/lynx/platform/embedder/public/lynx_native_view.h +0 -201
  81. package/include/lynx/platform/embedder/public/lynx_resource_request.h +0 -56
  82. package/include/lynx/platform/embedder/public/lynx_resource_response.h +0 -63
  83. package/include/lynx/platform/embedder/public/lynx_runtime_lifecycle_observer.h +0 -102
  84. package/include/lynx/platform/embedder/public/lynx_security_service.h +0 -78
  85. package/include/lynx/platform/embedder/public/lynx_service_center.h +0 -64
  86. package/include/lynx/platform/embedder/public/lynx_template_bundle.h +0 -65
  87. package/include/lynx/platform/embedder/public/lynx_template_data.h +0 -104
  88. package/include/lynx/platform/embedder/public/lynx_trail_service.h +0 -81
  89. package/include/lynx/platform/embedder/public/lynx_update_meta.h +0 -56
  90. package/include/lynx/platform/embedder/public/lynx_value.h +0 -270
  91. package/include/lynx/platform/embedder/public/lynx_view.h +0 -364
  92. package/include/lynx/platform/embedder/public/lynx_view_client.h +0 -226
  93. package/include/lynx/platform/embedder/public/lynx_vsync_monitor.h +0 -70
  94. package/include/lynx/platform/embedder/public/lynx_windowless_renderer.h +0 -302
  95. package/include/lynx/registration.h +0 -178
  96. package/include/lynx_env.h +0 -104
  97. package/include/lynx_event_reporter_service.h +0 -96
  98. package/include/lynx_event_simulation_proxy.h +0 -31
  99. package/include/lynx_extension.h +0 -10
  100. package/include/lynx_extension_module.h +0 -521
  101. package/include/lynx_generic_resource_fetcher.h +0 -178
  102. package/include/lynx_group.h +0 -70
  103. package/include/lynx_http_service.h +0 -211
  104. package/include/lynx_load_meta.h +0 -120
  105. package/include/lynx_native_module.h +0 -9
  106. package/include/lynx_native_view.h +0 -201
  107. package/include/lynx_resource_request.h +0 -56
  108. package/include/lynx_resource_response.h +0 -63
  109. package/include/lynx_runtime_lifecycle_observer.h +0 -102
  110. package/include/lynx_security_service.h +0 -78
  111. package/include/lynx_service_center.h +0 -64
  112. package/include/lynx_template_bundle.h +0 -65
  113. package/include/lynx_template_data.h +0 -104
  114. package/include/lynx_trail_service.h +0 -81
  115. package/include/lynx_update_meta.h +0 -56
  116. package/include/lynx_value.h +0 -270
  117. package/include/lynx_view.h +0 -364
  118. package/include/lynx_view_client.h +0 -226
  119. package/include/lynx_vsync_monitor.h +0 -70
  120. package/include/lynx_windowless_renderer.h +0 -302
  121. package/include/napi-inl.deprecated.h +0 -186
  122. package/include/napi-inl.h +0 -6607
  123. package/include/napi.h +0 -3208
  124. package/include/node_api.h +0 -276
  125. package/include/node_api_types.h +0 -59
  126. package/include/third_party/weak-node-api/headers/js_native_api.h +0 -608
  127. package/include/third_party/weak-node-api/headers/js_native_api_types.h +0 -202
  128. package/include/third_party/weak-node-api/headers/napi-inl.deprecated.h +0 -186
  129. package/include/third_party/weak-node-api/headers/napi-inl.h +0 -6607
  130. package/include/third_party/weak-node-api/headers/napi.h +0 -3208
  131. package/include/third_party/weak-node-api/headers/node_api.h +0 -276
  132. package/include/third_party/weak-node-api/headers/node_api_types.h +0 -59
  133. package/include/third_party/weak-node-api/headers/weak_napi_defines.h +0 -331
  134. package/include/third_party/weak-node-api/headers/weak_napi_undefs.h +0 -282
  135. package/include/weak_napi_defines.h +0 -331
  136. package/include/weak_napi_undefs.h +0 -282
@@ -1,104 +0,0 @@
1
- // Copyright 2025 The Lynx Authors. All rights reserved.
2
- // Licensed under the Apache License Version 2.0 that can be found in the
3
- // LICENSE file in the root directory of this source tree.
4
- #ifndef PLATFORM_EMBEDDER_PUBLIC_LYNX_ENV_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_LYNX_ENV_H_
6
-
7
- #include <string>
8
- #include <unordered_map>
9
-
10
- #include "capi/lynx_env_capi.h"
11
- #include "lynx_native_module.h"
12
-
13
- namespace lynx {
14
- namespace pub {
15
-
16
- class LynxEnv {
17
- public:
18
- static LynxEnv& GetInstance();
19
- const char* GetVersion();
20
- void SetICUDataPath(const char* icu_data_path);
21
- const char* GetICUDataPath() const;
22
-
23
- void SetDevtoolAppInfo(const char* name, const char* value);
24
- void SetDevtoolEnabled(bool enable);
25
- bool IsDevtoolEnabled();
26
- bool ConnectDevtool(const char* url);
27
- void SetOpenCardCallback(lynx_env_open_card_callback callback,
28
- void* user_data);
29
- void SetLogboxEnabled(bool enable);
30
- bool IsLogboxEnabled();
31
- void RegisterNativeModule(const std::string& module_name,
32
- napi_module_creator creator, void* opaque);
33
- void RegisterExtensionModule(const std::string& module_name,
34
- extension_module_creator creator,
35
- bool is_lazy_create, void* opaque);
36
-
37
- LynxEnv(const LynxEnv&) = delete;
38
- LynxEnv& operator=(const LynxEnv&) = delete;
39
-
40
- private:
41
- LynxEnv() = default;
42
- ~LynxEnv() = default;
43
- };
44
-
45
- inline LynxEnv& LynxEnv::GetInstance() {
46
- static LynxEnv instance;
47
- return instance;
48
- }
49
-
50
- inline const char* LynxEnv::GetVersion() { return lynx_env_get_sdk_version(); }
51
-
52
- inline void LynxEnv::SetICUDataPath(const char* icu_data_path) {
53
- lynx_env_set_icu_data_path(icu_data_path);
54
- }
55
-
56
- inline const char* LynxEnv::GetICUDataPath() const {
57
- return lynx_env_get_icu_data_path();
58
- }
59
-
60
- inline void LynxEnv::SetDevtoolAppInfo(const char* name, const char* value) {
61
- lynx_env_set_devtool_app_info(name, value);
62
- }
63
-
64
- inline void LynxEnv::SetDevtoolEnabled(bool enable) {
65
- lynx_env_enable_devtool(enable);
66
- }
67
-
68
- inline bool LynxEnv::IsDevtoolEnabled() {
69
- return lynx_env_is_devtool_enabled();
70
- }
71
-
72
- inline bool LynxEnv::ConnectDevtool(const char* url) {
73
- return lynx_env_connect_devtool(url);
74
- }
75
-
76
- inline void LynxEnv::SetOpenCardCallback(lynx_env_open_card_callback callback,
77
- void* user_data) {
78
- lynx_env_set_open_card_callback(callback, user_data);
79
- }
80
-
81
- inline void LynxEnv::SetLogboxEnabled(bool enable) {
82
- lynx_env_enable_logbox(enable);
83
- }
84
-
85
- inline bool LynxEnv::IsLogboxEnabled() { return lynx_env_is_logbox_enabled(); }
86
-
87
- inline void LynxEnv::RegisterNativeModule(const std::string& module_name,
88
- napi_module_creator creator,
89
- void* opaque) {
90
- lynx_env_register_native_module(module_name.c_str(), creator, opaque);
91
- }
92
-
93
- inline void LynxEnv::RegisterExtensionModule(const std::string& module_name,
94
- extension_module_creator creator,
95
- bool is_lazy_create,
96
- void* opaque) {
97
- lynx_env_register_extension_module(module_name.c_str(), creator,
98
- is_lazy_create, opaque);
99
- }
100
-
101
- } // namespace pub
102
- } // namespace lynx
103
-
104
- #endif // PLATFORM_EMBEDDER_PUBLIC_LYNX_ENV_H_
@@ -1,96 +0,0 @@
1
- // Copyright 2025 The Lynx Authors. All rights reserved.
2
- // Licensed under the Apache License Version 2.0 that can be found in the
3
- // LICENSE file in the root directory of this source tree.
4
- #ifndef PLATFORM_EMBEDDER_PUBLIC_LYNX_EVENT_REPORTER_SERVICE_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_LYNX_EVENT_REPORTER_SERVICE_H_
6
-
7
- #include <cstdint>
8
- #include <memory>
9
- #include <string>
10
- #include <unordered_map>
11
- #include <vector>
12
-
13
- #include "capi/lynx_event_reporter_service_capi.h"
14
- #include "capi/lynx_service_center_capi.h"
15
- #include "lynx/base/include/value/lynx_api_types.h"
16
- #include "lynx_service_center.h"
17
-
18
- namespace lynx {
19
- namespace pub {
20
-
21
- class LynxEventReporterService
22
- : public LynxServiceBase,
23
- public std::enable_shared_from_this<LynxEventReporterService> {
24
- public:
25
- LynxEventReporterService() = default;
26
- ~LynxEventReporterService() = default;
27
-
28
- void InitIfNeeded() override {
29
- if (event_reporter_service_) {
30
- return;
31
- }
32
- event_reporter_service_ = lynx_event_reporter_service_create_with_finalizer(
33
- new std::weak_ptr<LynxEventReporterService>(weak_from_this()),
34
- [](lynx_event_reporter_service_t* event_reporter_service,
35
- void* user_data) {
36
- std::weak_ptr<LynxEventReporterService>* weak_ptr =
37
- reinterpret_cast<std::weak_ptr<LynxEventReporterService>*>(
38
- user_data);
39
- delete weak_ptr;
40
- });
41
- lynx_event_reporter_service_bind(
42
- event_reporter_service_,
43
- [](lynx_event_reporter_service_t* event_reporter_service,
44
- const char* event_name, const lynx_value& params) {
45
- std::weak_ptr<LynxEventReporterService>* weak_ptr =
46
- reinterpret_cast<std::weak_ptr<LynxEventReporterService>*>(
47
- lynx_event_reporter_service_get_user_data(
48
- event_reporter_service));
49
- auto shared_event_reporter_service = weak_ptr->lock();
50
- if (shared_event_reporter_service) {
51
- shared_event_reporter_service->OnEvent(event_name, params);
52
- }
53
- });
54
-
55
- lynx_event_reporter_service_bind_performance_report_func(
56
- event_reporter_service_,
57
- [](lynx_event_reporter_service_t* event_reporter_service,
58
- const lynx_value& params) {
59
- std::weak_ptr<LynxEventReporterService>* weak_ptr =
60
- reinterpret_cast<std::weak_ptr<LynxEventReporterService>*>(
61
- lynx_event_reporter_service_get_user_data(
62
- event_reporter_service));
63
- auto shared_event_reporter_service = weak_ptr->lock();
64
- if (shared_event_reporter_service) {
65
- shared_event_reporter_service->OnPerformanceEvent(params);
66
- }
67
- });
68
- }
69
-
70
- lynx_service_type_e GetServiceType() override {
71
- return kServiceTypeEventReporter;
72
- }
73
-
74
- void* Impl() override { return event_reporter_service_; }
75
-
76
- /**
77
- * @brief Interface to receive reported events
78
- * @param event_name Name of reported event
79
- * @param props Content of reported event in key-value format
80
- */
81
- virtual void OnEvent(const std::string& event_name,
82
- const lynx_value& params) = 0;
83
-
84
- /**
85
- * @brief Interface to receive reported performance events
86
- * @param params Content of reported event in key-value format
87
- */
88
- virtual void OnPerformanceEvent(const lynx_value& params) {}
89
-
90
- private:
91
- lynx_event_reporter_service_t* event_reporter_service_ = nullptr;
92
- };
93
- } // namespace pub
94
- } // namespace lynx
95
-
96
- #endif // PLATFORM_EMBEDDER_PUBLIC_LYNX_EVENT_REPORTER_SERVICE_H_
@@ -1,31 +0,0 @@
1
- // Copyright 2025 The Lynx Authors. All rights reserved.
2
- // Licensed under the Apache License Version 2.0 that can be found in the
3
- // LICENSE file in the root directory of this source tree.
4
-
5
- #ifndef PLATFORM_EMBEDDER_PUBLIC_LYNX_EVENT_SIMULATION_PROXY_H_
6
- #define PLATFORM_EMBEDDER_PUBLIC_LYNX_EVENT_SIMULATION_PROXY_H_
7
-
8
- #include <string>
9
-
10
- namespace lynx {
11
- namespace pub {
12
-
13
- class LynxEventSimulationProxy {
14
- public:
15
- static constexpr const char* kMousePressed = "mousePressed";
16
- static constexpr const char* kMouseMoved = "mouseMoved";
17
- static constexpr const char* kMouseReleased = "mouseReleased";
18
- static constexpr const char* kMouseWheel = "mouseWheel";
19
- static constexpr const char* kMouseLeftButton = "left";
20
- static constexpr const char* kMouseRightButton = "right";
21
-
22
- virtual ~LynxEventSimulationProxy() = default;
23
- virtual void EmulateTouch(const std::string& event_type, int x, int y,
24
- const std::string& button, float delta_x,
25
- float delta_y, int modifiers, int click_count) = 0;
26
- };
27
-
28
- } // namespace pub
29
- } // namespace lynx
30
-
31
- #endif // PLATFORM_EMBEDDER_PUBLIC_LYNX_EVENT_SIMULATION_PROXY_H_