react-native-legal 1.3.0 → 1.4.0

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 (46) hide show
  1. package/README.md +7 -7
  2. package/android/src/main/java/com/reactnativelegal/ReactNativeLegalModuleImpl.kt +42 -0
  3. package/android/src/newarch/java/com/reactnativelegal/ReactNativeLegalModule.kt +9 -0
  4. package/android/src/oldarch/java/com/reactnativelegal/ReactNativeLegalModule.kt +9 -0
  5. package/bare-plugin/build/android/androidCommand.js +3 -3
  6. package/bare-plugin/build/ios/iosCommand.js +3 -3
  7. package/bare-plugin/src/android/androidCommand.ts +1 -1
  8. package/bare-plugin/src/ios/iosCommand.ts +1 -1
  9. package/ios/ReactNativeLegalModule.mm +9 -0
  10. package/ios/ReactNativeLegalModuleImpl.swift +26 -0
  11. package/lib/commonjs/NativeReactNativeLegal.js.map +1 -1
  12. package/lib/commonjs/ReactNativeLegal.android.js +3 -0
  13. package/lib/commonjs/ReactNativeLegal.android.js.map +1 -1
  14. package/lib/commonjs/ReactNativeLegal.ios.js +3 -0
  15. package/lib/commonjs/ReactNativeLegal.ios.js.map +1 -1
  16. package/lib/commonjs/ReactNativeLegal.js +5 -0
  17. package/lib/commonjs/ReactNativeLegal.js.map +1 -1
  18. package/lib/module/NativeReactNativeLegal.js.map +1 -1
  19. package/lib/module/ReactNativeLegal.android.js +3 -0
  20. package/lib/module/ReactNativeLegal.android.js.map +1 -1
  21. package/lib/module/ReactNativeLegal.ios.js +3 -0
  22. package/lib/module/ReactNativeLegal.ios.js.map +1 -1
  23. package/lib/module/ReactNativeLegal.js +5 -0
  24. package/lib/module/ReactNativeLegal.js.map +1 -1
  25. package/lib/typescript/NativeReactNativeLegal.d.ts +40 -0
  26. package/lib/typescript/NativeReactNativeLegal.d.ts.map +1 -1
  27. package/lib/typescript/ReactNativeLegal.android.d.ts +1 -0
  28. package/lib/typescript/ReactNativeLegal.android.d.ts.map +1 -1
  29. package/lib/typescript/ReactNativeLegal.d.ts +2 -0
  30. package/lib/typescript/ReactNativeLegal.d.ts.map +1 -1
  31. package/lib/typescript/ReactNativeLegal.ios.d.ts +1 -0
  32. package/lib/typescript/ReactNativeLegal.ios.d.ts.map +1 -1
  33. package/lib/typescript/index.d.ts +1 -0
  34. package/lib/typescript/index.d.ts.map +1 -1
  35. package/package.json +2 -2
  36. package/plugin/build/android/withAndroidLegal.js +3 -3
  37. package/plugin/build/ios/withIosLegal.js +3 -3
  38. package/plugin/src/android/withAndroidLegal.ts +1 -1
  39. package/plugin/src/ios/withIosLegal.ts +1 -1
  40. package/plugin-utils/build/android.js +2 -2
  41. package/plugin-utils/src/android.ts +1 -1
  42. package/src/NativeReactNativeLegal.ts +43 -0
  43. package/src/ReactNativeLegal.android.ts +3 -0
  44. package/src/ReactNativeLegal.ios.ts +3 -0
  45. package/src/ReactNativeLegal.ts +5 -0
  46. package/src/index.ts +1 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-legal" align="center">
2
2
  <picture>
3
- <img alt="React Native Legal" src="./images/banner.jpg">
3
+ <img alt="React Native Legal" src="https://github.com/callstackincubator/react-native-legal/raw/refs/heads/main/images/rn-legal-banner.jpg">
4
4
  </picture>
5
5
  </a>
6
6
 
