{"version":3,"file":"index.mjs","names":[],"sources":["../../../../node_modules/.bun/craby-modules@0.1.0-rc.4+078b017339bf9ec6/node_modules/craby-modules/dist/index.mjs","../../src-reactnative/NativeReactNative.ts"],"sourcesContent":["import { Platform, TurboModuleRegistry } from \"react-native\";\n\n//#region src/index.ts\n/**\n* Android JNI initialization workaround\n*\n* We need `filesDir` of `Context` for JNI initialization, but it's unavailable during `PackageList` construction.\n* The context is only passed when React Native calls `BaseReactPackage.getModule()`.\n*\n* Workaround: Load a dummy module to trigger `getModule()` before the actual module.\n*\n* - 1. Request non-existent module → triggers `getModule()`\n* - 2. `getModule()` receives `ReactApplicationContext`\n*   - 2-1. Calls `nativeSetDataPath()` (C++ extern function) to set `context.filesDir.absolutePath`\n*   - 2-2. Returns placeholder module (no-op) instance (Actual C++ TurboModule is now can be initialized with the required values)\n*\n* @param moduleName The name of the module to prepare.\n*/\nfunction prepareJNI(moduleName) {\n\tif (Platform.OS !== \"android\") return;\n\tTurboModuleRegistry.get(`__craby${moduleName}_JNI_prepare__`);\n}\nconst NativeModuleRegistry = {\n\tget(moduleName) {\n\t\tprepareJNI(moduleName);\n\t\treturn TurboModuleRegistry.get(moduleName);\n\t},\n\tgetEnforcing(moduleName) {\n\t\tprepareJNI(moduleName);\n\t\treturn TurboModuleRegistry.getEnforcing(moduleName);\n\t}\n};\n\n//#endregion\nexport { NativeModuleRegistry };","import type { NativeModule } from 'craby-modules';\nimport { NativeModuleRegistry } from 'craby-modules';\n\nexport interface ToMarkdownOptions {\n  imageOutputDir: string | null;\n  image: string | null;\n  useHtml: boolean;\n  includeVersion: boolean;\n  includePageInfo: boolean;\n}\n\nexport interface ImageData {\n  id: string;\n  data: ArrayBuffer;\n  format: string;\n}\n\nexport interface ToMarkdownResult {\n  markdown: string;\n}\n\n// NOTE: toPdf는 아직 지원하지 않으므로 비활성화 (추후 활성화 예정)\n// export interface ToPdfOptions {\n//   fontDir: string | null;\n//   embedImages: boolean;\n// }\n\ninterface Spec extends NativeModule {\n  toJson(data: ArrayBuffer): string;\n  toMarkdown(data: ArrayBuffer, options: ToMarkdownOptions): ToMarkdownResult;\n  // toPdf(data: ArrayBuffer, options: ToPdfOptions): ArrayBuffer;\n  fileHeader(data: ArrayBuffer): string;\n}\n\nexport default NativeModuleRegistry.getEnforcing<Spec>('Hwpjs');\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAS,WAAW,YAAY;AAC/B,KAAI,SAAS,OAAO,UAAW;AAC/B,qBAAoB,IAAI,UAAU,WAAW,gBAAgB;;AAE9D,MAAM,uBAAuB;CAC5B,IAAI,YAAY;AACf,aAAW,WAAW;AACtB,SAAO,oBAAoB,IAAI,WAAW;;CAE3C,aAAa,YAAY;AACxB,aAAW,WAAW;AACtB,SAAO,oBAAoB,aAAa,WAAW;;CAEpD;;;;ACGD,gCAAe,qBAAqB,aAAmB,QAAQ"}