src: move napi_addon_register_func to node_api_types.h

This means that `node.h` can include only this file, instead of
the entirety of `node_api.h`.

Split out from https://github.com/nodejs/node/pull/60496 since
it was rightfully pointed out that the breaking part of the change
should not touch Node-API headers.

PR-URL: https://github.com/nodejs/node/pull/60512
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Anna Henningsen
2025-10-31 14:59:37 +01:00
committed by Node.js GitHub Bot
parent 2595dd52a7
commit 85ee01c838
2 changed files with 4 additions and 4 deletions

View File

@@ -33,10 +33,6 @@ struct uv_loop_s; // Forward declaration.
#define NAPI_NO_RETURN
#endif
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
napi_value exports);
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);
// Used by deprecated registration method napi_module_register.
typedef struct napi_module {
int nm_version;

View File

@@ -3,6 +3,10 @@
#include "js_native_api_types.h"
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
napi_value exports);
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);
typedef struct napi_callback_scope__* napi_callback_scope;
typedef struct napi_async_context__* napi_async_context;
typedef struct napi_async_work__* napi_async_work;