@react-native-ohos/ting 1.2.4-rc.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 (52) hide show
  1. package/LICENSE +20 -0
  2. package/README.OpenSource +11 -0
  3. package/README.md +14 -0
  4. package/harmony/ting/BuildProfile.ets +6 -0
  5. package/harmony/ting/build-profile.json5 +9 -0
  6. package/harmony/ting/hvigorfile.ts +2 -0
  7. package/harmony/ting/index.ets +7 -0
  8. package/harmony/ting/obfuscation-rules.txt +18 -0
  9. package/harmony/ting/oh-package.json5 +12 -0
  10. package/harmony/ting/src/main/cpp/CMakeLists.txt +7 -0
  11. package/harmony/ting/src/main/cpp/Ting.cpp +23 -0
  12. package/harmony/ting/src/main/cpp/Ting.h +18 -0
  13. package/harmony/ting/src/main/cpp/TingPackage.h +32 -0
  14. package/harmony/ting/src/main/ets/Logger.ets +64 -0
  15. package/harmony/ting/src/main/ets/TingPackage.ets +46 -0
  16. package/harmony/ting/src/main/ets/TingTurboModule.ets +514 -0
  17. package/harmony/ting/src/main/ets/Type.ets +133 -0
  18. package/harmony/ting/src/main/ets/generated/components/ts.ts +5 -0
  19. package/harmony/ting/src/main/ets/generated/index.ets +5 -0
  20. package/harmony/ting/src/main/ets/generated/ts.ts +6 -0
  21. package/harmony/ting/src/main/ets/generated/turboModules/Ting.ts +25 -0
  22. package/harmony/ting/src/main/ets/generated/turboModules/ts.ts +5 -0
  23. package/harmony/ting/src/main/module.json5 +7 -0
  24. package/harmony/ting/src/main/resources/base/element/color.json +8 -0
  25. package/harmony/ting/src/main/resources/base/element/string.json +16 -0
  26. package/harmony/ting/src/main/resources/base/profile/backup_config.json +3 -0
  27. package/harmony/ting/src/main/resources/base/profile/main_pages.json +5 -0
  28. package/harmony/ting/src/main/resources/en_US/element/string.json +16 -0
  29. package/harmony/ting/src/main/resources/zh_CN/element/string.json +16 -0
  30. package/harmony/ting.har +0 -0
  31. package/lib/commonjs/NativeTing.js +14 -0
  32. package/lib/commonjs/NativeTing.js.map +1 -0
  33. package/lib/commonjs/Type.js +2 -0
  34. package/lib/commonjs/Type.js.map +1 -0
  35. package/lib/commonjs/index.js +73 -0
  36. package/lib/commonjs/index.js.map +1 -0
  37. package/lib/module/NativeTing.js +9 -0
  38. package/lib/module/NativeTing.js.map +1 -0
  39. package/lib/module/Type.js +2 -0
  40. package/lib/module/Type.js.map +1 -0
  41. package/lib/module/index.js +47 -0
  42. package/lib/module/index.js.map +1 -0
  43. package/lib/typescript/NativeTing.d.ts +10 -0
  44. package/lib/typescript/NativeTing.d.ts.map +1 -0
  45. package/lib/typescript/Type.d.ts +98 -0
  46. package/lib/typescript/Type.d.ts.map +1 -0
  47. package/lib/typescript/index.d.ts +10 -0
  48. package/lib/typescript/index.d.ts.map +1 -0
  49. package/package.json +160 -0
  50. package/src/NativeTing.ts +17 -0
  51. package/src/Type.ts +108 -0
  52. package/src/index.tsx +64 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#FFFFFF"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "module_desc",
