• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// [Start napi_get_property_names_api]
17export const getPropertyNames: (obj: Object) => Array<string> | void; // napi_get_property_names
18// [End napi_get_property_names_api]
19
20// [Start napi_set_property_api]
21export const setProperty: (obj: Object, key: String, value: string) => Object | void; // napi_set_property
22// [End napi_set_property_api]
23
24// [Start napi_get_property_api]
25export const getProperty: (obj: Object, key: string) => string | void; // napi_get_property
26// [End napi_get_property_api]
27
28// [Start napi_has_property_api]
29export const hasProperty: (obj: Object, key: number | string) => boolean | void; // napi_has_property
30// [End napi_has_property_api]
31
32// [Start napi_delete_property_api]
33export const deleteProperty: (obj: Object, key: string) => boolean; // napi_delete_property
34// [End napi_delete_property_api]
35
36// [Start napi_has_own_property_api]
37export const napiHasOwnProperty: (obj: Object, key: string) => boolean | void; // napi_has_own_property
38// [End napi_has_own_property_api]
39
40// [Start napi_set_named_property_api]
41export const napiSetNamedProperty: (key: string) => Object | void; // napi_set_named_property
42// [End napi_set_named_property_api]
43
44// [Start napi_get_named_property_api]
45export const napiGetNamedProperty: (obj: Object,
46  key: string) => boolean | number | string | Object | void; // napi_get_named_property
47// [End napi_get_named_property_api]
48
49// [Start napi_has_named_property_api]
50export const napiHasNamedProperty: (obj: Object, key: string) => boolean | void; // napi_has_named_property
51// [End napi_has_named_property_api]
52
53// [Start napi_define_properties_api]
54export class DefineMethodObj {
55  defineMethodPropertiesExample: Function;
56}
57
58export class DefineStringObj {
59  defineStringPropertiesExample: string;
60}
61
62export class DefineGetterSetterObj {
63  getterCallback: Function;
64  setterCallback: Function;
65}
66
67export const defineMethodProperties: () => DefineMethodObj; // napi_define_properties
68
69export const defineStringProperties: () => DefineStringObj;
70
71export const createStringWithGetterSetter: () => DefineGetterSetterObj;
72// [End napi_define_properties_api]
73
74// [Start napi_get_all_property_names_api]
75export const getAllPropertyNames: (obj: Object) => Array<string> | void; // napi_get_all_property_names
76// [End napi_get_all_property_names_api]