Skip to content

Commit 37c93f5

Browse files
Merge pull request #3 from isaacfilarski/feature/typings
Add return type File to createPdf
2 parents b3a9e6e + 56b52b9 commit 37c93f5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NativeModules } from 'react-native';
22
import { type ImageObjectNative } from './NativePdfFromImage';
33
import { paperSizes } from './contants';
4-
import type { ImageObjectJs } from './types';
4+
import type { File, ImageObjectJs } from './types';
55

66
// @ts-ignore We want to check whether __turboModuleProxy exitst, it may not
77
const isTurboModuleEnabled = global.__turboModuleProxy != null;
@@ -10,7 +10,7 @@ const pdffromimage = isTurboModuleEnabled
1010
? require('./NativePdfFromImage').default
1111
: NativeModules.PdfFromImage;
1212

13-
export function createPdf(params: ImageObjectJs) {
13+
export function createPdf(params: ImageObjectJs): File {
1414
// Sanitize document name by removing file extension
1515
const sanitizedName = params.name.replace(/\.[^/.]+$/, '');
1616

src/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ export type ImageObjectJs = {
4141
| 'Executive'
4242
| 'Folio';
4343
};
44+
45+
export type File = {
46+
filePath: string;
47+
};

0 commit comments

Comments
 (0)