react-native-tinykit 0.2.0 → 0.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.
package/README.md CHANGED
@@ -11,6 +11,7 @@ A lightweight React Native toolkit for iOS, providing essential native utilities
11
11
 
12
12
  - 🔄 **App Restart** - Programmatically restart your React Native application
13
13
  - 🌡️ **Thermal State** - Get and monitor the device's thermal state
14
+ - ⭐ **App Review** - Request App Store review from within your app
14
15
  - ⚡ **Turbo Module** - Built with the new architecture for optimal performance
15
16
  - 📦 **Lightweight** - Minimal footprint with zero dependencies
16
17
 
@@ -59,14 +60,14 @@ restart();
59
60
  Get the current thermal state and monitor for changes:
60
61
 
61
62
  ```tsx
62
- import { getThermalState, addThermalStateListener } from 'react-native-tinykit';
63
+ import { getThermalState, onThermalStateChange } from 'react-native-tinykit';
63
64
 
64
65
  // Get current thermal state
65
66
  const state = getThermalState();
66
67
  console.log('Current thermal state:', state);
67
68
 
68
69
  // Listen for thermal state changes
69
- const subscription = addThermalStateListener((state) => {
70
+ const subscription = onThermalStateChange((state) => {
70
71
  console.log('Thermal state changed:', state);
71
72
 
72
73
  switch (state) {
@@ -95,6 +96,24 @@ subscription.remove();
95
96
  - Pause background tasks during high thermal states
96
97
  - Show warnings to users when thermal state is critical
97
98
 
99
+ ### App Review
100
+
101
+ Request an App Store review from your user:
102
+
103
+ ```tsx
104
+ import { requestReview } from 'react-native-tinykit';
105
+
106
+ // Request review
107
+ await requestReview();
108
+ ```
109
+
110
+ > **Note**: In development mode, the review dialog will always appear. In production (TestFlight/App Store), iOS limits the frequency of these prompts (max 3 times per year per user).
111
+
112
+ #### Example Use Cases
113
+
114
+ - Prompt for review after a user completes a significant action
115
+ - Ask for feedback after a certain number of app opens
116
+
98
117
  ## API Reference
99
118
 
100
119
  ### `restart()`
@@ -144,12 +163,12 @@ if (state === 'critical') {
144
163
  }
145
164
  ```
146
165
 
147
- ### `addThermalStateListener()`
166
+ ### `onThermalStateChange()`
148
167
 
149
168
  Adds a listener for thermal state changes.
150
169
 
151
170
  ```tsx
152
- addThermalStateListener(listener: (state: ThermalState) => void): { remove: () => void }
171
+ onThermalStateChange(listener: (state: ThermalState) => void): { remove: () => void }
153
172
  ```
154
173
 
155
174
  **Parameters:**