@@ -13,7 +13,7 @@
13
13
  ![Release](https://github.com/callstackincubator/react-native-legal/actions/workflows/release.yml/badge.svg)
14
14
  ![Deploy Docs](https://github.com/callstackincubator/react-native-legal/actions/workflows/deploy-docs.yml/badge.svg)
15
15
  ![Integration tests - License Kit (Node)](https://github.com/callstackincubator/react-native-legal/actions/workflows/test-integration-node.yml/badge.svg)
16
- ![Unit tests - React Native Legal Shared](https://github.com/callstackincubator/react-native-legal/actions/workflows/test-unit-shared.yml/badge.svg)
16
+ ![Unit tests - @callstack/licenses](https://github.com/callstackincubator/react-native-legal/actions/workflows/test-unit-licenses-api.yml/badge.svg)
17
17
  ![E2E tests - Android](https://github.com/callstackincubator/react-native-legal/actions/workflows/test-e2e-android.yaml/badge.svg)
18
18
  ![E2E tests - iOS](https://github.com/callstackincubator/react-native-legal/actions/workflows/test-e2e-ios.yaml/badge.svg)
19
19
 
@@ -71,13 +71,13 @@ npm i --save-dev license-kit
71
71
  ### Node.js - API
72
72
 
73
73
  ```sh
74
- yarn add -D @callstack/react-native-legal-shared
74
+ yarn add -D @callstack/licenses
75
75
  ```
76
76
 
77
77
  or
78
78
 
79
79
  ```sh
80
- npm i --save-dev @callstack/react-native-legal-shared
80
+ npm i --save-dev @callstack/licenses
81
81
  ```
82
82
 
83
83
  ## Usage
@@ -86,8 +86,8 @@ This tool is split into 4 parts:
86
86
 
87
87
  - a React Native library that lets you display native screen with a list of all dependencies and their licenses
88
88
  - an [Expo config plugin](https://docs.expo.dev/config-plugins/introduction/?redirected) (for Expo projects) and a [custom community cli plugin](https://github.com/react-native-community/cli/blob/main/docs/plugins.md) (for bare RN projects)
89
- - a standalone CLI tool that can be used in any Node.js project to generate license metadata
90
- - a shared package that exposes the core functionality of the license management tool, allowing customization of presentation logic in your Node.js scripts
89
+ - a standalone CLI tool that can be used in any Node.js project to generate license metadata (`license-kit`)
90
+ - a shared package that exposes the core functionality of the license management tool, allowing customization of presentation logic in your Node.js scripts (`@callstack/licenses`)
91
91
 
92
92
  ### I want to generate licenses in my Expo project <a name="usage-expo"></a>
93
93
 
@@ -181,7 +181,7 @@ For a list of supported flags and the default values, run `npx license-kit --hel
181
181
 
182
182
  ### I want to customize the presentation of the licenses in my JS/TS project
183
183
 
184
- You can use the `@callstack/react-native-legal-shared` package to access the core functionalities of the license management tool. To do so, please read the [programmatic usage documentation](https://callstackincubator.github.io/react-native-legal/docs/programmatic-usage#usage).
184
+ You can use the `@callstack/licenses` package to access the core functionalities of the license management tool. To do so, please read the [programmatic usage documentation](https://callstackincubator.github.io/react-native-legal/docs/programmatic-usage#usage).
185
185
 
186
186
  ## Expo
187
187
 
@@ -1,12 +1,20 @@
1
1
  package com.reactnativelegal
2
2
 
3
3
  import android.content.Intent
4
+ import android.os.Bundle
5
+ import androidx.core.os.bundleOf
6
+ import com.facebook.react.bridge.Arguments
4
7
  import com.facebook.react.bridge.ReactApplicationContext
8
+ import com.facebook.react.bridge.WritableMap
9
+ import com.mikepenz.aboutlibraries.Libs
5
10
  import com.mikepenz.aboutlibraries.LibsBuilder
11
+ import com.mikepenz.aboutlibraries.util.withContext
6
12
 
7
13
  object ReactNativeLegalModuleImpl {
8
14
  const val NAME = "ReactNativeLegalModule"
9
15
 
16
+ private var cachedData: List<Bundle>? = null
17
+
10
18
  fun launchLicenseListScreen(reactContext: ReactApplicationContext, licenseHeaderText: String) {
11
19
  val context = reactContext.currentActivity ?: return
12
20
  val intent =
@@ -17,4 +25,38 @@ object ReactNativeLegalModuleImpl {
17
25
 
18
26
  context.startActivity(intent)
19
27
  }
28
+
29
+ fun getLibraries(reactContext: ReactApplicationContext): WritableMap {
30
+ if (cachedData == null) {
31
+ cachedData = retrieveLibrariesArray(reactContext)
32
+ }
33
+
34
+ return Arguments.createMap().apply { putArray("data", Arguments.fromList(cachedData)) }
35
+ }
36
+
37
+ private fun retrieveLibrariesArray(reactContext: ReactApplicationContext): List<Bundle>? {
38
+ val context = reactContext.currentActivity ?: return null
39
+
40
+ val libraries = Libs.Builder().withContext(context).build().libraries
41
+
42
+ return libraries.map { library ->
43
+ bundleOf(
44
+ "id" to library.uniqueId,
45
+ "name" to library.name,
46
+ "description" to library.description,
47
+ "website" to library.website,
48
+ "developers" to library.developers.joinToString(),
49
+ "organization" to library.organization?.name,
50
+ "licenses" to
51
+ library.licenses.map { license ->
52
+ bundleOf(
53
+ "name" to license.name,
54
+ "url" to license.url,
55
+ "year" to license.year,
56
+ "licenseContent" to (license.licenseContent ?: ""),
57
+ )
58
+ },
59
+ )
60
+ }
61
+ }
20
62
  }
@@ -1,5 +1,6 @@
1
1
  package com.reactnativelegal
2
2
 
3
+ import com.facebook.react.bridge.Promise
3
4
  import com.facebook.react.bridge.ReactApplicationContext
4
5
  import com.facebook.react.module.annotations.ReactModule
5
6
 
@@ -13,6 +14,14 @@ class ReactNativeLegalModule(reactContext: ReactApplicationContext) :
13
14
  )
14
15
  }
15
16
 
17
+ override fun getLibrariesAsync(promise: Promise?) {
18
+ try {
19
+ promise?.resolve(ReactNativeLegalModuleImpl.getLibraries(reactApplicationContext))
20
+ } catch (e: Exception) {
21
+ promise?.reject(e)
22
+ }
23
+ }
24
+
16
25
  companion object {
17
26
  const val NAME = ReactNativeLegalModuleImpl.NAME
18
27
  }
@@ -18,6 +18,15 @@ class ReactNativeLegalModule(private val reactContext: ReactApplicationContext)
18
18
  )
19
19
  }
20
20
 
21
+ @ReactMethod
22
+ fun getLibrariesAsync(promise: Promise?) {
23
+ try {
24
+ promise?.resolve(ReactNativeLegalModuleImpl.getLibraries(reactApplicationContext))
25
+ } catch (e: Exception) {
26
+ promise?.reject(e)
27
+ }
28
+ }
29
+
21
30
  companion object {
22
31
  const val NAME = ReactNativeLegalModuleImpl.NAME
23
32
  }
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.androidCommand = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const react_native_legal_shared_1 = require("@callstack/react-native-legal-shared");
8
+ const licenses_1 = require("@callstack/licenses");
9
9
  const addListActivity_1 = require("./addListActivity");
10
10
  const applyAndConfigureAboutLibrariesPlugin_1 = require("./applyAndConfigureAboutLibrariesPlugin");
11
11
  const declareAboutLibrariesPlugin_1 = require("./declareAboutLibrariesPlugin");
@@ -16,8 +16,8 @@ const declareAboutLibrariesPlugin_1 = require("./declareAboutLibrariesPlugin");
16
16
  * installs & configures AboutLibraries Gradle plugin and adds Android Activity with a list of dependencies and their licenses
17
17
  */
18
18
  function androidCommand(androidProjectPath) {
19
- const licenses = (0, react_native_legal_shared_1.scanDependencies)(path_1.default.join(path_1.default.resolve(androidProjectPath, '..'), 'package.json'));
20
- (0, react_native_legal_shared_1.writeAboutLibrariesNPMOutput)(licenses, androidProjectPath);
19
+ const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(path_1.default.resolve(androidProjectPath, '..'), 'package.json'));
20
+ (0, licenses_1.writeAboutLibrariesNPMOutput)(licenses, androidProjectPath);
21
21
  (0, declareAboutLibrariesPlugin_1.declareAboutLibrariesPlugin)(androidProjectPath);
22
22
  (0, applyAndConfigureAboutLibrariesPlugin_1.applyAndConfigureAboutLibrariesPlugin)(androidProjectPath);
23
23
  (0, addListActivity_1.addListActivity)(androidProjectPath);
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.iosCommand = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const react_native_legal_shared_1 = require("@callstack/react-native-legal-shared");
8
+ const licenses_1 = require("@callstack/licenses");
9
9
  const addSettingsBundle_1 = require("./addSettingsBundle");
10
10
  const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPhase");
11
11
  /**
@@ -15,8 +15,8 @@ const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPha
15
15
  * configures Settings.bundle and registers a shell script generating LicensePlist metadata for iOS dependencies
16
16
  */
17
17
  function iosCommand(iosProjectPath) {
18
- const licenses = (0, react_native_legal_shared_1.scanDependencies)(path_1.default.join(path_1.default.resolve(iosProjectPath, '..'), 'package.json'));
19
- (0, react_native_legal_shared_1.writeLicensePlistNPMOutput)(licenses, iosProjectPath);
18
+ const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(path_1.default.resolve(iosProjectPath, '..'), 'package.json'));
19
+ (0, licenses_1.writeLicensePlistNPMOutput)(licenses, iosProjectPath);
20
20
  (0, addSettingsBundle_1.addSettingsBundle)(iosProjectPath);
21
21
  (0, registerLicensePlistBuildPhase_1.registerLicensePlistBuildPhase)(iosProjectPath);
22
22
  }
@@ -1,6 +1,6 @@
1
1
  import path from 'path';
2
2
 
3
- import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/react-native-legal-shared';
3
+ import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/licenses';
4
4
 
5
5
  import { addListActivity } from './addListActivity';
6
6
  import { applyAndConfigureAboutLibrariesPlugin } from './applyAndConfigureAboutLibrariesPlugin';
@@ -1,6 +1,6 @@
1
1
  import path from 'path';
2
2
 
3
- import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/react-native-legal-shared';
3
+ import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/licenses';
4
4
 
5
5
  import { addSettingsBundle } from './addSettingsBundle';
6
6
  import { registerLicensePlistBuildPhase } from './registerLicensePlistBuildPhase';
@@ -22,6 +22,15 @@ RCT_EXPORT_METHOD(launchLicenseListScreen : (NSString *)licenseHeaderText)
22
22
  [ReactNativeLegalModuleImpl launchLicenseListScreenWithLicenseHeaderText:licenseHeaderText];
23
23
  }
24
24
 
25
+ RCT_EXPORT_METHOD(getLibrariesAsync : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject)
26
+ {
27
+ @try {
28
+ resolve([ReactNativeLegalModuleImpl getLibraries]);
29
+ } @catch (NSException *err) {
30
+ reject(err.name, err.reason, nil);
31
+ }
32
+ }
33
+
25
34
  #if RCT_NEW_ARCH_ENABLED
26
35
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
27
36
  (const facebook::react::ObjCTurboModule::InitParams &)params
@@ -31,6 +31,32 @@ public class ReactNativeLegalModuleImpl: NSObject {
31
31
  }
32
32
  }
33
33
 
34
+ @objc public static func getLibraries() -> [String: Any] {
35
+ guard
36
+ let settingsBundleUrl = Bundle.main.url(forResource: "Settings", withExtension: "bundle"),
37
+ let settingsBundle = Bundle(url: settingsBundleUrl),
38
+ let licensePlistUrl = settingsBundle.url(
39
+ forResource: "com.mono0926.LicensePlist", withExtension: "plist"),
40
+ let dictArray = parsePlistToDictArray(fileUrl: licensePlistUrl)
41
+ else {
42
+ return [:]
43
+ }
44
+
45
+ let libraries = parseRawLicenseMetadataToArray(
46
+ rawLicenses: getChildPaneSpecifiers(dictArray: dictArray),
47
+ licensePlistUrl: licensePlistUrl
48
+ )
49
+
50
+ return [
51
+ "data": libraries.map({ library in
52
+ [
53
+ "id": "library-\(library.name ?? "")", "name": library.name ?? "",
54
+ "licenses": [["licenseContent": library.content ?? ""]],
55
+ ]
56
+ })
57
+ ]
58
+ }
59
+
34
60
  private static func getChildPaneSpecifiers(dictArray: [[String: Any]]) -> [[String: Any]] {
35
61
  return
36
62
  dictArray
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_default","TurboModuleRegistry","getEnforcing","exports","default"],"sourceRoot":"../../src","sources":["NativeReactNativeLegal.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAMpCC,gCAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
1
+ {"version":3,"names":["_reactNative","require","_default","TurboModuleRegistry","getEnforcing","exports","default"],"sourceRoot":"../../src","sources":["NativeReactNativeLegal.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAiDpCC,gCAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA"}
@@ -7,6 +7,9 @@ exports.ReactNativeLegal = void 0;
7
7
  var _NativeReactNativeLegal = _interopRequireDefault(require("./NativeReactNativeLegal"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
9
  const ReactNativeLegal = {
10
+ getLibrariesAsync: () => {
11
+ return _NativeReactNativeLegal.default.getLibrariesAsync();
12
+ },
10
13
  launchLicenseListScreen: licenseHeaderText => {
11
14
  /**
12
15
  * On Android, the licenses list is displayed as a custom activity
@@ -1 +1 @@
1
- {"version":3,"names":["_NativeReactNativeLegal","_interopRequireDefault","require","obj","__esModule","default","ReactNativeLegal","launchLicenseListScreen","licenseHeaderText","NativeReactNativeLegal","exports"],"sourceRoot":"../../src","sources":["ReactNativeLegal.android.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvD,MAAMG,gBAAgB,GAAG;EAC9BC,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIC,+BAAsB,CAACF,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC;AAACE,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_NativeReactNativeLegal","_interopRequireDefault","require","obj","__esModule","default","ReactNativeLegal","getLibrariesAsync","NativeReactNativeLegal","launchLicenseListScreen","licenseHeaderText","exports"],"sourceRoot":"../../src","sources":["ReactNativeLegal.android.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvD,MAAMG,gBAAgB,GAAG;EAC9BC,iBAAiB,EAAEA,CAAA,KAAM;IACvB,OAAOC,+BAAsB,CAACD,iBAAiB,CAAC,CAAC;EACnD,CAAC;EACDE,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIF,+BAAsB,CAACC,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC;AAACC,OAAA,CAAAL,gBAAA,GAAAA,gBAAA"}
@@ -7,6 +7,9 @@ exports.ReactNativeLegal = void 0;
7
7
  var _NativeReactNativeLegal = _interopRequireDefault(require("./NativeReactNativeLegal"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
9
  const ReactNativeLegal = {
10
+ getLibrariesAsync: () => {
11
+ return _NativeReactNativeLegal.default.getLibrariesAsync();
12
+ },
10
13
  launchLicenseListScreen: licenseHeaderText => {
11
14
  /**
12
15
  * On iOS, the licenses list is displayed as a custom table view controller
@@ -1 +1 @@
1
- {"version":3,"names":["_NativeReactNativeLegal","_interopRequireDefault","require","obj","__esModule","default","ReactNativeLegal","launchLicenseListScreen","licenseHeaderText","NativeReactNativeLegal","exports"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ios.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvD,MAAMG,gBAAgB,GAAG;EAC9BC,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIC,+BAAsB,CAACF,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC;AAACE,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_NativeReactNativeLegal","_interopRequireDefault","require","obj","__esModule","default","ReactNativeLegal","getLibrariesAsync","NativeReactNativeLegal","launchLicenseListScreen","licenseHeaderText","exports"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ios.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvD,MAAMG,gBAAgB,GAAG;EAC9BC,iBAAiB,EAAEA,CAAA,KAAM;IACvB,OAAOC,+BAAsB,CAACD,iBAAiB,CAAC,CAAC;EACnD,CAAC;EACDE,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIF,+BAAsB,CAACC,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC;AAACC,OAAA,CAAAL,gBAAA,GAAAA,gBAAA"}
@@ -5,6 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ReactNativeLegal = void 0;
7
7
  const ReactNativeLegal = {
8
+ getLibrariesAsync: () => {
9
+ return Promise.resolve({
10
+ data: []
11
+ });
12
+ },
8
13
  launchLicenseListScreen: _licenseHeaderText => {
9
14
  //
10
15
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ReactNativeLegal","launchLicenseListScreen","_licenseHeaderText","exports"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ts"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAG;EAC9BC,uBAAuB,EAAGC,kBAA2B,IAAK;IACxD;EAAA;AAEJ,CAAC;AAACC,OAAA,CAAAH,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["ReactNativeLegal","getLibrariesAsync","Promise","resolve","data","launchLicenseListScreen","_licenseHeaderText","exports"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ts"],"mappings":";;;;;;AAEO,MAAMA,gBAAgB,GAAG;EAC9BC,iBAAiB,EAAEA,CAAA,KAAM;IACvB,OAAOC,OAAO,CAACC,OAAO,CAAkB;MAAEC,IAAI,EAAE;IAAG,CAAC,CAAC;EACvD,CAAC;EACDC,uBAAuB,EAAGC,kBAA2B,IAAK;IACxD;EAAA;AAEJ,CAAC;AAACC,OAAA,CAAAP,gBAAA,GAAAA,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeReactNativeLegal.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAMlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC"}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeReactNativeLegal.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAiDlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import NativeReactNativeLegal from './NativeReactNativeLegal';
2
2
  export const ReactNativeLegal = {
3
+ getLibrariesAsync: () => {
4
+ return NativeReactNativeLegal.getLibrariesAsync();
5
+ },
3
6
  launchLicenseListScreen: licenseHeaderText => {
4
7
  /**
5
8
  * On Android, the licenses list is displayed as a custom activity
@@ -1 +1 @@
1
- {"version":3,"names":["NativeReactNativeLegal","ReactNativeLegal","launchLicenseListScreen","licenseHeaderText"],"sourceRoot":"../../src","sources":["ReactNativeLegal.android.ts"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,0BAA0B;AAE7D,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIH,sBAAsB,CAACE,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC"}
1
+ {"version":3,"names":["NativeReactNativeLegal","ReactNativeLegal","getLibrariesAsync","launchLicenseListScreen","licenseHeaderText"],"sourceRoot":"../../src","sources":["ReactNativeLegal.android.ts"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,0BAA0B;AAE7D,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,iBAAiB,EAAEA,CAAA,KAAM;IACvB,OAAOF,sBAAsB,CAACE,iBAAiB,CAAC,CAAC;EACnD,CAAC;EACDC,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIJ,sBAAsB,CAACG,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import NativeReactNativeLegal from './NativeReactNativeLegal';
2
2
  export const ReactNativeLegal = {
3
+ getLibrariesAsync: () => {
4
+ return NativeReactNativeLegal.getLibrariesAsync();
5
+ },
3
6
  launchLicenseListScreen: licenseHeaderText => {
4
7
  /**
5
8
  * On iOS, the licenses list is displayed as a custom table view controller
@@ -1 +1 @@
1
- {"version":3,"names":["NativeReactNativeLegal","ReactNativeLegal","launchLicenseListScreen","licenseHeaderText"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ios.ts"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,0BAA0B;AAE7D,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIH,sBAAsB,CAACE,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC"}
1
+ {"version":3,"names":["NativeReactNativeLegal","ReactNativeLegal","getLibrariesAsync","launchLicenseListScreen","licenseHeaderText"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ios.ts"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,0BAA0B;AAE7D,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,iBAAiB,EAAEA,CAAA,KAAM;IACvB,OAAOF,sBAAsB,CAACE,iBAAiB,CAAC,CAAC;EACnD,CAAC;EACDC,uBAAuB,EAAGC,iBAA0B,IAAK;IACvD;AACJ;AACA;IACIJ,sBAAsB,CAACG,uBAAuB,CAACC,iBAAiB,IAAI,cAAc,CAAC;EACrF;AACF,CAAC"}
@@ -1,4 +1,9 @@
1
1
  export const ReactNativeLegal = {
2
+ getLibrariesAsync: () => {
3
+ return Promise.resolve({
4
+ data: []
5
+ });
6
+ },
2
7
  launchLicenseListScreen: _licenseHeaderText => {
3
8
  //
4
9
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ReactNativeLegal","launchLicenseListScreen","_licenseHeaderText"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ts"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,uBAAuB,EAAGC,kBAA2B,IAAK;IACxD;EAAA;AAEJ,CAAC"}
1
+ {"version":3,"names":["ReactNativeLegal","getLibrariesAsync","Promise","resolve","data","launchLicenseListScreen","_licenseHeaderText"],"sourceRoot":"../../src","sources":["ReactNativeLegal.ts"],"mappings":"AAEA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,iBAAiB,EAAEA,CAAA,KAAM;IACvB,OAAOC,OAAO,CAACC,OAAO,CAAkB;MAAEC,IAAI,EAAE;IAAG,CAAC,CAAC;EACvD,CAAC;EACDC,uBAAuB,EAAGC,kBAA2B,IAAK;IACxD;EAAA;AAEJ,CAAC"}
@@ -1,5 +1,45 @@
1
1
  import type { TurboModule } from 'react-native';
2
+ export interface License {
3
+ licenseContent: string;
4
+ /**
5
+ * @platform Android
6
+ */
7
+ name?: string;
8
+ /**
9
+ * @platform Android
10
+ */
11
+ url?: string;
12
+ /**
13
+ * @platform Android
14
+ */
15
+ year?: string;
16
+ }
17
+ export interface Library {
18
+ id: string;
19
+ name: string;
20
+ licenses: License[];
21
+ /**
22
+ * @platform Android
23
+ */
24
+ description?: string;
25
+ /**
26
+ * @platform Android
27
+ */
28
+ developers?: string;
29
+ /**
30
+ * @platform Android
31
+ */
32
+ website?: string;
33
+ /**
34
+ * @platform Android
35
+ */
36
+ organization?: string;
37
+ }
38
+ export interface LibrariesResult {
39
+ data: Library[];
40
+ }
2
41
  export interface Spec extends TurboModule {
42
+ getLibrariesAsync(): Promise<LibrariesResult>;
3
43
  launchLicenseListScreen(licenseHeaderText: string): void;
4
44
  }
5
45
  declare const _default: Spec;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeReactNativeLegal.d.ts","sourceRoot":"","sources":["../../src/NativeReactNativeLegal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,uBAAuB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1D;;AAED,wBAAgF"}
1
+ {"version":3,"file":"NativeReactNativeLegal.d.ts","sourceRoot":"","sources":["../../src/NativeReactNativeLegal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,OAAO;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,iBAAiB,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9C,uBAAuB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1D;;AAED,wBAAgF"}
@@ -1,4 +1,5 @@
1
1
  export declare const ReactNativeLegal: {
2
+ getLibrariesAsync: () => Promise<import("./NativeReactNativeLegal").LibrariesResult>;
2
3
  launchLicenseListScreen: (licenseHeaderText?: string) => void;
3
4
  };
4
5
  //# sourceMappingURL=ReactNativeLegal.android.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReactNativeLegal.android.d.ts","sourceRoot":"","sources":["../../src/ReactNativeLegal.android.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;kDACmB,MAAM;CAMrD,CAAC"}
1
+ {"version":3,"file":"ReactNativeLegal.android.d.ts","sourceRoot":"","sources":["../../src/ReactNativeLegal.android.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;kDAImB,MAAM;CAMrD,CAAC"}
@@ -1,4 +1,6 @@
1
+ import type { LibrariesResult } from './NativeReactNativeLegal';
1
2
  export declare const ReactNativeLegal: {
3
+ getLibrariesAsync: () => Promise<LibrariesResult>;
2
4
  launchLicenseListScreen: (_licenseHeaderText?: string) => void;
3
5
  };
4
6
  //# sourceMappingURL=ReactNativeLegal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReactNativeLegal.d.ts","sourceRoot":"","sources":["../../src/ReactNativeLegal.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;mDACoB,MAAM;CAGtD,CAAC"}
1
+ {"version":3,"file":"ReactNativeLegal.d.ts","sourceRoot":"","sources":["../../src/ReactNativeLegal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,eAAO,MAAM,gBAAgB;;mDAIoB,MAAM;CAGtD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export declare const ReactNativeLegal: {
2
+ getLibrariesAsync: () => Promise<import("./NativeReactNativeLegal").LibrariesResult>;
2
3
  launchLicenseListScreen: (licenseHeaderText?: string) => void;
3
4
  };
4
5
  //# sourceMappingURL=ReactNativeLegal.ios.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReactNativeLegal.ios.d.ts","sourceRoot":"","sources":["../../src/ReactNativeLegal.ios.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;kDACmB,MAAM;CAMrD,CAAC"}
1
+ {"version":3,"file":"ReactNativeLegal.ios.d.ts","sourceRoot":"","sources":["../../src/ReactNativeLegal.ios.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;kDAImB,MAAM;CAMrD,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { ReactNativeLegal } from './ReactNativeLegal';
2
+ export type { LibrariesResult, Library, License } from './NativeReactNativeLegal';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-legal",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Acknowledge OSS libraries used in your React Native app",
5
5
  "keywords": [
6
6
  "react-native",
@@ -58,7 +58,7 @@
58
58
  "react-native-builder-bob": "0.23.1"
59
59
  },
60
60
  "dependencies": {
61
- "@callstack/react-native-legal-shared": "^0.2.0",
61
+ "@callstack/licenses": "^0.2.1",
62
62
  "glob": "^7.1.3",
63
63
  "xcode": "^3.0.1",
64
64
  "xml2js": "^0.6.2"
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.withAndroidLegal = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const react_native_legal_shared_1 = require("@callstack/react-native-legal-shared");
8
+ const licenses_1 = require("@callstack/licenses");
9
9
  const config_plugins_1 = require("expo/config-plugins");
10
10
  const addListActivity_1 = require("./addListActivity");
11
11
  const applyAndConfigureAboutLibrariesPlugin_1 = require("./applyAndConfigureAboutLibrariesPlugin");
@@ -18,8 +18,8 @@ const declareAboutLibrariesPlugin_1 = require("./declareAboutLibrariesPlugin");
18
18
  */
19
19
  const withAndroidLegal = (config) => {
20
20
  (0, config_plugins_1.withAndroidManifest)(config, async (exportedConfig) => {
21
- const licenses = (0, react_native_legal_shared_1.scanDependencies)(path_1.default.join(exportedConfig.modRequest.projectRoot, 'package.json'));
22
- (0, react_native_legal_shared_1.writeAboutLibrariesNPMOutput)(licenses, exportedConfig.modRequest.platformProjectRoot);
21
+ const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(exportedConfig.modRequest.projectRoot, 'package.json'));
22
+ (0, licenses_1.writeAboutLibrariesNPMOutput)(licenses, exportedConfig.modRequest.platformProjectRoot);
23
23
  return exportedConfig;
24
24
  });
25
25
  config = (0, declareAboutLibrariesPlugin_1.declareAboutLibrariesPlugin)(config);
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.withIosLegal = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const react_native_legal_shared_1 = require("@callstack/react-native-legal-shared");
8
+ const licenses_1 = require("@callstack/licenses");
9
9
  const config_plugins_1 = require("expo/config-plugins");
10
10
  const addSettingsBundle_1 = require("./addSettingsBundle");
11
11
  const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPhase");
@@ -17,8 +17,8 @@ const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPha
17
17
  */
18
18
  const withIosLegal = (config) => {
19
19
  (0, config_plugins_1.withXcodeProject)(config, async (exportedConfig) => {
20
- const licenses = (0, react_native_legal_shared_1.scanDependencies)(path_1.default.join(exportedConfig.modRequest.projectRoot, 'package.json'));
21
- (0, react_native_legal_shared_1.writeLicensePlistNPMOutput)(licenses, exportedConfig.modRequest.platformProjectRoot);
20
+ const licenses = (0, licenses_1.scanDependencies)(path_1.default.join(exportedConfig.modRequest.projectRoot, 'package.json'));
21
+ (0, licenses_1.writeLicensePlistNPMOutput)(licenses, exportedConfig.modRequest.platformProjectRoot);
22
22
  return exportedConfig;
23
23
  });
24
24
  config = (0, addSettingsBundle_1.addSettingsBundle)(config);
@@ -1,6 +1,6 @@
1
1
  import path from 'path';
2
2
 
3
- import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/react-native-legal-shared';
3
+ import { scanDependencies, writeAboutLibrariesNPMOutput } from '@callstack/licenses';
4
4
  import { type ConfigPlugin, withAndroidManifest } from 'expo/config-plugins';
5
5
 
6
6
  import { addListActivity } from './addListActivity';
@@ -1,6 +1,6 @@
1
1
  import path from 'path';
2
2
 
3
- import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/react-native-legal-shared';
3
+ import { scanDependencies, writeLicensePlistNPMOutput } from '@callstack/licenses';
4
4
  import { type ConfigPlugin, withXcodeProject } from 'expo/config-plugins';
5
5
 
6
6
  import { addSettingsBundle } from './addSettingsBundle';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addListActivityUtil = exports.applyAndConfigureAboutLibrariesPluginUtil = exports.declareAboutLibrariesPluginUtil = void 0;
4
- const react_native_legal_shared_1 = require("@callstack/react-native-legal-shared");
4
+ const licenses_1 = require("@callstack/licenses");
5
5
  /**
6
6
  * Applies Gradle Plugin Portal & AboutLibraries Gradle plugin repositories (if needed) inside root build.gradle
7
7
  */
@@ -55,7 +55,7 @@ exports.applyAndConfigureAboutLibrariesPluginUtil = applyAndConfigureAboutLibrar
55
55
  */
56
56
  function addListActivityUtil(activities) {
57
57
  const listActivity = prepareListActivity();
58
- if (!react_native_legal_shared_1.MiscUtils.arrayIncludesObject(activities, listActivity)) {
58
+ if (!licenses_1.MiscUtils.arrayIncludesObject(activities, listActivity)) {
59
59
  activities?.push(listActivity);
60
60
  console.log('About Libraries activity - ADDED');
61
61
  }
@@ -1,4 +1,4 @@
1
- import { MiscUtils } from '@callstack/react-native-legal-shared';
1
+ import { MiscUtils } from '@callstack/licenses';
2
2
 
3
3
  /**
4
4
  * Applies Gradle Plugin Portal & AboutLibraries Gradle plugin repositories (if needed) inside root build.gradle
@@ -1,7 +1,50 @@
1
1
  import type { TurboModule } from 'react-native';
2
2
  import { TurboModuleRegistry } from 'react-native';
3
3
 
4
+ export interface License {
5
+ licenseContent: string;
6
+ /**
7
+ * @platform Android
8
+ */
9
+ name?: string;
10
+ /**
11
+ * @platform Android
12
+ */
13
+ url?: string;
14
+ /**
15
+ * @platform Android
16
+ */
17
+ year?: string;
18
+ }
19
+
20
+ export interface Library {
21
+ id: string;
22
+ name: string;
23
+ licenses: License[];
24
+ /**
25
+ * @platform Android
26
+ */
27
+ description?: string;
28
+ /**
29
+ * @platform Android
30
+ */
31
+ developers?: string;
32
+ /**
33
+ * @platform Android
34
+ */
35
+ website?: string;
36
+ /**
37
+ * @platform Android
38
+ */
39
+ organization?: string;
40
+ }
41
+
42
+ export interface LibrariesResult {
43
+ data: Library[];
44
+ }
45
+
4
46
  export interface Spec extends TurboModule {
47
+ getLibrariesAsync(): Promise<LibrariesResult>;
5
48
  launchLicenseListScreen(licenseHeaderText: string): void;
6
49
  }
7
50
 
@@ -1,6 +1,9 @@
1
1
  import NativeReactNativeLegal from './NativeReactNativeLegal';
2
2
 
3
3
  export const ReactNativeLegal = {
4
+ getLibrariesAsync: () => {
5
+ return NativeReactNativeLegal.getLibrariesAsync();
6
+ },
4
7
  launchLicenseListScreen: (licenseHeaderText?: string) => {
5
8
  /**
6
9
  * On Android, the licenses list is displayed as a custom activity
@@ -1,6 +1,9 @@
1
1
  import NativeReactNativeLegal from './NativeReactNativeLegal';
2
2
 
3
3
  export const ReactNativeLegal = {
4
+ getLibrariesAsync: () => {
5
+ return NativeReactNativeLegal.getLibrariesAsync();
6
+ },
4
7
  launchLicenseListScreen: (licenseHeaderText?: string) => {
5
8
  /**
6
9
  * On iOS, the licenses list is displayed as a custom table view controller
@@ -1,4 +1,9 @@
1
+ import type { LibrariesResult } from './NativeReactNativeLegal';
2
+
1
3
  export const ReactNativeLegal = {
4
+ getLibrariesAsync: () => {
5
+ return Promise.resolve<LibrariesResult>({ data: [] });
6
+ },
2
7
  launchLicenseListScreen: (_licenseHeaderText?: string) => {
3
8
  //
4
9
  },
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { ReactNativeLegal } from './ReactNativeLegal';
2
+ export type { LibrariesResult, Library, License } from './NativeReactNativeLegal';