5
+ "value": "module description"
6
+ },
7
+ {
8
+ "name": "TingAbility_desc",
9
+ "value": "description"
10
+ },
11
+ {
12
+ "name": "TingAbility_label",
13
+ "value": "label"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "allowToBackupRestore": true
3
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "src": [
3
+ "pages/Index"
4
+ ]
5
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "module_desc",
5
+ "value": "module description"
6
+ },
7
+ {
8
+ "name": "TingAbility_desc",
9
+ "value": "description"
10
+ },
11
+ {
12
+ "name": "TingAbility_label",
13
+ "value": "label"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "module_desc",
5
+ "value": "模块描述"
6
+ },
7
+ {
8
+ "name": "TingAbility_desc",
9
+ "value": "description"
10
+ },
11
+ {
12
+ "name": "TingAbility_label",
13
+ "value": "label"
14
+ }
15
+ ]
16
+ }
Binary file
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ /*
9
+ * Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
10
+ * Use of this source code is governed by a MIT license that can be
11
+ * found in the LICENSE file.
12
+ */
13
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('Ting');
14
+ //# sourceMappingURL=NativeTing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeTing.ts"],"mappings":";;;;;;AAOA,IAAAA,YAAA,GAAAC,OAAA;AAPA;AACA;AACA;AACA;AACA;AAJA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAgBeC,gCAAmB,CAACC,YAAY,CAAO,MAAM,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=Type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["Type.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ toast: true,
8
+ alert: true,
9
+ dismissAlert: true,
10
+ setup: true
11
+ };
12
+ exports.alert = alert;
13
+ exports.dismissAlert = dismissAlert;
14
+ exports.setup = setup;
15
+ exports.toast = toast;
16
+ var _reactNative = require("react-native");
17
+ var _Type = require("./Type");
18
+ Object.keys(_Type).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
+ if (key in exports && exports[key] === _Type[key]) return;
22
+ Object.defineProperty(exports, key, {
23
+ enumerable: true,
24
+ get: function () {
25
+ return _Type[key];
26
+ }
27
+ });
28
+ });
29
+ /*
30
+ * Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
31
+ * Use of this source code is governed by a MIT license that can be
32
+ * found in the LICENSE file.
33
+ */
34
+
35
+ const LINKING_ERROR = `The package 'ting' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
36
+ ios: "- You have run 'pod install'\n",
37
+ default: ''
38
+ }) + '- You rebuilt the app after installing the package\n';
39
+
40
+ // @ts-expect-error
41
+ const isTurboModuleEnabled = global.__turboModuleProxy != null;
42
+ const TingModule = isTurboModuleEnabled ? require('./NativeTing').default : _reactNative.NativeModules.Ting;
43
+ const Ting = TingModule ? TingModule : new Proxy({}, {
44
+ get() {
45
+ throw new Error(LINKING_ERROR);
46
+ }
47
+ });
48
+ const convertIconFile = options => {
49
+ var _options$icon;
50
+ const iconURI = options === null || options === void 0 || (_options$icon = options.icon) === null || _options$icon === void 0 ? void 0 : _options$icon.uri;
51
+ if (options !== null && options !== void 0 && options.icon) {
52
+ if (typeof iconURI === 'number') {
53
+ options.icon.uri = _reactNative.Image.resolveAssetSource(iconURI).uri;
54
+ }
55
+ }
56
+ };
57
+ function toast(options) {
58
+ convertIconFile(options);
59
+ Ting.toast(options);
60
+ }
61
+ function alert(options) {
62
+ convertIconFile(options);
63
+ Ting.alert(options);
64
+ }
65
+ function dismissAlert() {
66
+ Ting.dismissAlert();
67
+ }
68
+ function setup(options) {
69
+ convertIconFile(options === null || options === void 0 ? void 0 : options.alert);
70
+ convertIconFile(options === null || options === void 0 ? void 0 : options.toast);
71
+ return Ting.setup(options);
72
+ }
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_Type","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","LINKING_ERROR","Platform","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","TingModule","NativeModules","Ting","Proxy","Error","convertIconFile","options","_options$icon","iconURI","icon","uri","Image","resolveAssetSource","toast","alert","dismissAlert","setup"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,KAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,KAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AARA;AACA;AACA;AACA;AACA;;AAMA,MAAMS,aAAa,GACjB,+DAA+D,GAC/DC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD;;AAExD;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,UAAU,GAAGH,oBAAoB,GACnCnB,OAAO,CAAC,cAAc,CAAC,CAACkB,OAAO,GAC/BK,0BAAa,CAACC,IAAI;AAEtB,MAAMA,IAAI,GAAGF,UAAU,GACnBA,UAAU,GACV,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEZ,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIa,KAAK,CAACZ,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMa,eAAe,GAAIC,OAAoC,IAAW;EAAA,IAAAC,aAAA;EACtE,MAAMC,OAAO,GAAGF,OAAO,aAAPA,OAAO,gBAAAC,aAAA,GAAPD,OAAO,CAAEG,IAAI,cAAAF,aAAA,uBAAbA,aAAA,CAAeG,GAAG;EAClC,IAAIJ,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEG,IAAI,EAAE;IACjB,IAAI,OAAOD,OAAO,KAAK,QAAQ,EAAE;MAC/BF,OAAO,CAACG,IAAI,CAACC,GAAG,GAAGC,kBAAK,CAACC,kBAAkB,CAACJ,OAAO,CAAC,CAACE,GAAG;IAC1D;EACF;AACF,CAAC;AAEM,SAASG,KAAKA,CAACP,OAAqB,EAAQ;EACjDD,eAAe,CAACC,OAAO,CAAC;EACxBJ,IAAI,CAACW,KAAK,CAACP,OAAO,CAAC;AACrB;AAEO,SAASQ,KAAKA,CAACR,OAAqB,EAAQ;EACjDD,eAAe,CAACC,OAAO,CAAC;EACxBJ,IAAI,CAACY,KAAK,CAACR,OAAO,CAAC;AACrB;AAEO,SAASS,YAAYA,CAAA,EAAS;EACnCb,IAAI,CAACa,YAAY,CAAC,CAAC;AACrB;AAEO,SAASC,KAAKA,CAACV,OAGrB,EAAQ;EACPD,eAAe,CAACC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEQ,KAAqB,CAAC;EAC/CT,eAAe,CAACC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,KAAqB,CAAC;EAC/C,OAAOX,IAAI,CAACc,KAAK,CAACV,OAAO,CAAC;AAC5B","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ import { TurboModuleRegistry } from 'react-native';
8
+ export default TurboModuleRegistry.getEnforcing('Ting');
9
+ //# sourceMappingURL=NativeTing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeTing.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAGA,SAASA,mBAAmB,QAAQ,cAAc;AASlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,MAAM,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=Type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["Type.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ import { NativeModules, Platform, Image } from 'react-native';
8
+ export * from './Type';
9
+ const LINKING_ERROR = `The package 'ting' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
10
+ ios: "- You have run 'pod install'\n",
11
+ default: ''
12
+ }) + '- You rebuilt the app after installing the package\n';
13
+
14
+ // @ts-expect-error
15
+ const isTurboModuleEnabled = global.__turboModuleProxy != null;
16
+ const TingModule = isTurboModuleEnabled ? require('./NativeTing').default : NativeModules.Ting;
17
+ const Ting = TingModule ? TingModule : new Proxy({}, {
18
+ get() {
19
+ throw new Error(LINKING_ERROR);
20
+ }
21
+ });
22
+ const convertIconFile = options => {
23
+ var _options$icon;
24
+ const iconURI = options === null || options === void 0 || (_options$icon = options.icon) === null || _options$icon === void 0 ? void 0 : _options$icon.uri;
25
+ if (options !== null && options !== void 0 && options.icon) {
26
+ if (typeof iconURI === 'number') {
27
+ options.icon.uri = Image.resolveAssetSource(iconURI).uri;
28
+ }
29
+ }
30
+ };
31
+ export function toast(options) {
32
+ convertIconFile(options);
33
+ Ting.toast(options);
34
+ }
35
+ export function alert(options) {
36
+ convertIconFile(options);
37
+ Ting.alert(options);
38
+ }
39
+ export function dismissAlert() {
40
+ Ting.dismissAlert();
41
+ }
42
+ export function setup(options) {
43
+ convertIconFile(options === null || options === void 0 ? void 0 : options.alert);
44
+ convertIconFile(options === null || options === void 0 ? void 0 : options.toast);
45
+ return Ting.setup(options);
46
+ }
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","Image","LINKING_ERROR","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","TingModule","require","Ting","Proxy","get","Error","convertIconFile","options","_options$icon","iconURI","icon","uri","resolveAssetSource","toast","alert","dismissAlert","setup"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,cAAc;AAE7D,cAAc,QAAQ;AAEtB,MAAMC,aAAa,GACjB,+DAA+D,GAC/DF,QAAQ,CAACG,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD;;AAExD;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,UAAU,GAAGH,oBAAoB,GACnCI,OAAO,CAAC,cAAc,CAAC,CAACL,OAAO,GAC/BN,aAAa,CAACY,IAAI;AAEtB,MAAMA,IAAI,GAAGF,UAAU,GACnBA,UAAU,GACV,IAAIG,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACZ,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMa,eAAe,GAAIC,OAAoC,IAAW;EAAA,IAAAC,aAAA;EACtE,MAAMC,OAAO,GAAGF,OAAO,aAAPA,OAAO,gBAAAC,aAAA,GAAPD,OAAO,CAAEG,IAAI,cAAAF,aAAA,uBAAbA,aAAA,CAAeG,GAAG;EAClC,IAAIJ,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEG,IAAI,EAAE;IACjB,IAAI,OAAOD,OAAO,KAAK,QAAQ,EAAE;MAC/BF,OAAO,CAACG,IAAI,CAACC,GAAG,GAAGnB,KAAK,CAACoB,kBAAkB,CAACH,OAAO,CAAC,CAACE,GAAG;IAC1D;EACF;AACF,CAAC;AAED,OAAO,SAASE,KAAKA,CAACN,OAAqB,EAAQ;EACjDD,eAAe,CAACC,OAAO,CAAC;EACxBL,IAAI,CAACW,KAAK,CAACN,OAAO,CAAC;AACrB;AAEA,OAAO,SAASO,KAAKA,CAACP,OAAqB,EAAQ;EACjDD,eAAe,CAACC,OAAO,CAAC;EACxBL,IAAI,CAACY,KAAK,CAACP,OAAO,CAAC;AACrB;AAEA,OAAO,SAASQ,YAAYA,CAAA,EAAS;EACnCb,IAAI,CAACa,YAAY,CAAC,CAAC;AACrB;AAEA,OAAO,SAASC,KAAKA,CAACT,OAGrB,EAAQ;EACPD,eAAe,CAACC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,KAAqB,CAAC;EAC/CR,eAAe,CAACC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,KAAqB,CAAC;EAC/C,OAAOX,IAAI,CAACc,KAAK,CAACT,OAAO,CAAC;AAC5B","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ toast(options: Object): void;
4
+ alert(options: Object): void;
5
+ dismissAlert(): void;
6
+ setup(options: Object): void;
7
+ }
8
+ declare const _default: Spec;
9
+ export default _default;
10
+ //# sourceMappingURL=NativeTing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeTing.d.ts","sourceRoot":"","sources":["../../src/NativeTing.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,IAAI,IAAI,CAAC;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;;AAED,wBAA8D"}
@@ -0,0 +1,98 @@
1
+ export interface Icon {
2
+ size?: number;
3
+ uri?: string | number;
4
+ tintColor?: string;
5
+ }
6
+ export interface ToastOptions {
7
+ title?: string;
8
+ message?: string;
9
+ titleColor?: string;
10
+ messageColor?: string;
11
+ /**
12
+ * Defaults to `done`.
13
+ */
14
+ preset?: 'done' | 'error' | 'none' | 'spinner';
15
+ /**
16
+ * Duration in seconds.
17
+ */
18
+ duration?: number;
19
+ haptic?: 'success' | 'warning' | 'error' | 'none';
20
+ /**
21
+ * Defaults to `true`.
22
+ */
23
+ shouldDismissByDrag?: boolean;
24
+ /**
25
+ * Change the presentation side.
26
+ * Defaults to `top`.
27
+ */
28
+ position?: 'top' | 'bottom';
29
+ /**
30
+ * backgroundColor for toastView
31
+ * Defaults to `null`.
32
+ */
33
+ backgroundColor?: string;
34
+ /**
35
+ * custom icon
36
+ * Defaults to `null`.
37
+ */
38
+ icon?: Icon;
39
+ /**
40
+ * progress color for spinner preset
41
+ * @platform android
42
+ */
43
+ progressColor?: string;
44
+ }
45
+ export interface AlertOptions {
46
+ title?: string;
47
+ message?: string;
48
+ titleColor?: string;
49
+ messageColor?: string;
50
+ /**
51
+ * Defaults to `done`.
52
+ */
53
+ preset?: 'done' | 'error' | 'none' | 'spinner';
54
+ /**
55
+ * Duration in seconds.
56
+ * Defaults to 3.
57
+ */
58
+ duration?: number;
59
+ /**
60
+ * @platform ios
61
+ */
62
+ haptic?: 'success' | 'warning' | 'error' | 'none';
63
+ /**
64
+ * Defaults to `true`.
65
+ */
66
+ shouldDismissByTap?: boolean;
67
+ /**
68
+ * backgroundColor for alertView
69
+ * Defaults to `null`.
70
+ */
71
+ backgroundColor?: string;
72
+ /**
73
+ * borderRadius for alertView
74
+ * Defaults to `24`.
75
+ */
76
+ borderRadius?: number;
77
+ /**
78
+ * blur for backdrop
79
+ * @platform android
80
+ */
81
+ blurBackdrop?: number;
82
+ /**
83
+ * @platform android
84
+ * 0 -> 1
85
+ * Defaults to 0.
86
+ */
87
+ backdropOpacity?: number;
88
+ /**
89
+ * custom icon
90
+ */
91
+ icon?: Icon;
92
+ /**
93
+ * progress color for spinner preset
94
+ * @platform android
95
+ */
96
+ progressColor?: string;
97
+ }
98
+ //# sourceMappingURL=Type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Type.d.ts","sourceRoot":"","sources":["../../src/Type.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAClD;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAClD;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,10 @@
1
+ import type { AlertOptions, ToastOptions } from './Type';
2
+ export * from './Type';
3
+ export declare function toast(options: ToastOptions): void;
4
+ export declare function alert(options: AlertOptions): void;
5
+ export declare function dismissAlert(): void;
6
+ export declare function setup(options: {
7
+ alert?: AlertOptions;
8
+ toast?: ToastOptions;
9
+ }): void;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACzD,cAAc,QAAQ,CAAC;AAkCvB,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAGjD;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAGjD;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE;IAC7B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,GAAG,IAAI,CAIP"}
package/package.json ADDED
@@ -0,0 +1,160 @@
1
+ {
2
+ "name": "@react-native-ohos/ting",
3
+ "version": "1.2.4-rc.1",
4
+ "description": "test",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "harmony",
12
+ "src",
13
+ "lib",
14
+ "cpp",
15
+ "*.podspec",
16
+ "!lib/typescript/example",
17
+ "!**/__tests__",
18
+ "!**/__fixtures__",
19
+ "!**/__mocks__",
20
+ "!**/.*"
21
+ ],
22
+ "scripts": {
23
+ "test": "jest",
24
+ "typecheck": "tsc --noEmit",
25
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
26
+ "prepack": "bob build",
27
+ "release": "release-it",
28
+ "example": "yarn --cwd example",
29
+ "bootstrap": "yarn example && yarn install && yarn example pod",
30
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
31
+ },
32
+ "keywords": [
33
+ "react-native",
34
+ "ios",
35
+ "android"
36
+ ],
37
+ "repository": "https://github.com/react-native-oh-library/ting",
38
+ "license": "MIT",
39
+ "bugs": {
40
+ "url": "https://github.com/react-native-oh-library/ting/issues"
41
+ },
42
+ "homepage": "https://github.com/react-native-oh-library/ting#readme",
43
+ "publishConfig": {
44
+ "registry": "https://registry.npmjs.org/"
45
+ },
46
+ "devDependencies": {
47
+ "@evilmartians/lefthook": "^1.2.2",
48
+ "@commitlint/config-conventional": "^17.0.2",
49
+ "@evilmartians/lefthook": "^1.5.0",
50
+ "@react-native/eslint-config": "^0.73.1",
51
+ "@release-it/conventional-changelog": "^5.0.0",
52
+ "@types/jest": "^29.5.5",
53
+ "@types/react": "^18.2.44",
54
+ "@types/react-native": "0.70.0",
55
+ "commitlint": "^17.0.2",
56
+ "del-cli": "^5.1.0",
57
+ "eslint": "^8.51.0",
58
+ "eslint-config-prettier": "^9.0.0",
59
+ "eslint-plugin-prettier": "^5.0.1",
60
+ "jest": "^29.7.0",
61
+ "pod-install": "^0.1.0",
62
+ "prettier": "^3.0.3",
63
+ "react": "18.3.1",
64
+ "react-native": "0.77.1",
65
+ "react-native-builder-bob": "^0.20.0",
66
+ "release-it": "^15.0.0",
67
+ "turbo": "^1.10.7",
68
+ "typescript": "^5.2.2"
69
+ },
70
+ "dependencies": {
71
+ "@baronha/ting": "^1.2.3"
72
+ },
73
+ "resolutions": {
74
+ "@types/react": "17.0.21"
75
+ },
76
+ "peerDependencies": {
77
+ "react": "*",
78
+ "react-native": "*"
79
+ },
80
+ "packageManager": "yarn@3.6.1",
81
+ "engines": {
82
+ "node": ">= 16.0.0"
83
+ },
84
+ "jest": {
85
+ "preset": "react-native",
86
+ "modulePathIgnorePatterns": [
87
+ "<rootDir>/example/node_modules",
88
+ "<rootDir>/lib/"
89
+ ]
90
+ },
91
+ "commitlint": {
92
+ "extends": [
93
+ "@commitlint/config-conventional"
94
+ ]
95
+ },
96
+ "release-it": {
97
+ "git": {
98
+ "commitMessage": "chore: release ${version}",
99
+ "tagName": "v${version}"
100
+ },
101
+ "npm": {
102
+ "publish": true
103
+ },
104
+ "github": {
105
+ "release": true
106
+ },
107
+ "plugins": {
108
+ "@release-it/conventional-changelog": {
109
+ "preset": "angular"
110
+ }
111
+ }
112
+ },
113
+ "eslintConfig": {
114
+ "root": true,
115
+ "extends": [
116
+ "@react-native",
117
+ "prettier"
118
+ ],
119
+ "rules": {
120
+ "prettier/prettier": [
121
+ "error",
122
+ {
123
+ "quoteProps": "consistent",
124
+ "singleQuote": true,
125
+ "tabWidth": 2,
126
+ "trailingComma": "es5",
127
+ "useTabs": false
128
+ }
129
+ ]
130
+ }
131
+ },
132
+ "eslintIgnore": [
133
+ "node_modules/",
134
+ "lib/"
135
+ ],
136
+ "prettier": {
137
+ "quoteProps": "consistent",
138
+ "singleQuote": true,
139
+ "tabWidth": 2,
140
+ "trailingComma": "es5",
141
+ "useTabs": false
142
+ },
143
+ "react-native-builder-bob": {
144
+ "source": "src",
145
+ "output": "lib",
146
+ "targets": [
147
+ "commonjs",
148
+ "module",
149
+ [
150
+ "typescript",
151
+ {
152
+ "project": "tsconfig.build.json"
153
+ }
154
+ ]
155
+ ]
156
+ },
157
+ "harmony": {
158
+ "alias": "@baronha/ting"
159
+ }
160
+ }
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ import type { TurboModule } from 'react-native';
8
+ import { TurboModuleRegistry } from 'react-native';
9
+
10
+ export interface Spec extends TurboModule {
11
+ toast(options: Object): void;
12
+ alert(options: Object): void;
13
+ dismissAlert(): void;
14
+ setup(options: Object): void;
15
+ }
16
+
17
+ export default TurboModuleRegistry.getEnforcing<Spec>('Ting');