@@ -161,9 +180,9 @@ addThermalStateListener(listener: (state: ThermalState) => void): { remove: () =
161
180
  **Example:**
162
181
 
163
182
  ```tsx
164
- import { addThermalStateListener } from 'react-native-tinykit';
183
+ import { onThermalStateChange } from 'react-native-tinykit';
165
184
 
166
- const subscription = addThermalStateListener((state) => {
185
+ const subscription = onThermalStateChange((state) => {
167
186
  console.log('Thermal state changed to:', state);
168
187
  });
169
188
 
@@ -171,6 +190,30 @@ const subscription = addThermalStateListener((state) => {
171
190
  subscription.remove();
172
191
  ```
173
192
 
193
+ ### `requestReview()`
194
+
195
+ Requests a review of the app.
196
+
197
+ ```tsx
198
+ requestReview(): Promise<void>
199
+ ```
200
+
201
+ **Returns:** A Promise that resolves when the request is processed.
202
+
203
+ **Example:**
204
+
205
+ ```tsx
206
+ import { requestReview } from 'react-native-tinykit';
207
+
208
+ const handleReview = async () => {
209
+ try {
210
+ await requestReview();
211
+ } catch (error) {
212
+ console.error('Failed to request review:', error);
213
+ }
214
+ };
215
+ ```
216
+
174
217
  ## Apps Using This Library
175
218
 
176
219
  - [Night Vision - LiDAR Camera](https://apps.apple.com/app/id1668629667)
package/ios/Tinykit.h CHANGED
@@ -1,4 +1,5 @@
1
1
  #import <TinykitSpec/TinykitSpec.h>
2
+ #import <React/RCTReloadCommand.h>
2
3
 
3
4
  @interface Tinykit : NativeTinykitSpecBase <NativeTinykitSpec>
4
5
 
package/ios/Tinykit.mm CHANGED
@@ -1,80 +1,41 @@
1
1
  #import "Tinykit.h"
2
- #import <React/RCTReloadCommand.h>
2
+ #import "react_native_tinykit-Swift.h"
3
3
 
4
- @implementation Tinykit
5
-
6
- /// Initializes the Tinykit module and registers for thermal state change notifications.
7
- - (instancetype)init
8
- {
9
- self = [super init];
10
- if (self) {
11
- [[NSNotificationCenter defaultCenter] addObserver:self
12
- selector:@selector(thermalStateChange:)
13
- name:NSProcessInfoThermalStateDidChangeNotification
14
- object:nil];
15
- }
16
- return self;
17
- }
18
-
19
- /// Cleans up by removing the observer from the notification center.
20
- - (void)dealloc
21
- {
22
- [[NSNotificationCenter defaultCenter] removeObserver:self];
4
+ @implementation Tinykit {
5
+ NativeTinykit *_nativeTinykit;
23
6
  }
24
7
 
25
- /// Converts a thermal state enum value to its string representation.
26
- /// @param thermalState The thermal state to convert.
27
- /// @return A string representation of the thermal state ("nominal", "fair", "serious", or "critical").
28
- + (NSString *)thermalStateToString:(NSProcessInfoThermalState)thermalState
29
- {
30
- switch (thermalState) {
31
- case NSProcessInfoThermalStateNominal:
32
- return @"nominal";
33
- case NSProcessInfoThermalStateFair:
34
- return @"fair";
35
- case NSProcessInfoThermalStateSerious:
36
- return @"serious";
37
- case NSProcessInfoThermalStateCritical:
38
- return @"critical";
39
- default:
40
- return @"nominal";
41
- }
42
- }
43
-
44
- /// Handles thermal state change notifications from the system.
45
- /// @param notification The notification containing thermal state change information.
46
- - (void)thermalStateChange:(NSNotification *)notification
8
+ - (instancetype)init
47
9
  {
48
- NSString *state = [Tinykit thermalStateToString:[[NSProcessInfo processInfo] thermalState]];
49
- [self emitOnThermalStateChange:@{@"thermalState": state}];
10
+ self = [super init];
11
+ if (self) {
12
+ __weak Tinykit *weakSelf = self;
13
+ _nativeTinykit = [[NativeTinykit alloc] initOnThermalStateChange:^(NSString *value) {
14
+ [weakSelf emitOnThermalStateChange:value];
15
+ }];
16
+ }
17
+ return self;
50
18
  }
51
19
 
52
- /// Returns the current thermal state of the device as a string.
53
- /// @return A string representation of the current thermal state.
54
20
  - (NSString *)getThermalState
55
21
  {
56
- NSProcessInfoThermalState thermalState = [[NSProcessInfo processInfo] thermalState];
57
- return [Tinykit thermalStateToString:thermalState];
22
+ return [_nativeTinykit getThermalState];
58
23
  }
59
24
 
60
- /// Triggers a reload of the React Native bundle on the main thread.
61
25
  - (void)restart {
62
- dispatch_sync(dispatch_get_main_queue(), ^{
63
- RCTTriggerReloadCommandListeners(@"react-native-tinykit");
64
- });
26
+ [_nativeTinykit restart];
27
+ }
28
+
29
+ - (void)requestReview:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
30
+ [_nativeTinykit requestReviewWithResolve:resolve rejecter:reject];
65
31
  }
66
32
 
67
- /// Returns the TurboModule instance for this native module.
68
- /// @param params The initialization parameters for the TurboModule.
69
- /// @return A shared pointer to the TurboModule instance.
70
33
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
71
- (const facebook::react::ObjCTurboModule::InitParams &)params
34
+ (const facebook::react::ObjCTurboModule::InitParams &)params
72
35
  {
73
- return std::make_shared<facebook::react::NativeTinykitSpecJSI>(params);
36
+ return std::make_shared<facebook::react::NativeTinykitSpecJSI>(params);
74
37
  }
75
38
 
76
- /// Returns the name of this native module used for JavaScript bridge registration.
77
- /// @return The module name "Tinykit".
78
39
  + (NSString *)moduleName
79
40
  {
80
41
  return @"Tinykit";
@@ -0,0 +1,72 @@
1
+ import Foundation
2
+ import React
3
+ import StoreKit
4
+
5
+ @objcMembers public class NativeTinykit: NSObject {
6
+ public var onThermalStateChange: ((String) -> Void)?
7
+
8
+ public init(onThermalStateChange: @escaping ((String) -> Void)) {
9
+ super.init()
10
+ self.onThermalStateChange = onThermalStateChange
11
+ NotificationCenter.default.addObserver(
12
+ self,
13
+ selector: #selector(handleThermalStateChange),
14
+ name: ProcessInfo.thermalStateDidChangeNotification,
15
+ object: nil
16
+ )
17
+ }
18
+
19
+ deinit {
20
+ NotificationCenter.default.removeObserver(self)
21
+ }
22
+
23
+ public func getThermalState() -> String {
24
+ return thermalStateToString(ProcessInfo.processInfo.thermalState)
25
+ }
26
+
27
+ public func restart() {
28
+ DispatchQueue.main.async {
29
+ RCTTriggerReloadCommandListeners("react-native-tinykit")
30
+ }
31
+ }
32
+
33
+ public func requestReview(
34
+ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock
35
+ ) {
36
+ let activeWindowScene = UIApplication.shared.connectedScenes.filter { scene in
37
+ return scene.activationState == .foregroundActive && scene is UIWindowScene
38
+ }.first
39
+
40
+ if let scene = activeWindowScene as? UIWindowScene {
41
+ if #available(iOS 16.0, *) {
42
+ Task {
43
+ await MainActor.run {
44
+ AppStore.requestReview(in: scene)
45
+ resolve(nil)
46
+ }
47
+ }
48
+ } else {
49
+ SKStoreReviewController.requestReview(in: scene)
50
+ resolve(nil)
51
+ }
52
+ } else {
53
+ SKStoreReviewController.requestReview()
54
+ resolve(nil)
55
+ }
56
+ }
57
+
58
+ @objc private func handleThermalStateChange() {
59
+ let state = getThermalState()
60
+ onThermalStateChange?(state)
61
+ }
62
+
63
+ private func thermalStateToString(_ state: ProcessInfo.ThermalState) -> String {
64
+ switch state {
65
+ case .nominal: return "nominal"
66
+ case .fair: return "fair"
67
+ case .serious: return "serious"
68
+ case .critical: return "critical"
69
+ @unknown default: return "nominal"
70
+ }
71
+ }
72
+ }
@@ -10,9 +10,5 @@ import { TurboModuleRegistry } from 'react-native';
10
10
  * - 'critical': The thermal state is critically high.
11
11
  */
12
12
 
13
- /**
14
- * Event payload for thermal state change events.
15
- */
16
-
17
13
  export default TurboModuleRegistry.getEnforcing('Tinykit');
18
14
  //# sourceMappingURL=NativeTinykit.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeTinykit.ts"],"mappings":";;AAAA,SACEA,mBAAmB,QAGd,cAAc;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAWA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeTinykit.ts"],"mappings":";;AAAA,SACEA,mBAAmB,QAGd,cAAc;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]}
@@ -17,6 +17,15 @@ export function getThermalState() {
17
17
  return Tinykit.getThermalState();
18
18
  }
19
19
 
20
+ /**
21
+ * Requests a review of the app.
22
+ *
23
+ * @returns A promise that resolves when the review request is processed.
24
+ */
25
+ export function requestReview() {
26
+ return Tinykit.requestReview();
27
+ }
28
+
20
29
  /**
21
30
  * Callback function type for thermal state change events.
22
31
  */
@@ -27,10 +36,7 @@ export function getThermalState() {
27
36
  * @param listener - Callback function that receives the new thermal state
28
37
  * @returns A subscription object with a remove method to stop listening
29
38
  */
30
- export function addThermalStateListener(listener) {
31
- const subscription = Tinykit.onThermalStateChange(event => {
32
- listener(event.thermalState);
33
- });
34
- return subscription;
39
+ export function onThermalStateChange(listener) {
40
+ return Tinykit.onThermalStateChange(listener);
35
41
  }
36
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Tinykit","restart","getThermalState","addThermalStateListener","listener","subscription","onThermalStateChange","event","thermalState"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,OAAO,MAGP,oBAAiB;AAIxB;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAAA,EAAS;EAC9B,OAAOD,OAAO,CAACC,OAAO,CAAC,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAiB;EAC9C,OAAOF,OAAO,CAACE,eAAe,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,QAA8B,EAEpE;EACA,MAAMC,YAAY,GAAGL,OAAO,CAACM,oBAAoB,CAC9CC,KAA8B,IAAK;IAClCH,QAAQ,CAACG,KAAK,CAACC,YAAY,CAAC;EAC9B,CACF,CAAC;EACD,OAAOH,YAAY;AACrB","ignoreList":[]}
1
+ {"version":3,"names":["Tinykit","restart","getThermalState","requestReview","onThermalStateChange","listener"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,OAAO,MAA6B,oBAAiB;AAI5D;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAAA,EAAS;EAC9B,OAAOD,OAAO,CAACC,OAAO,CAAC,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAiB;EAC9C,OAAOF,OAAO,CAACE,eAAe,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAA,EAAkB;EAC7C,OAAOH,OAAO,CAACG,aAAa,CAAC,CAAC;AAChC;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,QAA8B,EAEjE;EACA,OAAOL,OAAO,CAACI,oBAAoB,CAACC,QAAQ,CAAC;AAC/C","ignoreList":[]}
@@ -7,16 +7,11 @@ import { type TurboModule, type CodegenTypes } from 'react-native';
7
7
  * - 'critical': The thermal state is critically high.
8
8
  */
9
9
  export type ThermalState = 'nominal' | 'fair' | 'serious' | 'critical';
10
- /**
11
- * Event payload for thermal state change events.
12
- */
13
- export type ThermalStateChangeEvent = {
14
- thermalState: ThermalState;
15
- };
16
10
  export interface Spec extends TurboModule {
17
11
  restart(): void;
18
12
  getThermalState(): ThermalState;
19
- readonly onThermalStateChange: CodegenTypes.EventEmitter<ThermalStateChangeEvent>;
13
+ requestReview(): Promise<void>;
14
+ readonly onThermalStateChange: CodegenTypes.EventEmitter<ThermalState>;
20
15
  }
21
16
  declare const _default: Spec;
22
17
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTinykit.d.ts","sourceRoot":"","sources":["../../../src/NativeTinykit.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,OAAO,IAAI,IAAI,CAAC;IAChB,eAAe,IAAI,YAAY,CAAC;IAChC,QAAQ,CAAC,oBAAoB,EAAE,YAAY,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;CACnF;;AAED,wBAAiE"}
1
+ {"version":3,"file":"NativeTinykit.d.ts","sourceRoot":"","sources":["../../../src/NativeTinykit.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAEvE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,OAAO,IAAI,IAAI,CAAC;IAChB,eAAe,IAAI,YAAY,CAAC;IAChC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,YAAY,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;CACxE;;AAED,wBAAiE"}
@@ -1,5 +1,5 @@
1
1
  import { type ThermalState } from './NativeTinykit';
2
- export type { ThermalState, ThermalStateChangeEvent } from './NativeTinykit';
2
+ export type { ThermalState } from './NativeTinykit';
3
3
  /**
4
4
  * Restarts the React Native application.
5
5
  */
@@ -10,6 +10,12 @@ export declare function restart(): void;
10
10
  * @returns The current thermal state: 'nominal', 'fair', 'serious', or 'critical'
11
11
  */
12
12
  export declare function getThermalState(): ThermalState;
13
+ /**
14
+ * Requests a review of the app.
15
+ *
16
+ * @returns A promise that resolves when the review request is processed.
17
+ */
18
+ export declare function requestReview(): Promise<void>;
13
19
  /**
14
20
  * Callback function type for thermal state change events.
15
21
  */
@@ -20,7 +26,7 @@ export type ThermalStateListener = (state: ThermalState) => void;
20
26
  * @param listener - Callback function that receives the new thermal state
21
27
  * @returns A subscription object with a remove method to stop listening
22
28
  */
23
- export declare function addThermalStateListener(listener: ThermalStateListener): {
29
+ export declare function onThermalStateChange(listener: ThermalStateListener): {
24
30
  remove: () => void;
25
31
  };
26
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAgB,EACd,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE7E;;GAEG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,GAAG;IACvE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAOA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE7D,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;GAEG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7C;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,oBAAoB,GAAG;IACpE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAEA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tinykit",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "A lightweight React Native toolkit for iOS, providing essential native utilities (Zero dependencies)",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -13,17 +13,11 @@ import {
13
13
  */
14
14
  export type ThermalState = 'nominal' | 'fair' | 'serious' | 'critical';
15
15
 
16
- /**
17
- * Event payload for thermal state change events.
18
- */
19
- export type ThermalStateChangeEvent = {
20
- thermalState: ThermalState;
21
- };
22
-
23
16
  export interface Spec extends TurboModule {
24
17
  restart(): void;
25
18
  getThermalState(): ThermalState;
26
- readonly onThermalStateChange: CodegenTypes.EventEmitter<ThermalStateChangeEvent>;
19
+ requestReview(): Promise<void>;
20
+ readonly onThermalStateChange: CodegenTypes.EventEmitter<ThermalState>;
27
21
  }
28
22
 
29
23
  export default TurboModuleRegistry.getEnforcing<Spec>('Tinykit');
package/src/index.tsx CHANGED
@@ -1,9 +1,6 @@
1
- import Tinykit, {
2
- type ThermalState,
3
- type ThermalStateChangeEvent,
4
- } from './NativeTinykit';
1
+ import Tinykit, { type ThermalState } from './NativeTinykit';
5
2
 
6
- export type { ThermalState, ThermalStateChangeEvent } from './NativeTinykit';
3
+ export type { ThermalState } from './NativeTinykit';
7
4
 
8
5
  /**
9
6
  * Restarts the React Native application.
@@ -21,6 +18,15 @@ export function getThermalState(): ThermalState {
21
18
  return Tinykit.getThermalState();
22
19
  }
23
20
 
21
+ /**
22
+ * Requests a review of the app.
23
+ *
24
+ * @returns A promise that resolves when the review request is processed.
25
+ */
26
+ export function requestReview(): Promise<void> {
27
+ return Tinykit.requestReview();
28
+ }
29
+
24
30
  /**
25
31
  * Callback function type for thermal state change events.
26
32
  */
@@ -32,13 +38,8 @@ export type ThermalStateListener = (state: ThermalState) => void;
32
38
  * @param listener - Callback function that receives the new thermal state
33
39
  * @returns A subscription object with a remove method to stop listening
34
40
  */
35
- export function addThermalStateListener(listener: ThermalStateListener): {
41
+ export function onThermalStateChange(listener: ThermalStateListener): {
36
42
  remove: () => void;
37
43
  } {
38
- const subscription = Tinykit.onThermalStateChange(
39
- (event: ThermalStateChangeEvent) => {
40
- listener(event.thermalState);
41
- }
42
- );
43
- return subscription;
44
+ return Tinykit.onThermalStateChange(listener);
44
45
  }