!17 add TagType Register

Merge pull request !17 from 尹耀德/master
This commit is contained in:
wind 2024-03-11 11:07:12 +00:00 committed by Gitee
commit 7ff8a33d4a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -61,6 +61,16 @@ napi_value DeclareTag(napi_env env)
return tag;
}
napi_value DeclareTagType(napi_env env)
{
napi_value tagType = nullptr;
NAPI_CALL(env, napi_create_object(env, &tagType));
AddUint32Property(env, tagType, "BOOL", ASSET_TYPE_BOOL);
AddUint32Property(env, tagType, "NUMBER", ASSET_TYPE_NUMBER);
AddUint32Property(env, tagType, "BYTES", ASSET_TYPE_BYTES);
return tagType;
}
napi_value DeclareErrorCode(napi_env env)
{
napi_value errorCode = nullptr;
@ -313,6 +323,7 @@ napi_value Register(napi_env env, napi_value exports)
// register enumerate
DECLARE_NAPI_PROPERTY("Tag", DeclareTag(env)),
DECLARE_NAPI_PROPERTY("TagType", DeclareTagType(env)),
DECLARE_NAPI_PROPERTY("ErrorCode", DeclareErrorCode(env)),
DECLARE_NAPI_PROPERTY("Accessibility", DeclareAccessibility(env)),
DECLARE_NAPI_PROPERTY("AuthType", DeclareAuthType(env)),