Skip to content

Commit 6bfd7cd

Browse files
authored
docs: update docs, readme (#33)
1 parent 2ea0d5a commit 6bfd7cd

File tree

6 files changed

+115
-115
lines changed

6 files changed

+115
-115
lines changed

README-ko.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ console.log(DeviceInfoModule.systemVersion); // "15.0"
5656
console.log(DeviceInfoModule.brand); // "Apple"
5757
console.log(DeviceInfoModule.model); // "iPhone"
5858

59-
// 동기 메서드 (즉시 - <1ms)
60-
const uniqueId = DeviceInfoModule.getUniqueId();
59+
// 동기 속성 (즉시 - <1ms)
60+
const uniqueId = DeviceInfoModule.uniqueId;
6161
console.log(uniqueId); // "FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9"
6262

63-
const manufacturer = DeviceInfoModule.getManufacturer();
63+
const manufacturer = DeviceInfoModule.manufacturer;
6464
console.log(manufacturer); // "Apple"
6565

66-
const isTablet = DeviceInfoModule.isTablet();
66+
const isTablet = DeviceInfoModule.isTablet;
6767
console.log(isTablet); // false
6868

69-
const batteryLevel = DeviceInfoModule.getBatteryLevel();
69+
const batteryLevel = DeviceInfoModule.batteryLevel;
7070
console.log(`배터리: ${(batteryLevel * 100).toFixed(0)}%`); // "배터리: 85%"
7171

7272
// 비동기 메서드 (Promise 기반 - <100ms)
@@ -85,21 +85,21 @@ import type { PowerState, DeviceType } from 'react-native-nitro-device-info';
8585

8686
// 디바이스 식별
8787
const deviceId = DeviceInfoModule.deviceId; // "iPhone14,2"
88-
const manufacturer = DeviceInfoModule.getManufacturer(); // "Apple"
89-
const uniqueId = DeviceInfoModule.getUniqueId(); // "FCDBD8EF-..."
88+
const manufacturer = DeviceInfoModule.manufacturer; // "Apple"
89+
const uniqueId = DeviceInfoModule.uniqueId; // "FCDBD8EF-..."
9090

9191
// 디바이스 기능
92-
const isTablet = DeviceInfoModule.isTablet(); // false
93-
const hasNotch = DeviceInfoModule.hasNotch(); // true
94-
const hasDynamicIsland = DeviceInfoModule.hasDynamicIsland(); // false
95-
const isCameraPresent = DeviceInfoModule.isCameraPresent(); // true
96-
const isEmulator = DeviceInfoModule.isEmulator(); // false
92+
const isTablet = DeviceInfoModule.isTablet; // false
93+
const hasNotch = DeviceInfoModule.hasNotch; // true
94+
const hasDynamicIsland = DeviceInfoModule.hasDynamicIsland; // false
95+
const isCameraPresent = DeviceInfoModule.isCameraPresent; // true
96+
const isEmulator = DeviceInfoModule.isEmulator; // false
9797

9898
// 시스템 리소스
99-
const totalMemory = DeviceInfoModule.getTotalMemory();
100-
const usedMemory = DeviceInfoModule.getUsedMemory();
101-
const totalDisk = DeviceInfoModule.getTotalDiskCapacity();
102-
const freeDisk = DeviceInfoModule.getFreeDiskStorage();
99+
const totalMemory = DeviceInfoModule.totalMemory;
100+
const usedMemory = DeviceInfoModule.usedMemory;
101+
const totalDisk = DeviceInfoModule.totalDiskCapacity;
102+
const freeDisk = DeviceInfoModule.freeDiskStorage;
103103

104104
console.log(
105105
`RAM: ${(usedMemory / 1024 / 1024).toFixed(0)}MB / ${(totalMemory / 1024 / 1024).toFixed(0)}MB`
@@ -109,20 +109,20 @@ console.log(
109109
);
110110

111111
// 배터리 정보
112-
const batteryLevel = DeviceInfoModule.getBatteryLevel();
113-
const isCharging = DeviceInfoModule.isBatteryCharging();
114-
const powerState: PowerState = DeviceInfoModule.getPowerState();
112+
const batteryLevel = DeviceInfoModule.batteryLevel;
113+
const isCharging = DeviceInfoModule.isBatteryCharging;
114+
const powerState: PowerState = DeviceInfoModule.powerState;
115115

116116
console.log(
117117
`배터리: ${(batteryLevel * 100).toFixed(0)}% ${isCharging ? '(충전 중)' : ''}`
118118
);
119119
console.log(`저전력 모드: ${powerState.lowPowerMode}`);
120120

121121
// 앱 메타데이터
122-
const version = DeviceInfoModule.getVersion();
123-
const buildNumber = DeviceInfoModule.getBuildNumber();
124-
const bundleId = DeviceInfoModule.getBundleId();
125-
const appName = DeviceInfoModule.getApplicationName();
122+
const version = DeviceInfoModule.version;
123+
const buildNumber = DeviceInfoModule.buildNumber;
124+
const bundleId = DeviceInfoModule.bundleId;
125+
const appName = DeviceInfoModule.applicationName;
126126

127127
console.log(`${appName} (${bundleId})`);
128128
console.log(`버전: ${version} (${buildNumber})`);
@@ -137,9 +137,9 @@ console.log(`통신사: ${carrier}`);
137137
console.log(`위치 서비스: ${isLocationEnabled ? '활성화' : '비활성화'}`);
138138

139139
// 플랫폼별
140-
const apiLevel = DeviceInfoModule.getApiLevel(); // Android: 33, iOS: -1
141-
const abis = DeviceInfoModule.getSupportedAbis(); // ["arm64-v8a"]
142-
const hasGms = DeviceInfoModule.hasGms(); // Android 전용
140+
const apiLevel = DeviceInfoModule.apiLevel; // Android: 33, iOS: -1
141+
const abis = DeviceInfoModule.supportedAbis; // ["arm64-v8a"]
142+
const hasGms = DeviceInfoModule.hasGms; // Android 전용
143143
```
144144

145145
## API 레퍼런스
@@ -157,20 +157,20 @@ DeviceInfoModule.systemVersion; // "15.0"
157157
DeviceInfoModule.model; // "iPhone"
158158
```
159159

160-
#### 주요 메서드
160+
#### 주요 속성
161161

162162
```typescript
163163
// 디바이스 정보
164-
DeviceInfoModule.getUniqueId(); // 동기
165-
DeviceInfoModule.isTablet(); // 동기
166-
DeviceInfoModule.getTotalMemory(); // 동기
167-
DeviceInfoModule.getBatteryLevel(); // 동기
164+
DeviceInfoModule.uniqueId; // 동기
165+
DeviceInfoModule.isTablet; // 동기
166+
DeviceInfoModule.totalMemory; // 동기
167+
DeviceInfoModule.batteryLevel; // 동기
168168

169169
// 앱 정보
170-
DeviceInfoModule.getVersion(); // 동기
171-
DeviceInfoModule.getBundleId(); // 동기
170+
DeviceInfoModule.version; // 동기
171+
DeviceInfoModule.bundleId; // 동기
172172

173-
// 네트워크 (비동기)
173+
// 네트워크 (비동기 메서드)
174174
await DeviceInfoModule.getIpAddress(); // ~20-50ms
175175
await DeviceInfoModule.getCarrier(); // ~20-50ms
176176
```
@@ -217,13 +217,13 @@ import { DeviceInfoModule } from 'react-native-nitro-device-info';
217217
const deviceId = DeviceInfoModule.deviceId; // 메서드가 아닌 속성
218218
const brand = DeviceInfoModule.brand; // 메서드가 아닌 속성
219219

220-
// 대부분의 메서드가 이제 동기
221-
const uniqueId = DeviceInfoModule.getUniqueId(); // 이제 동기!
222-
const totalMemory = DeviceInfoModule.getTotalMemory(); // 이제 동기!
223-
const batteryLevel = DeviceInfoModule.getBatteryLevel(); // 이제 동기!
224-
const isTablet = DeviceInfoModule.isTablet(); // 이전과 동일
220+
// 대부분의 값이 이제 동기 속성
221+
const uniqueId = DeviceInfoModule.uniqueId; // 속성, 동기!
222+
const totalMemory = DeviceInfoModule.totalMemory; // 속성, 동기!
223+
const batteryLevel = DeviceInfoModule.batteryLevel; // 속성, 동기!
224+
const isTablet = DeviceInfoModule.isTablet; // 속성, 동기!
225225

226-
// 네트워크/연결만 비동기로 유지
226+
// 네트워크/연결만 비동기 메서드로 유지
227227
const ipAddress = await DeviceInfoModule.getIpAddress();
228228
```
229229

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ console.log(DeviceInfoModule.systemVersion); // "15.0"
5555
console.log(DeviceInfoModule.brand); // "Apple"
5656
console.log(DeviceInfoModule.model); // "iPhone"
5757

58-
// Synchronous methods (immediate - <1ms)
59-
const uniqueId = DeviceInfoModule.getUniqueId();
58+
// Synchronous properties (immediate - <1ms)
59+
const uniqueId = DeviceInfoModule.uniqueId;
6060
console.log(uniqueId); // "FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9"
6161

62-
const manufacturer = DeviceInfoModule.getManufacturer();
62+
const manufacturer = DeviceInfoModule.manufacturer;
6363
console.log(manufacturer); // "Apple"
6464

65-
const isTablet = DeviceInfoModule.isTablet();
65+
const isTablet = DeviceInfoModule.isTablet;
6666
console.log(isTablet); // false
6767

68-
const batteryLevel = DeviceInfoModule.getBatteryLevel();
68+
const batteryLevel = DeviceInfoModule.batteryLevel;
6969
console.log(`Battery: ${(batteryLevel * 100).toFixed(0)}%`); // "Battery: 85%"
7070

7171
// Asynchronous methods (Promise-based - <100ms)
@@ -84,21 +84,21 @@ import type { PowerState, DeviceType } from 'react-native-nitro-device-info';
8484

8585
// Device Identification
8686
const deviceId = DeviceInfoModule.deviceId; // "iPhone14,2"
87-
const manufacturer = DeviceInfoModule.getManufacturer(); // "Apple"
88-
const uniqueId = DeviceInfoModule.getUniqueId(); // "FCDBD8EF-..."
87+
const manufacturer = DeviceInfoModule.manufacturer; // "Apple"
88+
const uniqueId = DeviceInfoModule.uniqueId; // "FCDBD8EF-..."
8989

9090
// Device Capabilities
91-
const isTablet = DeviceInfoModule.isTablet(); // false
92-
const hasNotch = DeviceInfoModule.hasNotch(); // true
93-
const hasDynamicIsland = DeviceInfoModule.hasDynamicIsland(); // false
94-
const isCameraPresent = DeviceInfoModule.isCameraPresent(); // true
95-
const isEmulator = DeviceInfoModule.isEmulator(); // false
91+
const isTablet = DeviceInfoModule.isTablet; // false
92+
const hasNotch = DeviceInfoModule.hasNotch; // true
93+
const hasDynamicIsland = DeviceInfoModule.hasDynamicIsland; // false
94+
const isCameraPresent = DeviceInfoModule.isCameraPresent; // true
95+
const isEmulator = DeviceInfoModule.isEmulator; // false
9696

9797
// System Resources
98-
const totalMemory = DeviceInfoModule.getTotalMemory();
99-
const usedMemory = DeviceInfoModule.getUsedMemory();
100-
const totalDisk = DeviceInfoModule.getTotalDiskCapacity();
101-
const freeDisk = DeviceInfoModule.getFreeDiskStorage();
98+
const totalMemory = DeviceInfoModule.totalMemory;
99+
const usedMemory = DeviceInfoModule.usedMemory;
100+
const totalDisk = DeviceInfoModule.totalDiskCapacity;
101+
const freeDisk = DeviceInfoModule.freeDiskStorage;
102102

103103
console.log(
104104
`RAM: ${(usedMemory / 1024 / 1024).toFixed(0)}MB / ${(totalMemory / 1024 / 1024).toFixed(0)}MB`
@@ -108,20 +108,20 @@ console.log(
108108
);
109109

110110
// Battery Information
111-
const batteryLevel = DeviceInfoModule.getBatteryLevel();
112-
const isCharging = DeviceInfoModule.isBatteryCharging();
113-
const powerState: PowerState = DeviceInfoModule.getPowerState();
111+
const batteryLevel = DeviceInfoModule.batteryLevel;
112+
const isCharging = DeviceInfoModule.isBatteryCharging;
113+
const powerState: PowerState = DeviceInfoModule.powerState;
114114

115115
console.log(
116116
`Battery: ${(batteryLevel * 100).toFixed(0)}% ${isCharging ? '(charging)' : ''}`
117117
);
118118
console.log(`Low Power Mode: ${powerState.lowPowerMode}`);
119119

120120
// Application Metadata
121-
const version = DeviceInfoModule.getVersion();
122-
const buildNumber = DeviceInfoModule.getBuildNumber();
123-
const bundleId = DeviceInfoModule.getBundleId();
124-
const appName = DeviceInfoModule.getApplicationName();
121+
const version = DeviceInfoModule.version;
122+
const buildNumber = DeviceInfoModule.buildNumber;
123+
const bundleId = DeviceInfoModule.bundleId;
124+
const appName = DeviceInfoModule.applicationName;
125125

126126
console.log(`${appName} (${bundleId})`);
127127
console.log(`Version: ${version} (${buildNumber})`);
@@ -136,9 +136,9 @@ console.log(`Carrier: ${carrier}`);
136136
console.log(`Location Services: ${isLocationEnabled ? 'enabled' : 'disabled'}`);
137137

138138
// Platform-Specific
139-
const apiLevel = DeviceInfoModule.getApiLevel(); // Android: 33, iOS: -1
140-
const abis = DeviceInfoModule.getSupportedAbis(); // ["arm64-v8a"]
141-
const hasGms = DeviceInfoModule.hasGms(); // Android only
139+
const apiLevel = DeviceInfoModule.apiLevel; // Android: 33, iOS: -1
140+
const abis = DeviceInfoModule.supportedAbis; // ["arm64-v8a"]
141+
const hasGms = DeviceInfoModule.hasGms; // Android only
142142
```
143143

144144
## API Reference
@@ -156,20 +156,20 @@ DeviceInfoModule.systemVersion; // "15.0"
156156
DeviceInfoModule.model; // "iPhone"
157157
```
158158

159-
#### Common Methods
159+
#### Common Properties
160160

161161
```typescript
162162
// Device Info
163-
DeviceInfoModule.getUniqueId(); // Sync
164-
DeviceInfoModule.isTablet(); // Sync
165-
DeviceInfoModule.getTotalMemory(); // Sync
166-
DeviceInfoModule.getBatteryLevel(); // Sync
163+
DeviceInfoModule.uniqueId; // Sync
164+
DeviceInfoModule.isTablet; // Sync
165+
DeviceInfoModule.totalMemory; // Sync
166+
DeviceInfoModule.batteryLevel; // Sync
167167

168168
// App Info
169-
DeviceInfoModule.getVersion(); // Sync
170-
DeviceInfoModule.getBundleId(); // Sync
169+
DeviceInfoModule.version; // Sync
170+
DeviceInfoModule.bundleId; // Sync
171171

172-
// Network (Async)
172+
// Network (Async methods)
173173
await DeviceInfoModule.getIpAddress(); // ~20-50ms
174174
await DeviceInfoModule.getCarrier(); // ~20-50ms
175175
```
@@ -216,13 +216,13 @@ import { DeviceInfoModule } from 'react-native-nitro-device-info';
216216
const deviceId = DeviceInfoModule.deviceId; // Property, not method
217217
const brand = DeviceInfoModule.brand; // Property, not method
218218

219-
// Most methods are now synchronous
220-
const uniqueId = DeviceInfoModule.getUniqueId(); // Sync now!
221-
const totalMemory = DeviceInfoModule.getTotalMemory(); // Sync now!
222-
const batteryLevel = DeviceInfoModule.getBatteryLevel(); // Sync now!
223-
const isTablet = DeviceInfoModule.isTablet(); // Same as before
219+
// Most values are now synchronous properties
220+
const uniqueId = DeviceInfoModule.uniqueId; // Property, sync!
221+
const totalMemory = DeviceInfoModule.totalMemory; // Property, sync!
222+
const batteryLevel = DeviceInfoModule.batteryLevel; // Property, sync!
223+
const isTablet = DeviceInfoModule.isTablet; // Property, sync!
224224

225-
// Only network/connectivity remain async
225+
// Only network/connectivity remain async methods
226226
const ipAddress = await DeviceInfoModule.getIpAddress();
227227
```
228228

0 commit comments

Comments
 (0)