@onekeyfe/react-native-dns-lookup 1.1.55
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.
- package/DnsLookup.podspec +19 -0
- package/android/build.gradle +77 -0
- package/android/src/main/java/com/rnsdnslookup/DnsLookupModule.kt +33 -0
- package/android/src/main/java/com/rnsdnslookup/DnsLookupPackage.kt +33 -0
- package/ios/DnsLookup.h +9 -0
- package/ios/DnsLookup.mm +99 -0
- package/lib/module/NativeDnsLookup.js +5 -0
- package/lib/module/NativeDnsLookup.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeDnsLookup.d.ts +7 -0
- package/lib/typescript/src/NativeDnsLookup.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +162 -0
- package/src/NativeDnsLookup.ts +8 -0
- package/src/index.tsx +4 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "DnsLookup"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/OneKeyHQ/app-modules/react-native-dns-lookup.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
17
|
+
|
|
18
|
+
install_modules_dependencies(s)
|
|
19
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['DnsLookup_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
apply plugin: "com.android.library"
|
|
20
|
+
apply plugin: "kotlin-android"
|
|
21
|
+
|
|
22
|
+
apply plugin: "com.facebook.react"
|
|
23
|
+
|
|
24
|
+
def getExtOrIntegerDefault(name) {
|
|
25
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["DnsLookup_" + name]).toInteger()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
android {
|
|
29
|
+
namespace "com.rnsdnslookup"
|
|
30
|
+
|
|
31
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
32
|
+
|
|
33
|
+
defaultConfig {
|
|
34
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
35
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
buildFeatures {
|
|
39
|
+
buildConfig true
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
buildTypes {
|
|
43
|
+
release {
|
|
44
|
+
minifyEnabled false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
lintOptions {
|
|
49
|
+
disable "GradleCompatible"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
compileOptions {
|
|
53
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
54
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
sourceSets {
|
|
58
|
+
main {
|
|
59
|
+
java.srcDirs += [
|
|
60
|
+
"generated/java",
|
|
61
|
+
"generated/jni"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
repositories {
|
|
68
|
+
mavenCentral()
|
|
69
|
+
google()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
73
|
+
|
|
74
|
+
dependencies {
|
|
75
|
+
implementation "com.facebook.react:react-android"
|
|
76
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package com.rnsdnslookup
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
+
import com.facebook.react.bridge.WritableNativeArray
|
|
6
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
7
|
+
import java.net.InetAddress
|
|
8
|
+
|
|
9
|
+
@ReactModule(name = DnsLookupModule.NAME)
|
|
10
|
+
class DnsLookupModule(reactContext: ReactApplicationContext) :
|
|
11
|
+
NativeRNDnsLookupSpec(reactContext) {
|
|
12
|
+
|
|
13
|
+
companion object {
|
|
14
|
+
const val NAME = "RNDnsLookup"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun getName(): String = NAME
|
|
18
|
+
|
|
19
|
+
override fun getIpAddresses(hostname: String, promise: Promise) {
|
|
20
|
+
Thread {
|
|
21
|
+
try {
|
|
22
|
+
val addresses = InetAddress.getAllByName(hostname)
|
|
23
|
+
val result = WritableNativeArray()
|
|
24
|
+
for (address in addresses) {
|
|
25
|
+
result.pushString(address.hostAddress)
|
|
26
|
+
}
|
|
27
|
+
promise.resolve(result)
|
|
28
|
+
} catch (e: Exception) {
|
|
29
|
+
promise.reject("DNS_LOOKUP_ERROR", e.message, e)
|
|
30
|
+
}
|
|
31
|
+
}.start()
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package com.rnsdnslookup
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.BaseReactPackage
|
|
4
|
+
import com.facebook.react.bridge.NativeModule
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
+
import java.util.HashMap
|
|
9
|
+
|
|
10
|
+
class DnsLookupPackage : BaseReactPackage() {
|
|
11
|
+
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
12
|
+
return if (name == DnsLookupModule.NAME) {
|
|
13
|
+
DnsLookupModule(reactContext)
|
|
14
|
+
} else {
|
|
15
|
+
null
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
20
|
+
return ReactModuleInfoProvider {
|
|
21
|
+
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
22
|
+
moduleInfos[DnsLookupModule.NAME] = ReactModuleInfo(
|
|
23
|
+
DnsLookupModule.NAME,
|
|
24
|
+
DnsLookupModule.NAME,
|
|
25
|
+
false, // canOverrideExistingModule
|
|
26
|
+
false, // needsEagerInit
|
|
27
|
+
false, // isCxxModule
|
|
28
|
+
true // isTurboModule
|
|
29
|
+
)
|
|
30
|
+
moduleInfos
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/ios/DnsLookup.h
ADDED
package/ios/DnsLookup.mm
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#import "DnsLookup.h"
|
|
2
|
+
|
|
3
|
+
#import <CFNetwork/CFNetwork.h>
|
|
4
|
+
#import <netinet/in.h>
|
|
5
|
+
#import <netdb.h>
|
|
6
|
+
#import <ifaddrs.h>
|
|
7
|
+
#import <arpa/inet.h>
|
|
8
|
+
|
|
9
|
+
@implementation DnsLookup
|
|
10
|
+
|
|
11
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
12
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
13
|
+
{
|
|
14
|
+
return std::make_shared<facebook::react::NativeRNDnsLookupSpecJSI>(params);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
+ (NSString *)moduleName
|
|
18
|
+
{
|
|
19
|
+
return @"RNDnsLookup";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
+ (BOOL)requiresMainQueueSetup
|
|
23
|
+
{
|
|
24
|
+
return NO;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// MARK: - getIpAddresses
|
|
28
|
+
|
|
29
|
+
- (void)getIpAddresses:(NSString *)hostname
|
|
30
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
31
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
32
|
+
{
|
|
33
|
+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
34
|
+
NSError *error = nil;
|
|
35
|
+
NSArray *addresses = [self performDnsLookup:hostname error:&error];
|
|
36
|
+
|
|
37
|
+
if (addresses == nil) {
|
|
38
|
+
NSString *errorCode = [NSString stringWithFormat:@"%ld", (long)error.code];
|
|
39
|
+
reject(errorCode, error.userInfo[NSDebugDescriptionErrorKey], error);
|
|
40
|
+
} else {
|
|
41
|
+
resolve(addresses);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// MARK: - DNS lookup helper
|
|
47
|
+
|
|
48
|
+
- (NSArray *)performDnsLookup:(NSString *)hostname
|
|
49
|
+
error:(NSError **)error
|
|
50
|
+
{
|
|
51
|
+
if (hostname == nil) {
|
|
52
|
+
*error = [NSError errorWithDomain:NSGenericException
|
|
53
|
+
code:kCFHostErrorUnknown
|
|
54
|
+
userInfo:@{NSDebugDescriptionErrorKey: @"Hostname cannot be null."}];
|
|
55
|
+
return nil;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
CFHostRef hostRef = CFHostCreateWithName(kCFAllocatorDefault, (__bridge CFStringRef)hostname);
|
|
59
|
+
if (hostRef == nil) {
|
|
60
|
+
*error = [NSError errorWithDomain:NSGenericException
|
|
61
|
+
code:kCFHostErrorUnknown
|
|
62
|
+
userInfo:@{NSDebugDescriptionErrorKey: @"Failed to create host."}];
|
|
63
|
+
return nil;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
BOOL didStart = CFHostStartInfoResolution(hostRef, kCFHostAddresses, nil);
|
|
67
|
+
if (!didStart) {
|
|
68
|
+
*error = [NSError errorWithDomain:NSGenericException
|
|
69
|
+
code:kCFHostErrorUnknown
|
|
70
|
+
userInfo:@{NSDebugDescriptionErrorKey: @"Failed to start."}];
|
|
71
|
+
CFRelease(hostRef);
|
|
72
|
+
return nil;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
CFArrayRef addressesRef = CFHostGetAddressing(hostRef, nil);
|
|
76
|
+
if (addressesRef == nil) {
|
|
77
|
+
*error = [NSError errorWithDomain:NSGenericException
|
|
78
|
+
code:kCFHostErrorUnknown
|
|
79
|
+
userInfo:@{NSDebugDescriptionErrorKey: @"Failed to get addresses."}];
|
|
80
|
+
CFRelease(hostRef);
|
|
81
|
+
return nil;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
NSMutableArray *addresses = [NSMutableArray array];
|
|
85
|
+
char ipAddress[INET6_ADDRSTRLEN];
|
|
86
|
+
CFIndex numAddresses = CFArrayGetCount(addressesRef);
|
|
87
|
+
|
|
88
|
+
for (CFIndex currentIndex = 0; currentIndex < numAddresses; currentIndex++) {
|
|
89
|
+
struct sockaddr *address = (struct sockaddr *)CFDataGetBytePtr(
|
|
90
|
+
CFArrayGetValueAtIndex(addressesRef, currentIndex));
|
|
91
|
+
getnameinfo(address, address->sa_len, ipAddress, INET6_ADDRSTRLEN, nil, 0, NI_NUMERICHOST);
|
|
92
|
+
[addresses addObject:[NSString stringWithCString:ipAddress encoding:NSASCIIStringEncoding]];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
CFRelease(hostRef);
|
|
96
|
+
return addresses;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeDnsLookup.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAOlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,aAAa,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeDnsLookup","DnsLookup"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,eAAe,MAAM,sBAAmB;AAE/C,OAAO,MAAMC,SAAS,GAAGD,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeDnsLookup.d.ts","sourceRoot":"","sources":["../../../src/NativeDnsLookup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACrD;;AAED,wBAAqE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,kCAAkB,CAAC;AACzC,YAAY,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@onekeyfe/react-native-dns-lookup",
|
|
3
|
+
"version": "1.1.55",
|
|
4
|
+
"description": "react-native-dns-lookup",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"*.podspec",
|
|
21
|
+
"!ios/build",
|
|
22
|
+
"!android/build",
|
|
23
|
+
"!android/gradle",
|
|
24
|
+
"!android/gradlew",
|
|
25
|
+
"!android/gradlew.bat",
|
|
26
|
+
"!android/local.properties",
|
|
27
|
+
"!**/__tests__",
|
|
28
|
+
"!**/__fixtures__",
|
|
29
|
+
"!**/__mocks__",
|
|
30
|
+
"!**/.*"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
34
|
+
"prepare": "bob build",
|
|
35
|
+
"typecheck": "tsc",
|
|
36
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
37
|
+
"test": "jest",
|
|
38
|
+
"release": "yarn prepare && npm whoami && npm publish --access public"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"react-native",
|
|
42
|
+
"ios",
|
|
43
|
+
"android"
|
|
44
|
+
],
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules/react-native-dns-lookup.git"
|
|
48
|
+
},
|
|
49
|
+
"author": "@onekeyhq <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/OneKeyHQ/app-modules/react-native-dns-lookup/issues"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/react-native-dns-lookup#readme",
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"registry": "https://registry.npmjs.org/"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
60
|
+
"@eslint/compat": "^1.3.2",
|
|
61
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
62
|
+
"@eslint/js": "^9.35.0",
|
|
63
|
+
"@react-native/babel-preset": "0.83.0",
|
|
64
|
+
"@react-native/eslint-config": "0.83.0",
|
|
65
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
66
|
+
"@types/jest": "^29.5.14",
|
|
67
|
+
"@types/react": "^19.2.0",
|
|
68
|
+
"commitlint": "^19.8.1",
|
|
69
|
+
"del-cli": "^6.0.0",
|
|
70
|
+
"eslint": "^9.35.0",
|
|
71
|
+
"eslint-config-prettier": "^10.1.8",
|
|
72
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
73
|
+
"jest": "^29.7.0",
|
|
74
|
+
"lefthook": "^2.0.3",
|
|
75
|
+
"prettier": "^2.8.8",
|
|
76
|
+
"react": "19.2.0",
|
|
77
|
+
"react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
|
|
78
|
+
"react-native-builder-bob": "^0.40.17",
|
|
79
|
+
"release-it": "^19.0.4",
|
|
80
|
+
"turbo": "^2.5.6",
|
|
81
|
+
"typescript": "^5.9.2"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
84
|
+
"react": "*",
|
|
85
|
+
"react-native": "*"
|
|
86
|
+
},
|
|
87
|
+
"react-native-builder-bob": {
|
|
88
|
+
"source": "src",
|
|
89
|
+
"output": "lib",
|
|
90
|
+
"targets": [
|
|
91
|
+
[
|
|
92
|
+
"module",
|
|
93
|
+
{
|
|
94
|
+
"esm": true
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
[
|
|
98
|
+
"typescript",
|
|
99
|
+
{
|
|
100
|
+
"project": "tsconfig.build.json"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"codegenConfig": {
|
|
106
|
+
"name": "RNDnsLookupSpec",
|
|
107
|
+
"type": "modules",
|
|
108
|
+
"jsSrcsDir": "src",
|
|
109
|
+
"android": {
|
|
110
|
+
"javaPackageName": "com.rnsdnslookup"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"prettier": {
|
|
114
|
+
"quoteProps": "consistent",
|
|
115
|
+
"singleQuote": true,
|
|
116
|
+
"tabWidth": 2,
|
|
117
|
+
"trailingComma": "es5",
|
|
118
|
+
"useTabs": false
|
|
119
|
+
},
|
|
120
|
+
"jest": {
|
|
121
|
+
"preset": "react-native",
|
|
122
|
+
"modulePathIgnorePatterns": [
|
|
123
|
+
"<rootDir>/example/node_modules",
|
|
124
|
+
"<rootDir>/lib/"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"commitlint": {
|
|
128
|
+
"extends": [
|
|
129
|
+
"@commitlint/config-conventional"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"release-it": {
|
|
133
|
+
"git": {
|
|
134
|
+
"commitMessage": "chore: release ${version}",
|
|
135
|
+
"tagName": "v${version}"
|
|
136
|
+
},
|
|
137
|
+
"npm": {
|
|
138
|
+
"publish": true
|
|
139
|
+
},
|
|
140
|
+
"github": {
|
|
141
|
+
"release": true
|
|
142
|
+
},
|
|
143
|
+
"plugins": {
|
|
144
|
+
"@release-it/conventional-changelog": {
|
|
145
|
+
"preset": {
|
|
146
|
+
"name": "angular"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"create-react-native-library": {
|
|
152
|
+
"type": "turbo-module",
|
|
153
|
+
"languages": "kotlin-objc",
|
|
154
|
+
"tools": [
|
|
155
|
+
"eslint",
|
|
156
|
+
"jest",
|
|
157
|
+
"lefthook",
|
|
158
|
+
"release-it"
|
|
159
|
+
],
|
|
160
|
+
"version": "0.56.0"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
2
|
+
import type { TurboModule } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
getIpAddresses(hostname: string): Promise<string[]>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('RNDnsLookup');
|
package/src/index.tsx
ADDED