@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,163 +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_CAPI_LYNX_NATIVE_VIEW_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_NATIVE_VIEW_CAPI_H_
6
-
7
- #include "base/include/value/lynx_value_api.h"
8
- #include "lynx_export.h"
9
-
10
- LYNX_EXTERN_C_BEGIN
11
-
12
- typedef struct lynx_native_view_ lynx_native_view_t;
13
- // Opaque platform native graphics handle. On Darwin this is IOSurfaceRef.
14
- // On Windows this is a D3D shared HANDLE for the active graphics backend,
15
- // not a texture/device pointer.
16
- typedef struct lynx_surface_ lynx_surface_handle_t;
17
-
18
- typedef enum lynx_native_event_type {
19
- kNativeEventUnkown = 0,
20
- kNativeEventDown,
21
- kNativeEventUp,
22
- kNativeEventMove,
23
- kNativeEventHover,
24
- kNativeEventSignal,
25
- kNativeEventCancel,
26
- kNativeEventPanZoomStart,
27
- kNativeEventPanZoomUpdate,
28
- kNativeEventPanZoomEnd,
29
- } lynx_native_event_type_t;
30
-
31
- typedef enum lynx_native_device_type {
32
- kNativeDeviceTouch,
33
- kNativeDeviceMouse,
34
- kNativeDeviceStylus,
35
- kNativeDeviceInvertedStylus,
36
- kNativeDeviceTrackpad,
37
- } lynx_native_device_type_t;
38
-
39
- typedef enum lynx_native_signal_kind {
40
- kNativeSignalNone,
41
- kNativeSignalStartScroll,
42
- kNativeSignalScroll,
43
- kNativeSignalEndScroll,
44
- } lynx_native_signal_kind_t;
45
-
46
- enum lynx_native_mouse_button {
47
- kNativeMouseButtonPrimary = 1 << 0,
48
- kNativeMouseButtonSecondary = 1 << 1,
49
- kNativeMouseButtonMiddle = 1 << 2,
50
- kNativeMouseButtonBack = 1 << 3,
51
- kNativeMouseButtonForward = 1 << 4,
52
- };
53
-
54
- typedef struct native_view_motion_event {
55
- // Time of event dispatch, relative to an arbitrary timeline.
56
- uint64_t timestamp;
57
- // The type of event
58
- lynx_native_event_type_t type;
59
- lynx_native_device_type_t device;
60
- lynx_native_signal_kind_t signal_kind;
61
- // Unique identifier for the pointer, not reused. Changes for each new pointer
62
- // down event.
63
- int pointer_id;
64
- // Unique identifier for the pointing device, reused across interactions.
65
- int device_id;
66
- // Bit field to indicate which buttons are pressed
67
- uint32_t buttons;
68
- // The coordinate of the event relative to the origin of the native view.
69
- float x;
70
- float y;
71
- // The coordinate of the event in viewport coordinates.
72
- float pageX;
73
- float pageY;
74
- // Distance in logical pixels that the pointer moved since the last events.
75
- float deltaX;
76
- float deltaY;
77
- // The scale (zoom factor) of the pan/zoom.
78
- double scale;
79
- // True if the alt key was down when the mouse event was fired.
80
- uint8_t altKey;
81
- // True if the control key was down when the mouse event was fired.
82
- uint8_t ctrlKey;
83
- // True if the shift key was down when the mouse event was fired.
84
- uint8_t shiftKey;
85
- // True if the meta key was down when the mouse event was fired.
86
- uint8_t metaKey;
87
- } native_view_motion_event_t;
88
-
89
- typedef enum lynx_surface_buffer_mode {
90
- kSingleBuffer,
91
- kDoubleBuffer,
92
- kTripleBuffer,
93
- } lynx_surface_buffer_mode_t;
94
-
95
- typedef struct lynx_native_view_callback_info {
96
- void* impl;
97
- int64_t callback_id;
98
- } lynx_native_view_callback_info_t;
99
-
100
- typedef lynx_native_view_t* (*lynx_native_view_creator)(void* opaque);
101
- typedef void (*lynx_native_view_callback)(lynx_native_view_callback_info_t, int,
102
- lynx_value);
103
-
104
- LYNX_CAPI_EXPORT lynx_native_view_t* lynx_native_view_create(void* user_data);
105
- LYNX_CAPI_EXPORT lynx_native_view_t* lynx_native_view_retain(
106
- lynx_native_view_t*);
107
- LYNX_CAPI_EXPORT void lynx_native_view_release(lynx_native_view_t*);
108
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_create(
109
- lynx_native_view_t*, bool (*)(lynx_native_view_t*, void* user_data));
110
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_attach(
111
- lynx_native_view_t*, void (*)(lynx_native_view_t*, void* user_data));
112
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_detach(
113
- lynx_native_view_t*, void (*)(lynx_native_view_t*, void* user_data));
114
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_destroy(
115
- lynx_native_view_t*, void (*)(lynx_native_view_t*, void* user_data));
116
- LYNX_CAPI_EXPORT void lynx_native_view_bind_release(
117
- lynx_native_view_t*, void (*)(lynx_native_view_t*, void* user_data));
118
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_layout_changed(
119
- lynx_native_view_t*,
120
- void (*)(lynx_native_view_t*, void* user_data, float left, float top,
121
- float width, float height, float pixel_ratio));
122
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_properties_changed(
123
- lynx_native_view_t*, void (*)(lynx_native_view_t*, void* user_data,
124
- lynx_value attrs, lynx_value events));
125
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_motion_event(
126
- lynx_native_view_t*, void (*)(lynx_native_view_t*, void* user_data,
127
- native_view_motion_event_t*));
128
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_focus_changed(
129
- lynx_native_view_t*,
130
- void (*)(lynx_native_view_t*, void* user_data, bool focused, bool is_leaf));
131
- LYNX_CAPI_EXPORT void lynx_native_view_bind_on_method_invoked(
132
- lynx_native_view_t*,
133
- void (*)(lynx_native_view_t*, void* user_data, const char* method,
134
- lynx_value attrs, lynx_native_view_callback callback,
135
- lynx_native_view_callback_info_t));
136
- LYNX_CAPI_EXPORT void lynx_native_view_bind_is_scroll_enabled(
137
- lynx_native_view_t*, bool (*)(lynx_native_view_t*, void* user_data));
138
- LYNX_CAPI_EXPORT void lynx_native_view_bind_is_surface_enabled(
139
- lynx_native_view_t*, bool (*)(lynx_native_view_t*, void* user_data));
140
- LYNX_CAPI_EXPORT void lynx_native_view_bind_surface_buffer_mode(
141
- lynx_native_view_t*,
142
- lynx_surface_buffer_mode_t (*)(lynx_native_view_t*, void* user_data));
143
- LYNX_CAPI_EXPORT lynx_surface_buffer_mode_t
144
- lynx_native_view_get_surface_buffer_mode(lynx_native_view_t*);
145
-
146
- LYNX_CAPI_EXPORT bool lynx_native_view_present_surface(
147
- lynx_native_view_t*, int width, int height, const float* transform,
148
- lynx_surface_handle_t* handle);
149
- // Returns a platform native graphics handle for the latest back buffer.
150
- // Windows callers should import the returned D3D shared HANDLE with the
151
- // graphics API/device that matches the active Windows backend.
152
- LYNX_CAPI_EXPORT lynx_surface_handle_t* lynx_native_view_acquire_surface(
153
- lynx_native_view_t*, int width, int height);
154
- LYNX_CAPI_EXPORT bool lynx_native_view_swap_back(lynx_native_view_t*);
155
- LYNX_CAPI_EXPORT void lynx_native_view_trigger_event(lynx_native_view_t*,
156
- const char* name,
157
- lynx_value params);
158
- LYNX_CAPI_EXPORT void lynx_native_view_request_focus(lynx_native_view_t*);
159
- LYNX_CAPI_EXPORT void lynx_native_view_mark_dirty(lynx_native_view_t*);
160
-
161
- LYNX_EXTERN_C_END
162
-
163
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_NATIVE_VIEW_CAPI_H_
@@ -1,71 +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_CAPI_LYNX_RESOURCE_REQUEST_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_RESOURCE_REQUEST_CAPI_H_
6
-
7
- #include <stdint.h>
8
-
9
- #include "lynx_export.h"
10
-
11
- LYNX_EXTERN_C_BEGIN
12
-
13
- typedef struct lynx_resource_request_t lynx_resource_request_t;
14
-
15
- // Enumeration defining different types of resource requests.
16
- // Each enumerator represents a specific type of resource that can be requested.
17
- typedef enum lynx_resource_type_e {
18
- kLynxResourceTypeGeneric = 0,
19
- kLynxResourceTypeImage,
20
- kLynxResourceTypeFont,
21
- kLynxResourceTypeLottie,
22
- kLynxResourceTypeVideo,
23
- kLynxResourceTypeSVG,
24
- kLynxResourceTypeTemplate,
25
- kLynxResourceTypeLynxCoreJS,
26
- kLynxResourceTypeLazyBundle,
27
- kLynxResourceTypeI18NText,
28
- kLynxResourceTypeTheme,
29
- kLynxResourceTypeExternalJSSource,
30
- kLynxResourceTypeExternalByteCode,
31
- kLynxResourceTypeAssets,
32
- } lynx_resource_type_e;
33
-
34
- typedef uint64_t lynx_resource_request_id;
35
- #define kLynxResourceRequestIdInvalid 0
36
-
37
- // Creates a new resource request object.
38
- // The caller assumes ownership of the returned object. Ownership is transferred
39
- // when the object is passed to a consuming function like
40
- // `lynx_generic_resource_fetcher_fetch_resource`, which then becomes
41
- // responsible for its release.
42
- LYNX_CAPI_EXPORT lynx_resource_request_t* lynx_resource_request_create(
43
- const char* url, lynx_resource_type_e type);
44
-
45
- // This function fetches the unique identifier associated with the specified
46
- // `lynx_resource_request_t` object. Each resource request is assigned a
47
- // distinct identifier upon creation, which can be used to track and manage the
48
- // request throughout its lifecycle, such as canceling it later.
49
- LYNX_CAPI_EXPORT lynx_resource_request_id
50
- lynx_resource_request_get_id(lynx_resource_request_t*);
51
-
52
- // Retrieves the type of a resource request. This function determines and
53
- // returns the type of the resource request represented by the provided
54
- // `lynx_resource_request_t` object. The type is identified using the
55
- // `lynx_resource_type_e` enumeration, where each enumerator corresponds to a
56
- // specific type of resource that can be requested.
57
- LYNX_CAPI_EXPORT lynx_resource_type_e
58
- lynx_resource_request_get_type(lynx_resource_request_t*);
59
-
60
- // Retrieves the URL of the resource request. This function returns a pointer to
61
- // a null-terminated string representing the URL of the given resource request.
62
- // The returned string is owned by the `lynx_resource_request_t` object and
63
- // should not be modified or freed by the caller.
64
- LYNX_CAPI_EXPORT const char* lynx_resource_request_get_url(
65
- lynx_resource_request_t*);
66
-
67
- LYNX_CAPI_EXPORT void lynx_resource_request_release(lynx_resource_request_t*);
68
-
69
- LYNX_EXTERN_C_END
70
-
71
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_RESOURCE_REQUEST_CAPI_H_
@@ -1,92 +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_CAPI_LYNX_RESOURCE_RESPONSE_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_RESOURCE_RESPONSE_CAPI_H_
6
-
7
- #include "lynx_export.h"
8
- #include "lynx_template_bundle_capi.h"
9
-
10
- LYNX_EXTERN_C_BEGIN
11
-
12
- typedef struct lynx_resource_response_t lynx_resource_response_t;
13
-
14
- // Defines the callback function for handling a resource response.
15
- // @param response The resource response object.
16
- // @param user_data A user-defined pointer passed to
17
- // `lynx_resource_response_create`.
18
- typedef void (*lynx_resource_response_callback_func)(
19
- lynx_resource_response_t* response, void* user_data);
20
-
21
- // Creates a new resource response object with a callback.
22
- // The caller assumes ownership of the returned object. Ownership is transferred
23
- // when the object is passed to a consuming function like
24
- // `lynx_generic_resource_fetcher_fetch_resource`, which then becomes
25
- // responsible for its release.
26
- LYNX_CAPI_EXPORT lynx_resource_response_t* lynx_resource_response_create(
27
- lynx_resource_response_callback_func callback, void* user_data);
28
-
29
- // Sets the response code for a lynx resource response. The response code can be
30
- // used to indicate the status of the resource fetch operation, such as success,
31
- // failure, or a specific error condition.
32
- LYNX_CAPI_EXPORT void lynx_resource_response_set_code(lynx_resource_response_t*,
33
- int code);
34
-
35
- // Sets the error message for a lynx resource response. The error message can be
36
- // used to provide detailed information about the failure of the resource fetch
37
- // operation when the response code indicates an error condition.
38
- LYNX_CAPI_EXPORT void lynx_resource_response_set_error_message(
39
- lynx_resource_response_t*, const char* msg);
40
-
41
- // Sets the data content for a lynx resource response. It also provides an
42
- // option to specify a destructor function that will be called when the data is
43
- // no longer needed, typically when the response object is released, and pass an
44
- // opaque pointer for additional context.
45
- LYNX_CAPI_EXPORT void lynx_resource_response_set_data(
46
- lynx_resource_response_t*, uint8_t* content, size_t length,
47
- void (*dtor)(uint8_t*, size_t, void*), void* opaque);
48
-
49
- // Retrieves the status code of the resource response.
50
- LYNX_CAPI_EXPORT int lynx_resource_response_get_code(
51
- lynx_resource_response_t* response);
52
-
53
- // Retrieves the error message of the resource response. The returned pointer is
54
- // owned by the response object and is valid only for the lifetime of the
55
- // response. The caller must copy the string if it needs to be used after the
56
- // response is released.
57
- LYNX_CAPI_EXPORT const char* lynx_resource_response_get_error_message(
58
- lynx_resource_response_t* response);
59
-
60
- // Retrieves the data content of the resource response. The returned pointer is
61
- // owned by the response object and is valid only for the lifetime of the
62
- // response. The caller must copy the data if it needs to be used after the
63
- // response is released.
64
- LYNX_CAPI_EXPORT const uint8_t* lynx_resource_response_get_data(
65
- lynx_resource_response_t* response);
66
-
67
- // Retrieves the length of the data content of the resource response.
68
- LYNX_CAPI_EXPORT size_t
69
- lynx_resource_response_get_data_length(lynx_resource_response_t* response);
70
-
71
- // Sets the template bundle for a Lynx resource response. This function is
72
- // designed for use with `LynxTemplateResourceFetcher`. It allows you to
73
- // associate a `lynx_template_bundle_t` object. The template bundle typically
74
- // contains template - related resources that are fetched during the resource
75
- // loading process.
76
- LYNX_CAPI_EXPORT void lynx_resource_response_set_template_bundle(
77
- lynx_resource_response_t*, lynx_template_bundle_t*);
78
-
79
- // Invokes the callback associated with a lynx resource response. This function
80
- // triggers the callback functionality for the given `lynx_resource_response_t`
81
- // object. It is typically used to notify the caller about the completion of the
82
- // resource fetch operation, allowing the caller to handle the response
83
- // accordingly, such as processing the data, checking the response code, or
84
- // handling errors.
85
- LYNX_CAPI_EXPORT void lynx_resource_response_callback(
86
- lynx_resource_response_t*);
87
-
88
- LYNX_CAPI_EXPORT void lynx_resource_response_release(lynx_resource_response_t*);
89
-
90
- LYNX_EXTERN_C_END
91
-
92
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_RESOURCE_RESPONSE_CAPI_H_
@@ -1,62 +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_CAPI_LYNX_RUNTIME_LIFECYCLE_OBSERVER_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_RUNTIME_LIFECYCLE_OBSERVER_CAPI_H_
6
-
7
- #include "lynx_export.h"
8
- #include "third_party/weak-node-api/headers/node_api.h"
9
- #ifdef USE_WEAK_SUFFIX_NAPI
10
- #include "third_party/weak-node-api/headers/weak_napi_defines.h"
11
- #endif
12
-
13
- LYNX_EXTERN_C_BEGIN
14
-
15
- typedef struct lynx_runtime_lifecycle_observer_t
16
- lynx_runtime_lifecycle_observer_t;
17
-
18
- // Define a function pointer type for the runtime attach callback.
19
- // This callback is invoked when the runtime is attached.
20
- typedef void (*runtime_attach_callback)(lynx_runtime_lifecycle_observer_t*,
21
- napi_env);
22
-
23
- // Define a function pointer type for the runtime detach callback.
24
- // This callback is invoked when the runtime is detached.
25
- typedef void (*runtime_detach_callback)(lynx_runtime_lifecycle_observer_t*);
26
-
27
- // Create a new lynx_runtime_lifecycle_observer_t instance. The instance's
28
- // lifecycle is based on reference count.
29
- LYNX_CAPI_EXPORT lynx_runtime_lifecycle_observer_t*
30
- lynx_runtime_lifecycle_observer_create(void* user_data);
31
-
32
- // Create a new lynx_runtime_lifecycle_observer_t instance with a finalizer.
33
- // The finalizer will be called when the observer is released.
34
- // The instance's lifecycle is based on reference count.
35
- LYNX_CAPI_EXPORT lynx_runtime_lifecycle_observer_t*
36
- lynx_runtime_lifecycle_observer_create_with_finalizer(
37
- void* user_data,
38
- void (*finalizer)(lynx_runtime_lifecycle_observer_t*, void*));
39
-
40
- LYNX_CAPI_EXPORT void* lynx_runtime_lifecycle_observer_get_user_data(
41
- lynx_runtime_lifecycle_observer_t*);
42
-
43
- // Bind an attach callback to a lynx_runtime_lifecycle_observer_t instance.
44
- LYNX_CAPI_EXPORT void lynx_runtime_lifecycle_observer_bind_attach_callback(
45
- lynx_runtime_lifecycle_observer_t*, runtime_attach_callback);
46
-
47
- // Bind a detach callback to a lynx_runtime_lifecycle_observer_t instance.
48
- LYNX_CAPI_EXPORT void lynx_runtime_lifecycle_observer_bind_detach_callback(
49
- lynx_runtime_lifecycle_observer_t*, runtime_detach_callback);
50
-
51
- // Release a lynx_runtime_lifecycle_observer_t instance. The release
52
- // operation is based on the reference count.
53
- LYNX_CAPI_EXPORT void lynx_runtime_lifecycle_observer_release(
54
- lynx_runtime_lifecycle_observer_t*);
55
-
56
- LYNX_EXTERN_C_END
57
-
58
- #ifdef USE_WEAK_SUFFIX_NAPI
59
- #include "third_party/weak-node-api/headers/weak_napi_undefs.h"
60
- #endif
61
-
62
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_RUNTIME_LIFECYCLE_OBSERVER_CAPI_H_
@@ -1,52 +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_CAPI_LYNX_SECURITY_SERVICE_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_SECURITY_SERVICE_CAPI_H_
6
-
7
- #include <stdint.h>
8
- #include <stdlib.h>
9
-
10
- #include "lynx_export.h"
11
-
12
- LYNX_EXTERN_C_BEGIN
13
-
14
- typedef struct lynx_security_service_t lynx_security_service_t;
15
-
16
- typedef enum lynx_tasm_type_e {
17
- kTypeTemplate = 1,
18
- kTypeDynamicComponent,
19
- } lynx_tasm_type_e;
20
-
21
- // Defines a function pointer type for content verification. It can be bound to
22
- // a security service and will be invoked when content verification is required.
23
- typedef int (*lynx_verification_func)(lynx_security_service_t*,
24
- uint8_t* content, size_t length,
25
- const char* url, lynx_tasm_type_e type,
26
- const char** error_msg);
27
- LYNX_CAPI_EXPORT lynx_security_service_t* lynx_security_service_create(
28
- void* user_data);
29
- // Create a new Security service instance with a finalizer.
30
- // The finalizer will be called when the service is released.
31
- // The instance's lifecycle is based on reference count.
32
- LYNX_CAPI_EXPORT lynx_security_service_t*
33
- lynx_security_service_create_with_finalizer(
34
- void* user_data, void (*finalizer)(lynx_security_service_t*, void*));
35
-
36
- // Retrieves the user data associated with the security service.
37
- LYNX_CAPI_EXPORT void* lynx_security_service_get_user_data(
38
- lynx_security_service_t*);
39
-
40
- // Binds a verification function to the security service. This function
41
- // associates a custom verification function with the specified security
42
- // service. The verification function will be used to perform security checks on
43
- // content.
44
- LYNX_CAPI_EXPORT void lynx_security_service_bind(lynx_security_service_t*,
45
- lynx_verification_func f);
46
-
47
- // Releases the resources associated with the security service.
48
- LYNX_CAPI_EXPORT void lynx_security_service_release(lynx_security_service_t*);
49
-
50
- LYNX_EXTERN_C_END
51
-
52
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_SECURITY_SERVICE_CAPI_H_
@@ -1,50 +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_CAPI_LYNX_SERVICE_CENTER_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_SERVICE_CENTER_CAPI_H_
6
-
7
- #include <stdint.h>
8
- #include <stdlib.h>
9
-
10
- #include "lynx_export.h"
11
-
12
- LYNX_EXTERN_C_BEGIN
13
-
14
- typedef struct lynx_service_center_t lynx_service_center_t;
15
-
16
- // Enumeration of service types available in the Lynx service center. And new
17
- // service types can be appended here in the future.
18
- typedef enum lynx_service_type_e {
19
- kServiceTypeHttp = 1,
20
- kServiceTypeSecurity,
21
- kServiceTypeEventReporter,
22
- kServiceTypeTrail,
23
- } lynx_service_type_e;
24
-
25
- // Retrieves the singleton instance of the Lynx service center.
26
- LYNX_CAPI_EXPORT lynx_service_center_t* lynx_service_get_center_instance();
27
-
28
- // Register a service with the Lynx service center. This function allows you to
29
- // register a service of a specific type with the Lynx service center. The
30
- // service center can then manage and provide access to this service as needed.
31
- LYNX_CAPI_EXPORT void lynx_service_register_service(lynx_service_center_t*,
32
- lynx_service_type_e type,
33
- void* service);
34
-
35
- // Unregister a service from the Lynx service center. This function allows you
36
- // to unregister a service of a specific type from the Lynx service center.
37
- LYNX_CAPI_EXPORT void lynx_service_unregister_service(lynx_service_center_t*,
38
- lynx_service_type_e type,
39
- void* service);
40
-
41
- // Retrieves a service from the Lynx service center. This function allows you to
42
- // retrieve a service of a specific type from the Lynx service center. If the
43
- // service of the specified type is registered in the service center, a pointer
44
- // to the service will be returned. Otherwise, it may return NULL.
45
- LYNX_CAPI_EXPORT void* lynx_service_get_service(lynx_service_center_t*,
46
- lynx_service_type_e type);
47
-
48
- LYNX_EXTERN_C_END
49
-
50
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_SERVICE_CENTER_CAPI_H_
@@ -1,39 +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_CAPI_LYNX_TEMPLATE_BUNDLE_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TEMPLATE_BUNDLE_CAPI_H_
6
-
7
- #include <stddef.h>
8
- #include <stdint.h>
9
-
10
- #include "lynx_export.h"
11
-
12
- LYNX_EXTERN_C_BEGIN
13
-
14
- typedef struct lynx_template_bundle_t lynx_template_bundle_t;
15
-
16
- // Create a template bundle from the given content. You can also
17
- // provide a custom destructor function to handle the cleanup of the content
18
- // memory, and pass an opaque pointer for additional context.
19
- LYNX_CAPI_EXPORT lynx_template_bundle_t* lynx_template_bundle_create(
20
- uint8_t* content, size_t length, void (*dtor)(uint8_t*, size_t, void*),
21
- void* opaque);
22
-
23
- // Check if the template bundle is valid. If not, the error message can be
24
- // obtained by calling lynx_template_bundle_get_error_message.
25
- // Return 1 if valid, 0 otherwise.
26
- LYNX_CAPI_EXPORT int lynx_template_bundle_is_valid(lynx_template_bundle_t*);
27
-
28
- // Get the error message if the template bundle is not valid.
29
- LYNX_CAPI_EXPORT const char* lynx_template_bundle_get_error_message(
30
- lynx_template_bundle_t*);
31
-
32
- // Release the template bundle. This will be called automatically if
33
- // lynx_view_load_template is called, otherwise the caller is responsible for
34
- // calling this function to release the bundle.
35
- LYNX_CAPI_EXPORT void lynx_template_bundle_release(lynx_template_bundle_t*);
36
-
37
- LYNX_EXTERN_C_END
38
-
39
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TEMPLATE_BUNDLE_CAPI_H_
@@ -1,33 +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_CAPI_LYNX_TEMPLATE_DATA_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TEMPLATE_DATA_CAPI_H_
6
-
7
- #include "lynx_export.h"
8
-
9
- LYNX_EXTERN_C_BEGIN
10
-
11
- typedef struct lynx_template_data_t lynx_template_data_t;
12
-
13
- // Create a template data from json string.
14
- LYNX_CAPI_EXPORT lynx_template_data_t* lynx_template_data_create_from_json(
15
- const char* json);
16
-
17
- // Mark the name of data processor. The data processor will be called when
18
- // lynx_view_update_data is called.
19
- LYNX_CAPI_EXPORT void lynx_template_data_mark_state(lynx_template_data_t*,
20
- const char* name);
21
-
22
- // Sets the read-only flag for a lynx template data object.
23
- LYNX_CAPI_EXPORT void lynx_template_data_set_read_only(lynx_template_data_t*,
24
- int read_only);
25
-
26
- // Release the template data. This will be called automatically if
27
- // lynx_view_load_template is called, otherwise the caller is responsible for
28
- // calling this function to release the template data.
29
- LYNX_CAPI_EXPORT void lynx_template_data_release(lynx_template_data_t*);
30
-
31
- LYNX_EXTERN_C_END
32
-
33
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TEMPLATE_DATA_CAPI_H_
@@ -1,62 +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_CAPI_LYNX_TRACE_CAPI_H_
6
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TRACE_CAPI_H_
7
-
8
- #include <stdint.h>
9
-
10
- #include "lynx_export.h"
11
-
12
- LYNX_EXTERN_C_BEGIN
13
-
14
- // [Internal] Begins a trace section.
15
- // This function is intended to be used via the LYNX_EXTENSION_TRACE_BEGIN
16
- // macro.
17
- LYNX_CAPI_EXPORT void lynx_trace_section_begin(const char* category,
18
- const char* name);
19
-
20
- // [Internal] Ends a trace section.
21
- // This function is intended to be used via the LYNX_EXTENSION_TRACE_END macro.
22
- LYNX_CAPI_EXPORT void lynx_trace_section_end(const char* category,
23
- const char* name);
24
-
25
- // [Internal] Records an instant event.
26
- // This function is intended to be used via the LYNX_EXTENSION_TRACE_INSTANT
27
- // macro.
28
- LYNX_CAPI_EXPORT void lynx_trace_instant(const char* category,
29
- const char* name);
30
-
31
- // [Internal] Records a counter event.
32
- LYNX_CAPI_EXPORT void lynx_trace_counter(const char* category, const char* name,
33
- uint64_t value, bool incremental);
34
-
35
- LYNX_EXTERN_C_END
36
-
37
- // Begins a trace section via C-API.
38
- // Must be paired with LYNX_CAPI_TRACE_END.
39
- // Example:
40
- // void my_traced_function() {
41
- // LYNX_CAPI_TRACE_BEGIN("MyCategory", "my_traced_function");
42
- // // ... code to be traced ...
43
- // LYNX_CAPI_TRACE_END("MyCategory", "my_traced_function");
44
- // }
45
- #define LYNX_CAPI_TRACE_BEGIN(category, name) \
46
- lynx_trace_section_begin(category, name)
47
-
48
- // Ends a trace section via C-API.
49
- #define LYNX_CAPI_TRACE_END(category, name) \
50
- lynx_trace_section_end(category, name)
51
-
52
- // Records an instant event via C-API.
53
- // Example: LYNX_CAPI_TRACE_INSTANT("MyCategory", "ButtonClicked");
54
- #define LYNX_CAPI_TRACE_INSTANT(category, name) \
55
- lynx_trace_instant(category, name)
56
-
57
- // Records a counter event via C-API.
58
- // Example: LYNX_CAPI_TRACE_COUNTER("MyCategory", "MyCounter", 42, false);
59
- #define LYNX_CAPI_TRACE_COUNTER(category, name, value, incremental) \
60
- lynx_trace_counter(category, name, value, incremental)
61
-
62
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TRACE_CAPI_H_
@@ -1,35 +0,0 @@
1
- // Copyright 2026 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_CAPI_LYNX_TRAIL_SERVICE_CAPI_H_
5
- #define PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TRAIL_SERVICE_CAPI_H_
6
-
7
- #include "lynx_export.h"
8
-
9
- LYNX_EXTERN_C_BEGIN
10
-
11
- typedef struct lynx_trail_service_t lynx_trail_service_t;
12
-
13
- // Returns the string value for `key`. The returned pointer must remain valid
14
- // for this callback invocation, and callers must copy it immediately.
15
- typedef const char* (*lynx_trail_string_value_func)(
16
- lynx_trail_service_t* trail_service, const char* key);
17
-
18
- LYNX_CAPI_EXPORT lynx_trail_service_t* lynx_trail_service_create(
19
- void* user_data);
20
-
21
- LYNX_CAPI_EXPORT lynx_trail_service_t* lynx_trail_service_create_with_finalizer(
22
- void* user_data, void (*finalizer)(lynx_trail_service_t*, void*));
23
-
24
- LYNX_CAPI_EXPORT void* lynx_trail_service_get_user_data(
25
- lynx_trail_service_t* trail_service);
26
-
27
- LYNX_CAPI_EXPORT void lynx_trail_service_bind(
28
- lynx_trail_service_t* trail_service, lynx_trail_string_value_func f);
29
-
30
- LYNX_CAPI_EXPORT void lynx_trail_service_release(
31
- lynx_trail_service_t* trail_service);
32
-
33
- LYNX_EXTERN_C_END
34
-
35
- #endif // PLATFORM_EMBEDDER_PUBLIC_CAPI_LYNX_TRAIL_SERVICE_CAPI_H_