h3-print 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## Unpublished
4
+
5
+ ### ๐Ÿ›  Breaking changes
6
+
7
+ ### ๐ŸŽ‰ New features
8
+
9
+ ### ๐Ÿ› Bug fixes
10
+
11
+ ### ๐Ÿ’ก Others
package/README.md ADDED
@@ -0,0 +1,110 @@
1
+ # h3-print
2
+
3
+ Silent printing module for Expo Android - supports HTML to PDF conversion and direct thermal printing without system dialog.
4
+
5
+ ## Installation
6
+ ```bash
7
+ npm install h3-print
8
+ # or
9
+ yarn add h3-print
10
+ ```
11
+
12
+ ## Features
13
+
14
+ - ๐Ÿ–จ๏ธ Silent printing (bypasses Android print dialog)
15
+ - ๐Ÿ“„ HTML to PDF conversion
16
+ - ๐Ÿงพ Optimized for thermal/receipt printers
17
+ - ๐Ÿ“ฑ Works with custom Android print services
18
+ - โšก ESC/POS command support
19
+
20
+ ## Usage
21
+
22
+ ### Basic HTML Printing
23
+ ```typescript
24
+ import * as H3Print from 'h3-print';
25
+
26
+ const html = `
27
+ <html>
28
+ <body>
29
+ <h1>Receipt</h1>
30
+ <p>Thank you for your purchase!</p>
31
+ </body>
32
+ </html>
33
+ `;
34
+
35
+ const result = await H3Print.printHtmlAsPdf(html, {
36
+ pageWidth: 384, // 48mm at 203dpi
37
+ packageName: 'com.bld.settings.print', // Your device's print service
38
+ });
39
+
40
+ console.log(result);
41
+ ```
42
+
43
+ ### Check Print Service Availability
44
+ ```typescript
45
+ const status = await H3Print.isPrintServiceAvailable();
46
+ console.log('Available:', status.available);
47
+ ```
48
+
49
+ ### List Available Print Services
50
+ ```typescript
51
+ const packages = await H3Print.getAllPrintCapablePackages();
52
+ console.log('Print services:', packages);
53
+ ```
54
+
55
+ ## API
56
+
57
+ ### Main Functions
58
+
59
+ | Function | Description |
60
+ |----------|-------------|
61
+ | `printHtmlAsPdf(html, options?)` | Convert HTML to PDF and print silently |
62
+ | `generatePdfFromHtml(html, options?)` | Generate PDF without printing |
63
+ | `printPdf(filePath, packageName?)` | Print existing PDF file |
64
+ | `printText(text, packageName?)` | Print plain text |
65
+ | `printRaw(data, packageName?)` | Print raw ESC/POS bytes |
66
+
67
+ ### Options
68
+ ```typescript
69
+ interface PdfOptions {
70
+ pageWidth?: number; // Default: 384 (48mm at 203dpi)
71
+ pageHeight?: number; // Default: 0 (auto)
72
+ fileName?: string; // Custom filename
73
+ packageName?: string; // Print service package
74
+ saveToPublic?: boolean; // Save to Documents folder
75
+ }
76
+ ```
77
+
78
+ ## Requirements
79
+
80
+ - Expo SDK 51+
81
+ - Android device with a compatible print service
82
+
83
+ ## License
84
+
85
+ MIT
86
+ ```
87
+
88
+ ### LICENSE
89
+ ```
90
+ MIT License
91
+
92
+ Copyright (c) 2024 cob-byte
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy
95
+ of this software and associated documentation files (the "Software"), to deal
96
+ in the Software without restriction, including without limitation the rights
97
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
98
+ copies of the Software, and to permit persons to whom the Software is
99
+ furnished to do so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ SOFTWARE.
@@ -0,0 +1,72 @@
1
+ apply plugin: 'com.android.library'
2
+
3
+ group = 'expo.modules.h3print'
4
+ version = '1.0.0'
5
+
6
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
+ if (expoModulesCorePlugin.exists()) {
8
+ apply from: expoModulesCorePlugin
9
+ applyKotlinExpoModulesCorePlugin()
10
+ useCoreDependencies()
11
+ useExpoPublishing()
12
+ }
13
+
14
+ buildscript {
15
+ ext.safeExtGet = { prop, fallback ->
16
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
17
+ }
18
+ }
19
+
20
+ android {
21
+ namespace "expo.modules.h3print"
22
+
23
+ compileSdkVersion safeExtGet("compileSdkVersion", 34)
24
+
25
+ defaultConfig {
26
+ minSdkVersion safeExtGet("minSdkVersion", 24)
27
+ targetSdkVersion safeExtGet("targetSdkVersion", 34)
28
+ versionCode 1
29
+ versionName "1.0.0"
30
+ }
31
+
32
+ buildTypes {
33
+ release {
34
+ minifyEnabled false
35
+ }
36
+ }
37
+
38
+ compileOptions {
39
+ sourceCompatibility JavaVersion.VERSION_17
40
+ targetCompatibility JavaVersion.VERSION_17
41
+ }
42
+
43
+ kotlinOptions {
44
+ jvmTarget = "17"
45
+ }
46
+
47
+ lintOptions {
48
+ abortOnError false
49
+ disable 'InvalidPackage'
50
+ }
51
+
52
+ packagingOptions {
53
+ exclude 'META-INF/DEPENDENCIES'
54
+ exclude 'META-INF/LICENSE'
55
+ exclude 'META-INF/LICENSE.txt'
56
+ exclude 'META-INF/license.txt'
57
+ exclude 'META-INF/NOTICE'
58
+ exclude 'META-INF/NOTICE.txt'
59
+ exclude 'META-INF/notice.txt'
60
+ }
61
+ }
62
+
63
+ repositories {
64
+ mavenCentral()
65
+ google()
66
+ }
67
+
68
+ dependencies {
69
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.22"
70
+ implementation "androidx.core:core-ktx:1.12.0"
71
+ implementation "androidx.appcompat:appcompat:1.6.1"
72
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Result returned from print operations
3
+ */
4
+ export type PrintResult = {
5
+ success: boolean;
6
+ message?: string;
7
+ pdfPath?: string;
8
+ fileName?: string;
9
+ };
10
+ /**
11
+ * Result from checking print service availability
12
+ */
13
+ export type PrintServiceStatus = {
14
+ available: boolean;
15
+ packageExists?: boolean;
16
+ canHandlePdf?: boolean;
17
+ packageName: string;
18
+ error?: string;
19
+ };
20
+ /**
21
+ * Information about a print-capable package
22
+ */
23
+ export type PrintPackageInfo = {
24
+ packageName: string;
25
+ activityName: string;
26
+ label: string;
27
+ supportedTypes?: string[];
28
+ };
29
+ /**
30
+ * Options for PDF generation
31
+ */
32
+ export type PdfOptions = {
33
+ /** Width of the page in pixels (default: 384 for 48mm thermal) */
34
+ pageWidth?: number;
35
+ /** Height of the page in pixels (0 = auto height based on content) */
36
+ pageHeight?: number;
37
+ /** Custom file name without extension */
38
+ fileName?: string;
39
+ /** Save to public Documents folder instead of cache */
40
+ saveToPublic?: boolean;
41
+ /** Target print package name */
42
+ packageName?: string;
43
+ };
44
+ /**
45
+ * Options for printing HTML as PDF
46
+ */
47
+ export type PrintHtmlOptions = PdfOptions;
48
+ /**
49
+ * Result from cleanup operation
50
+ */
51
+ export type CleanupResult = {
52
+ success: boolean;
53
+ deletedCount: number;
54
+ deletedFiles: string[];
55
+ };
56
+ /**
57
+ * Module information
58
+ */
59
+ export type ModuleInfo = {
60
+ name: string;
61
+ version: string;
62
+ defaultPrintPackage: string;
63
+ supportedFeatures: string[];
64
+ };
65
+ /**
66
+ * Events emitted by the module
67
+ */
68
+ export type H3PrintModuleEvents = {
69
+ onPrintSuccess: (params: {
70
+ pdfPath: string;
71
+ }) => void;
72
+ onPrintError: (params: {
73
+ error: string;
74
+ }) => void;
75
+ onPdfGenerated: (params: {
76
+ pdfPath: string;
77
+ }) => void;
78
+ };
79
+ /**
80
+ * ESC/POS command type
81
+ */
82
+ export type EscPosCommand = number[];
83
+ /**
84
+ * Receipt template data (example structure)
85
+ */
86
+ export type ReceiptTemplateData = {
87
+ numberDisplay: string;
88
+ fontSize?: string;
89
+ box1Visible: boolean;
90
+ box1Name?: string;
91
+ box1Amount?: number | string;
92
+ box2Visible: boolean;
93
+ box2Name?: string;
94
+ box2Amount?: number | string;
95
+ totalAmount: number | string;
96
+ formattedDate: string;
97
+ formattedTime: string;
98
+ kubradorName: string;
99
+ bettorName: string;
100
+ transactionNumber: string;
101
+ gameType: string;
102
+ drawTime: string;
103
+ qrCodeBase64?: string;
104
+ };
105
+ //# sourceMappingURL=H3Print.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"H3Print.types.d.ts","sourceRoot":"","sources":["../src/H3Print.types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ // ============================================================
2
+ // Type Definitions for H3Print Module
3
+ // ============================================================
4
+ export {};
5
+ //# sourceMappingURL=H3Print.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"H3Print.types.js","sourceRoot":"","sources":["../src/H3Print.types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,sCAAsC;AACtC,+DAA+D","sourcesContent":["// ============================================================\n// Type Definitions for H3Print Module\n// ============================================================\n\n/**\n * Result returned from print operations\n */\nexport type PrintResult = {\n success: boolean;\n message?: string;\n pdfPath?: string;\n fileName?: string;\n};\n\n/**\n * Result from checking print service availability\n */\nexport type PrintServiceStatus = {\n available: boolean;\n packageExists?: boolean;\n canHandlePdf?: boolean;\n packageName: string;\n error?: string;\n};\n\n/**\n * Information about a print-capable package\n */\nexport type PrintPackageInfo = {\n packageName: string;\n activityName: string;\n label: string;\n supportedTypes?: string[];\n};\n\n/**\n * Options for PDF generation\n */\nexport type PdfOptions = {\n /** Width of the page in pixels (default: 384 for 48mm thermal) */\n pageWidth?: number;\n /** Height of the page in pixels (0 = auto height based on content) */\n pageHeight?: number;\n /** Custom file name without extension */\n fileName?: string;\n /** Save to public Documents folder instead of cache */\n saveToPublic?: boolean;\n /** Target print package name */\n packageName?: string;\n};\n\n/**\n * Options for printing HTML as PDF\n */\nexport type PrintHtmlOptions = PdfOptions;\n\n/**\n * Result from cleanup operation\n */\nexport type CleanupResult = {\n success: boolean;\n deletedCount: number;\n deletedFiles: string[];\n};\n\n/**\n * Module information\n */\nexport type ModuleInfo = {\n name: string;\n version: string;\n defaultPrintPackage: string;\n supportedFeatures: string[];\n};\n\n/**\n * Events emitted by the module\n */\nexport type H3PrintModuleEvents = {\n onPrintSuccess: (params: { pdfPath: string }) => void;\n onPrintError: (params: { error: string }) => void;\n onPdfGenerated: (params: { pdfPath: string }) => void;\n};\n\n/**\n * ESC/POS command type\n */\nexport type EscPosCommand = number[];\n\n/**\n * Receipt template data (example structure)\n */\nexport type ReceiptTemplateData = {\n numberDisplay: string;\n fontSize?: string;\n box1Visible: boolean;\n box1Name?: string;\n box1Amount?: number | string;\n box2Visible: boolean;\n box2Name?: string;\n box2Amount?: number | string;\n totalAmount: number | string;\n formattedDate: string;\n formattedTime: string;\n kubradorName: string;\n bettorName: string;\n transactionNumber: string;\n gameType: string;\n drawTime: string;\n qrCodeBase64?: string;\n};"]}
@@ -0,0 +1,22 @@
1
+ import { NativeModule } from 'expo';
2
+ import type { H3PrintModuleEvents, PrintResult, PrintServiceStatus, PrintPackageInfo, PdfOptions, CleanupResult, ModuleInfo } from './H3Print.types';
3
+ /**
4
+ * Native module interface declaration
5
+ */
6
+ declare class H3PrintModuleType extends NativeModule<H3PrintModuleEvents> {
7
+ printHtmlAsPdf(html: string, options?: PdfOptions | null): Promise<PrintResult>;
8
+ generatePdfFromHtml(html: string, options?: PdfOptions | null): Promise<PrintResult>;
9
+ printPdf(filePath: string, packageName?: string | null): Promise<PrintResult>;
10
+ printText(text: string, packageName?: string | null): Promise<PrintResult>;
11
+ printRaw(data: number[], packageName?: string | null): Promise<PrintResult>;
12
+ printFileByPath(filePath: string, mimeType?: string | null, packageName?: string | null): Promise<PrintResult>;
13
+ printFileByUri(filePath: string, mimeType?: string | null, packageName?: string | null): Promise<PrintResult>;
14
+ isPrintServiceAvailable(packageName?: string | null): Promise<PrintServiceStatus>;
15
+ listPrintPackages(): Promise<PrintPackageInfo[]>;
16
+ getAllPrintCapablePackages(): Promise<PrintPackageInfo[]>;
17
+ cleanupTempFiles(): Promise<CleanupResult>;
18
+ getModuleInfo(): ModuleInfo;
19
+ }
20
+ declare const _default: H3PrintModuleType;
21
+ export default _default;
22
+ //# sourceMappingURL=H3PrintModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"H3PrintModule.d.ts","sourceRoot":"","sources":["../src/H3PrintModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AACzD,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,OAAO,OAAO,iBAAkB,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IAEvE,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAG/E,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAGpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAG7E,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAG1E,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAG3E,eAAe,CACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAC1B,OAAO,CAAC,WAAW,CAAC;IAGvB,cAAc,CACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAC1B,OAAO,CAAC,WAAW,CAAC;IAGvB,uBAAuB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAGjF,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAGhD,0BAA0B,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAGzD,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;IAG1C,aAAa,IAAI,UAAU;CAC5B;;AAGD,wBAAiE"}
@@ -0,0 +1,4 @@
1
+ import { requireNativeModule } from 'expo';
2
+ // Export the native module
3
+ export default requireNativeModule('H3Print');
4
+ //# sourceMappingURL=H3PrintModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"H3PrintModule.js","sourceRoot":"","sources":["../src/H3PrintModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AA4DzD,2BAA2B;AAC3B,eAAe,mBAAmB,CAAoB,SAAS,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\nimport type {\n H3PrintModuleEvents,\n PrintResult,\n PrintServiceStatus,\n PrintPackageInfo,\n PdfOptions,\n CleanupResult,\n ModuleInfo,\n} from './H3Print.types';\n\n/**\n * Native module interface declaration\n */\ndeclare class H3PrintModuleType extends NativeModule<H3PrintModuleEvents> {\n // Main HTML to PDF printing\n printHtmlAsPdf(html: string, options?: PdfOptions | null): Promise<PrintResult>;\n\n // Generate PDF without printing\n generatePdfFromHtml(html: string, options?: PdfOptions | null): Promise<PrintResult>;\n\n // Print existing PDF file\n printPdf(filePath: string, packageName?: string | null): Promise<PrintResult>;\n\n // Print plain text\n printText(text: string, packageName?: string | null): Promise<PrintResult>;\n\n // Print raw bytes (ESC/POS)\n printRaw(data: number[], packageName?: string | null): Promise<PrintResult>;\n\n // Print file using path (your discovered intent pattern)\n printFileByPath(\n filePath: string,\n mimeType?: string | null,\n packageName?: string | null\n ): Promise<PrintResult>;\n\n // Print file using URI\n printFileByUri(\n filePath: string,\n mimeType?: string | null,\n packageName?: string | null\n ): Promise<PrintResult>;\n\n // Check print service availability\n isPrintServiceAvailable(packageName?: string | null): Promise<PrintServiceStatus>;\n\n // List print packages\n listPrintPackages(): Promise<PrintPackageInfo[]>;\n\n // Get all print-capable packages\n getAllPrintCapablePackages(): Promise<PrintPackageInfo[]>;\n\n // Cleanup temporary files\n cleanupTempFiles(): Promise<CleanupResult>;\n\n // Get module info (synchronous)\n getModuleInfo(): ModuleInfo;\n}\n\n// Export the native module\nexport default requireNativeModule<H3PrintModuleType>('H3Print');"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './H3PrintModule';
2
+ export * from './H3Print.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,cAAe,iBAAiB,CAAC"}
package/build/index.js ADDED
@@ -0,0 +1,5 @@
1
+ // Reexport the native module. On web, it will be resolved to H3PrintModule.web.ts
2
+ // and on native platforms to H3PrintModule.ts
3
+ export { default } from './H3PrintModule';
4
+ export * from './H3Print.types';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,8CAA8C;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,cAAe,iBAAiB,CAAC","sourcesContent":["// Reexport the native module. On web, it will be resolved to H3PrintModule.web.ts\n// and on native platforms to H3PrintModule.ts\nexport { default } from './H3PrintModule';\nexport * from './H3Print.types';\n"]}
@@ -0,0 +1,9 @@
1
+ {
2
+ "platforms": ["android"],
3
+ "apple": {
4
+ "modules": ["H3PrintModule"]
5
+ },
6
+ "android": {
7
+ "modules": ["expo.modules.h3print.H3PrintModule"]
8
+ }
9
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "h3-print",
3
+ "version": "1.0.0",
4
+ "description": "Silent printing module for Expo Android - supports HTML to PDF conversion and direct thermal printing",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "scripts": {
8
+ "build": "expo-module build",
9
+ "clean": "expo-module clean",
10
+ "lint": "expo-module lint",
11
+ "test": "expo-module test",
12
+ "prepare": "expo-module prepare",
13
+ "prepublishOnly": "expo-module prepublishOnly",
14
+ "expo-module": "expo-module",
15
+ "open:android": "open -a \"Android Studio\" example/android"
16
+ },
17
+ "keywords": [
18
+ "react-native",
19
+ "expo",
20
+ "expo-module",
21
+ "print",
22
+ "silent-print",
23
+ "thermal-printer",
24
+ "receipt",
25
+ "pdf",
26
+ "html-to-pdf",
27
+ "android",
28
+ "pos",
29
+ "esc-pos"
30
+ ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/Hakoblot/h3-print"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/Hakoblot/h3-print/issues"
37
+ },
38
+ "author": "cob-byte <jacob.barcelona@linoflaptech.com>",
39
+ "license": "MIT",
40
+ "homepage": "https://github.com/Hakoblot/h3-print#readme",
41
+ "dependencies": {},
42
+ "devDependencies": {
43
+ "@types/react": "~19.1.0",
44
+ "expo-module-scripts": "^5.0.8",
45
+ "expo": "^54.0.27",
46
+ "react-native": "0.81.5",
47
+ "typescript": "^5.3.0"
48
+ },
49
+ "peerDependencies": {
50
+ "expo": "*",
51
+ "react": "*",
52
+ "react-native": "*"
53
+ }
54
+ }