react-native-attachment-kit 1.0.5 โ†’ 1.0.8

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +100 -3
  3. package/android/build.gradle +14 -0
  4. package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
  5. package/android/src/newarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +280 -13
  6. package/android/src/oldarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +282 -13
  7. package/ios/RNAttachmentKit.m +18 -0
  8. package/ios/RNAttachmentKit.swift +447 -9
  9. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Assets.car +0 -0
  10. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Headers/RNAttachmentKit-Swift.h +21 -5
  11. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Info.plist +0 -0
  12. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +33440 -7566
  13. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface +193 -5
  14. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  15. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface +193 -5
  16. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  17. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  18. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeResources +15 -15
  19. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeSignature +0 -0
  20. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Assets.car +0 -0
  21. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Headers/RNAttachmentKit-Swift.h +42 -10
  22. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Info.plist +0 -0
  23. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +33440 -7566
  24. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +193 -5
  25. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  26. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +193 -5
  27. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +33440 -7566
  28. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +193 -5
  29. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  30. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +193 -5
  31. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  32. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  33. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeResources +25 -25
  34. package/package.json +2 -2
  35. package/react-native-attachment-kit.podspec +1 -1
  36. package/src/NativeAttachmentKit.ts +5 -0
  37. package/src/index.ts +118 -7
  38. package/src/types.ts +173 -0
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Assets.car</key>
8
8
  <data>
9
- 24XBU3LEblGjGTOAqjhqZ+mB2U0=
9
+ MRss66st77g0KhHxCBbJQfKPil4=
10
10
  </data>
11
11
  <key>Base.lproj/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key>
12
12
  <data>
@@ -22,51 +22,51 @@
22
22
  </data>
23
23
  <key>Headers/RNAttachmentKit-Swift.h</key>
24
24
  <data>
25
- 4lqGZdGnjvCCDxNRFc2GgyyzqyE=
25
+ SA2Uv/xUxXBayyyXE8H2RjgdHQA=
26
26
  </data>
27
27
  <key>Info.plist</key>
28
28
  <data>
29
- 0sC7XVCqX43alae4JC2p56Wh1F4=
29
+ VGVHsdYWxmrpkpVKbSFeY69ecnY=
30
30
  </data>
31
31
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
32
32
  <data>
33
- yzVs+k0n+fAWBNbxtMQPWwrjRN0=
33
+ FC2zf1jZnueKAakmwRvTrB9xiFk=
34
34
  </data>
35
35
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
36
36
  <data>
37
- 3d+7crlvM8P5/XPlmAcyIbpS6zs=
37
+ QViRQdPRlGSnejc+FkklUFb1xzo=
38
38
  </data>
39
39
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
40
40
  <data>
41
- 3Y+Yb6iItYSkNObvNxCJpXncvHQ=
41
+ 13waPrbWcS1Vv7tMDqh9IORrbTU=
42
42
  </data>
43
43
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
44
44
  <data>
45
- 3d+7crlvM8P5/XPlmAcyIbpS6zs=
45
+ QViRQdPRlGSnejc+FkklUFb1xzo=
46
46
  </data>
47
47
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
48
48
  <data>
49
- pTw5/RKAzDXtx8rwalHKzC1QVrw=
49
+ vxYcaOMhuUnqhRHLBIJ08g7Poz8=
50
50
  </data>
51
51
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
52
52
  <data>
53
- yzVs+k0n+fAWBNbxtMQPWwrjRN0=
53
+ FC2zf1jZnueKAakmwRvTrB9xiFk=
54
54
  </data>
55
55
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
56
56
  <data>
57
- YZtIbnfcDasieXiHsoxa0r1/Hkc=
57
+ 4Bhyu9pqG8QPG8JDzN15Es69LgQ=
58
58
  </data>
59
59
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
60
60
  <data>
61
- 174LWJPXzjBzOETdSc+BKgsj/ig=
61
+ 9aHuRlxlcUm5c6hoS03l0x+rd+8=
62
62
  </data>
63
63
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
64
64
  <data>
65
- YZtIbnfcDasieXiHsoxa0r1/Hkc=
65
+ 4Bhyu9pqG8QPG8JDzN15Es69LgQ=
66
66
  </data>
67
67
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
68
68
  <data>
69
- brFa0/Ksy3av4Ce56nRbOQSY1c0=
69
+ H6BZLJRWSEbtZxoVbtor+kQqH4A=
70
70
  </data>
71
71
  <key>Modules/module.modulemap</key>
72
72
  <data>
@@ -227,7 +227,7 @@
227
227
  <dict>
228
228
  <key>hash2</key>
229
229
  <data>
230
- hcxV/4NZu79SXIpwsHu8Fo8WVAZLQfuKhITugdLFV+I=
230
+ PN8SGeEYmroH8IKhC4cAPpqrFa8xoBCtF2CRXH0MgEA=
231
231
  </data>
232
232
  </dict>
233
233
  <key>Base.lproj/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key>
@@ -255,77 +255,77 @@
255
255
  <dict>
256
256
  <key>hash2</key>
257
257
  <data>
258
- jP+jiNnXhkOKTRJb5kKT4Skcl3imtlmW8htzvrG/9B8=
258
+ CIsiqD4QUiiFinw84KecZtVO9t4RF+3C362HoLNyZiA=
259
259
  </data>
260
260
  </dict>
261
261
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
262
262
  <dict>
263
263
  <key>hash2</key>
264
264
  <data>
265
- wPEN6QtxVqoCbCp/z3rYhGT5QOE2vKZR2uHf1sFkKcQ=
265
+ qtO0CZnvzwP16BEJ2c8k4epzursuYOewuXDMvEuLD3k=
266
266
  </data>
267
267
  </dict>
268
268
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
269
269
  <dict>
270
270
  <key>hash2</key>
271
271
  <data>
272
- PCJzsbciCPQjQ+8d1NaEqra2tG6IhnKGxArWy0tMCNU=
272
+ bQBBzPNGBXPENE5stiQHn43HpKljGLBGsmytx74osv8=
273
273
  </data>
274
274
  </dict>
275
275
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
276
276
  <dict>
277
277
  <key>hash2</key>
278
278
  <data>
279
- IqlfotL45Jo1H46fYK8QlNdsrWP+Wc4omyD8Ei0M38Y=
279
+ c5sCwczWvgTgfE4P3/QZXLg4Ju1YyiBkHe8mlkacRzs=
280
280
  </data>
281
281
  </dict>
282
282
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
283
283
  <dict>
284
284
  <key>hash2</key>
285
285
  <data>
286
- PCJzsbciCPQjQ+8d1NaEqra2tG6IhnKGxArWy0tMCNU=
286
+ bQBBzPNGBXPENE5stiQHn43HpKljGLBGsmytx74osv8=
287
287
  </data>
288
288
  </dict>
289
289
  <key>Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
290
290
  <dict>
291
291
  <key>hash2</key>
292
292
  <data>
293
- +69q+F1mVqbDKIgKGmPaw7Oh0Evf2i4ESrGeEAa4b94=
293
+ QYe4TAel3zohjG3Va4rjTXrpDxq7B321XftFkE+yV08=
294
294
  </data>
295
295
  </dict>
296
296
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
297
297
  <dict>
298
298
  <key>hash2</key>
299
299
  <data>
300
- wPEN6QtxVqoCbCp/z3rYhGT5QOE2vKZR2uHf1sFkKcQ=
300
+ qtO0CZnvzwP16BEJ2c8k4epzursuYOewuXDMvEuLD3k=
301
301
  </data>
302
302
  </dict>
303
303
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
304
304
  <dict>
305
305
  <key>hash2</key>
306
306
  <data>
307
- +c23Df2P+F8jTw46r7Qo0C11WzQMkRn3zQP3nOBtOng=
307
+ ruMrsqQu7c5vBjEKp/hzHz82QST/UnwbWCTHD3uGgqM=
308
308
  </data>
309
309
  </dict>
310
310
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
311
311
  <dict>
312
312
  <key>hash2</key>
313
313
  <data>
314
- oh5aRAAJiHhK6wJJLdK4eEzb5vdFcETRW28KyIXHj0g=
314
+ l+6rzGzrcNz6C1xQixmxJnTj6bp8QFLvi01FhSTniOA=
315
315
  </data>
316
316
  </dict>
317
317
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
318
318
  <dict>
319
319
  <key>hash2</key>
320
320
  <data>
321
- +c23Df2P+F8jTw46r7Qo0C11WzQMkRn3zQP3nOBtOng=
321
+ ruMrsqQu7c5vBjEKp/hzHz82QST/UnwbWCTHD3uGgqM=
322
322
  </data>
323
323
  </dict>
324
324
  <key>Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
325
325
  <dict>
326
326
  <key>hash2</key>
327
327
  <data>
328
- hC7shtU5k+++O06+9Yl5UBbBKbXd0idJRMcEokgi3Co=
328
+ ThGXvJl+h56CfaVaUxPIvX289ZySMuF5rCfa478xQRo=
329
329
  </data>
330
330
  </dict>
331
331
  <key>Modules/module.modulemap</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-attachment-kit",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "description": "Native attachment kit for React Native โ€” gallery picker, editor, image viewer and media gallery (Turbo Module)",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -65,4 +65,4 @@
65
65
  "type": "git",
66
66
  "url": "https://github.com/Usomnia/react-native-attachment-kit.git"
67
67
  }
68
- }
68
+ }
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
26
26
  }
27
27
 
28
28
  s.vendored_frameworks = "ios/RNAttachmentKit.xcframework"
29
- s.frameworks = "MapKit", "CoreLocation", "UniformTypeIdentifiers" # ์ฒจ๋ถ€ ๋ฉ”๋‰ด > ์œ„์น˜ยทํŒŒ์ผ ํƒญ
29
+ s.frameworks = "MapKit", "CoreLocation", "UniformTypeIdentifiers", "Vision", "CryptoKit", "CoreMotion" # ์œ„์น˜ยทํŒŒ์ผ ํƒญ / AI ํŽธ์ง‘ ์‚ฌ์ง„ ๋ถ„์„ยท์บ์‹œ / ์นด๋ฉ”๋ผ ๊ธฐ๊ธฐ ๋ฐฉํ–ฅ
30
30
 
31
31
  # s.dependency "SDWebImageWebPCoder"
32
32
 
@@ -7,6 +7,8 @@ export interface Spec extends TurboModule {
7
7
  openEditor(options: Object): Promise<Object>;
8
8
  openViewer(options: Object): Promise<void>;
9
9
  closeGallery(): Promise<boolean>;
10
+ /** ๋™์˜์ƒ ๋ณ€ํ™˜ ์ทจ์†Œ. index -1 = ๋‚จ์€ ๋™์˜์ƒ ์ „๋ถ€, processingId "" = ๊ฐ€์žฅ ์ตœ๊ทผ ์ฒ˜๋ฆฌ */
11
+ cancelVideoProcessing(index: number, processingId: string): Promise<boolean>;
10
12
 
11
13
  // RCTEventEmitter ํ•„์ˆ˜ ๊ทœ๊ฒฉ (Turbo Module์—์„œ ์ด๋ฒคํŠธ ๋ฐฉ์ถœ ์‹œ ํ•„์ˆ˜)
12
14
  addListener(eventName: string): void;
@@ -26,6 +28,9 @@ export interface Spec extends TurboModule {
26
28
  reverseGeocode(options: Object): Promise<Object>;
27
29
  clearReverseGeocodeCache(): Promise<void>;
28
30
 
31
+ // AI ๊ธฐ๋Šฅ ์„ค์ •ยท์ž”์•ก (๋„˜๊ธด ๊ฐ’๋งŒ ๋ฐ”๋€œ). ์‚ฌ์šฉยท์ถฉ์ „ ์š”์ฒญ์€ onAIUsage / onAIChargeRequired ์ด๋ฒคํŠธ
32
+ setAIConfig(config: Object): Promise<void>;
33
+
29
34
  // ๋ฏธ๋””์–ด ๊ฐค๋Ÿฌ๋ฆฌ (์‚ฌ์ง„ ๋ชจ์•„๋ณด๊ธฐ)
30
35
  openMediaGallery(options: Object): Promise<Object>;
31
36
  closeMediaGallery(galleryId: string): Promise<void>;
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { NativeModules, Platform, TurboModuleRegistry, NativeEventEmitter, DeviceEventEmitter } from "react-native"
2
- import type { ImageResult, GalleryOptions, EditorOptions, SelectionChangeEvent, ViewerOptions, MediaGalleryOptions, MediaGalleryAppendPayload, MediaGalleryRemovePayload, Appearance } from "./types"
2
+ import type { ImageResult, GalleryOptions, EditorOptions, SelectionChangeEvent, ViewerOptions, MediaGalleryOptions, MediaGalleryAppendPayload, MediaGalleryRemovePayload, Appearance, AIConfig, AIUsageEvent, AIChargeRequiredEvent } from "./types"
3
3
 
4
4
  const LINKING_ERROR = `The package 'react-native-attachment-kit' doesn't seem to be linked. Make sure: \n\n` + Platform.select({ ios: "- You have run 'pod install'\n", default: "" }) + "- You rebuilt the app after installing the package\n" + "- You are not using Expo Go\n"
5
5
 
@@ -78,6 +78,8 @@ function alreadyOpenError(what: string): Error {
78
78
  * Android pickImagesPromise) ์ค‘๋ณต ํ˜ธ์ถœํ•˜๋ฉด ์•ž ํ˜ธ์ถœ์˜ Promise ๊ฐ€ ์˜์˜ ๋๋‚˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค โ†’ JS ์—์„œ ๋จผ์ € ๋ง‰์Šต๋‹ˆ๋‹ค.
79
79
  */
80
80
  let _galleryOpen = false
81
+ /** ์–ด๋А openGallery ํ˜ธ์ถœ์ด _galleryOpen ์„ ์žก๊ณ  ์žˆ๋Š”์ง€ โ€” ์ฒ˜๋ฆฌ ์‹œ์ž‘(onProcessingStart)์— ๋จผ์ € ํ’€๊ณ , ๋Šฆ๊ฒŒ ๋๋‚œ ์•ž ํ˜ธ์ถœ์ด ์ƒˆ ํ˜ธ์ถœ์˜ ์ž ๊ธˆ์„ ํ’€์ง€ ์•Š๊ฒŒ */
82
+ let _galleryOpenToken = 0
81
83
  /** openEditor ๋„ Android ๊ฐ€ editImagePromise ํ•˜๋‚˜๋งŒ ๋ณด๊ด€ํ•˜๋ฏ€๋กœ ๊ฐ™์€ ๋ณดํ˜ธ๊ฐ€ ํ•„์š” */
82
84
  let _editorOpen = false
83
85
  /**
@@ -86,6 +88,8 @@ let _editorOpen = false
86
88
  */
87
89
  let _asyncImgProcessedSub: { remove: () => void } | null = null
88
90
 
91
+ export type { AIConfig, AIUsageEvent, AIChargeRequiredEvent } from "./types"
92
+ export type { VideoOptions, VideoProgressEvent, ViewerVideo, ProcessingStartEvent, ProcessingStartItem } from "./types"
89
93
  export type { SelectionChangeEvent, Appearance, AttachLocationResult, MapViewerOptions, ReverseGeocodeOptions, ReverseGeocodeResult, ReverseGeocodeErrorCode, AttachFileResult, AttachFileFailure, LocationThumbnailOptions, LocationThumbnailResult } from "./types"
90
94
  export type { MediaGalleryItem, MediaGalleryOptions, MediaGalleryGridSize, MediaGalleryGridSizeChangedEvent, MediaGalleryTheme, MediaGalleryViewerOptions, MediaGalleryDeleteOption, MediaGalleryItemDeletedEvent, MediaGalleryNeedPageEvent, MediaGalleryClosedEvent, MediaGalleryAppendPayload, MediaGalleryRemovePayload } from "./types"
91
95
 
@@ -115,6 +119,23 @@ export interface RNAttachmentKit {
115
119
  /** reverseGeocode ์บ์‹œ ๋น„์šฐ๊ธฐ */
116
120
  clearReverseGeocodeCache(): Promise<void>
117
121
  closeGallery(): Promise<boolean>
122
+ /**
123
+ * processingId: ์–ด๋А ๋ณด๋‚ด๊ธฐ์ธ์ง€ (onProcessingStart ์˜ ๊ฐ’). ์ƒ๋žตํ•˜๋ฉด ๊ฐ€์žฅ ์ตœ๊ทผ ๋ณด๋‚ด๊ธฐ
124
+ *
125
+ * ๋ณด๋‚ด๋Š” ์ค‘์ธ ๋™์˜์ƒ ๋ณ€ํ™˜ ์ทจ์†Œ (HUD ์—†์ด ๋งํ’์„ ์—์„œ ์ทจ์†Œํ•  ๋•Œ). index ์ƒ๋žต = ๋‚จ์€ ๋™์˜์ƒ ์ „๋ถ€.
126
+ * ์ทจ์†Œ๋œ ๋™์˜์ƒ์€ onImageProcessedยท๊ฒฐ๊ณผ์— { error: "CANCELLED", cancelled: true } ๋กœ ์˜ค๊ณ  ๋‚˜๋จธ์ง€๋Š” ๊ณ„์† ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.
127
+ * ์ง„ํ–‰ ์ค‘์ธ ์ฒ˜๋ฆฌ๊ฐ€ ์—†์œผ๋ฉด false
128
+ */
129
+ cancelVideoProcessing(index?: number, processingId?: string): Promise<boolean>
130
+ /**
131
+ * AI ๊ธฐ๋Šฅ on/off ยท ํฌ์ธํŠธ ยท ๋ฌด๋ฃŒ ํšŸ์ˆ˜ ยท 1ํšŒ ์ฐจ๊ฐ ํฌ์ธํŠธ (๋„˜๊ธด ๊ฐ’๋งŒ ๋ฐ”๋€œ). ์•ฑ ์‹œ์ž‘ ๋•Œ ํ•œ ๋ฒˆ, ์ž”์•ก์ด ๋ฐ”๋€” ๋•Œ๋งˆ๋‹ค(์ถฉ์ „ยท์„œ๋ฒ„ ๋™๊ธฐํ™”) ๋‹ค์‹œ ํ˜ธ์ถœ.
132
+ * AI ํ™”๋ฉด์ด ์—ด๋ ค ์žˆ์œผ๋ฉด ๋ฐ”๋กœ ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค.
133
+ */
134
+ setAIConfig(config: AIConfig): Promise<void>
135
+ /** AI ๋ฅผ ํ•œ ๋ฒˆ ์“ธ ๋•Œ๋งˆ๋‹ค (๋ฌด๋ฃŒ ํšŸ์ˆ˜ ์‚ฌ์šฉ ๋˜๋Š” ํฌ์ธํŠธ ์ฐจ๊ฐ) โ€” ์•ฑ์ด ์„œ๋ฒ„์— ๋ฐ˜์˜. ํ•ด์ œ ํ•จ์ˆ˜๋ฅผ ๋Œ๋ ค์คŒ */
136
+ addAIUsageListener(listener: (event: AIUsageEvent) => void): () => void
137
+ /** ํฌ์ธํŠธ๊ฐ€ ๋ชจ์ž๋ผ ์‚ฌ์šฉ์ž๊ฐ€ '์ถฉ์ „ํ•˜๊ธฐ'๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ โ€” ์•ฑ์ด ์ถฉ์ „ ํ™”๋ฉด์œผ๋กœ ์•ˆ๋‚ด (ํ•„์š”ํ•˜๋ฉด closeGallery() ๋กœ ์‹œํŠธ๋„ ๋‹ซ๊ธฐ). ํ•ด์ œ ํ•จ์ˆ˜๋ฅผ ๋Œ๋ ค์คŒ */
138
+ addAIChargeRequiredListener(listener: (event: AIChargeRequiredEvent) => void): () => void
118
139
  addSelectionChangeListener(listener: (event: SelectionChangeEvent) => void): () => void
119
140
  getDefaultAnimationConfig(): Promise<{ galleryOpen: number, galleryClose: number, editorOpen: number, editorClose: number, viewerOpen: number, viewerClose: number }>
120
141
  injectImageCache(urlString: string, localPath: string): Promise<boolean>
@@ -167,6 +188,22 @@ const AttachmentKit: RNAttachmentKit = {
167
188
  throw alreadyOpenError("Gallery")
168
189
  }
169
190
  _galleryOpen = true
191
+ const myToken = ++_galleryOpenToken
192
+ // ๊ฐค๋Ÿฌ๋ฆฌ ํ™”๋ฉด์ด ๋‹ซํžˆ๊ณ  ์ฒ˜๋ฆฌ๊ฐ€ ์‹œ์ž‘๋˜๋ฉด(onProcessingStart) ๋ฐ”๋กœ ์ž ๊ธˆ์„ ํ’‚ โ€” ๋™์˜์ƒ์„ ๋ณ€ํ™˜ํ•˜๋Š” ๋™์•ˆ์—๋„
193
+ // ๋‹ค์‹œ ์—ด์–ด ๋ณด๋‚ผ ์ˆ˜ ์žˆ๊ฒŒ. Promise ๋Š” ์ง€๊ธˆ์ฒ˜๋Ÿผ ์ฒ˜๋ฆฌ๊ฐ€ ๋‹ค ๋๋‚˜์•ผ resolve
194
+ let myProcessingId: string | null = null
195
+ const subscriptionOpenLock = eventEmitter.addListener("onProcessingStart", (e: any) => {
196
+ if (myProcessingId) return
197
+ myProcessingId = typeof e?.processingId === "string" ? e.processingId : ""
198
+ if (_galleryOpenToken === myToken) _galleryOpen = false
199
+ })
200
+ /** ์ด ํ˜ธ์ถœ์˜ ์ด๋ฒคํŠธ์ธ์ง€ โ€” processingId ๊ฐ€ ๋ถ™์€ ์ด๋ฒคํŠธ๋Š” ๋‚ด ์ฒ˜๋ฆฌ์˜ ๊ฒƒ๋งŒ, ์•ˆ ๋ถ™์€(์˜› ๋„ค์ดํ‹ฐ๋ธŒยท์‚ฌ์ง„ 1์žฅ ํŽธ์ง‘) ์ด๋ฒคํŠธ๋Š” ์ฒ˜๋ฆฌ ID ๋ฅผ ๋ชจ๋ฅผ ๋•Œ๋งŒ */
201
+ const isMine = (e: any) => {
202
+ const id = e?.processingId
203
+ if (typeof id !== "string" || id === "") return !myProcessingId
204
+ return myProcessingId === id
205
+ }
206
+ const mine = <T,>(fn?: (e: T) => void) => fn ? (e: T) => { if (isMine(e)) fn(e) } : undefined
170
207
 
171
208
  // ์ฝœ๋ฐฑ ์ด๋ฒคํŠธ ์ž„์‹œ ๋ฆฌ์Šค๋„ˆ ๋“ฑ๋ก
172
209
  let subscriptionSelChange: any = null
@@ -182,16 +219,33 @@ const AttachmentKit: RNAttachmentKit = {
182
219
  try { _asyncImgProcessedSub.remove() } catch (e) { /* noop */ }
183
220
  _asyncImgProcessedSub = null
184
221
  }
185
- subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", options.onImageProcessed)
222
+ subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", mine(options.onImageProcessed)!)
186
223
  _asyncImgProcessedSub = subscriptionImgProcessed
187
224
  } else {
188
- subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", options.onImageProcessed)
225
+ subscriptionImgProcessed = eventEmitter.addListener("onImageProcessed", mine(options.onImageProcessed)!)
189
226
  }
190
227
  }
191
228
  let subscriptionLocation: any = null
192
229
  if (options.onLocationSelected) {
193
230
  subscriptionLocation = eventEmitter.addListener("onLocationSelected", options.onLocationSelected)
194
231
  }
232
+ // ๋™์˜์ƒ ๋ณ€ํ™˜ ์ง„ํ–‰๋ฅ  (video.onProgress)
233
+ let subscriptionVideoProgress: any = null
234
+ if (options.video?.onProgress) {
235
+ subscriptionVideoProgress = eventEmitter.addListener("onVideoProgress", mine(options.video.onProgress)!)
236
+ }
237
+ // ์ฒ˜๋ฆฌ ์‹œ์ž‘ (๋ณด๋‚ธ ์งํ›„ ํ•œ ๋ฒˆ, ๊ฒฐ๊ณผ๋ณด๋‹ค ๋จผ์ €)
238
+ let subscriptionProcessingStart: any = null
239
+ if (options.onProcessingStart) {
240
+ // ๋‚ด ์ฒ˜๋ฆฌ ์‹œ์ž‘๋งŒ (์•ž ๋ณด๋‚ด๊ธฐ์˜ ์‹œ์ž‘ ์ด๋ฒคํŠธ๋Š” ์ด ํ˜ธ์ถœ ์ „์— ์ด๋ฏธ ์ง€๋‚˜๊ฐ)
241
+ const onStart = options.onProcessingStart
242
+ let started = false
243
+ subscriptionProcessingStart = eventEmitter.addListener("onProcessingStart", (e: any) => {
244
+ if (started) return
245
+ started = true
246
+ onStart(e)
247
+ })
248
+ }
195
249
  let subscriptionFiles: any = null
196
250
  if (options.onFilesSelected) {
197
251
  const onFiles = options.onFilesSelected
@@ -201,19 +255,26 @@ const AttachmentKit: RNAttachmentKit = {
201
255
 
202
256
  try {
203
257
  // ์ด๋ฒคํŠธ ์ฝœ๋ฐฑ์€ ๋„ค์ดํ‹ฐ๋ธŒ๋กœ ์ „๋‹ฌํ•˜์ง€ ์•Š์Œ
204
- const { onSelectionChange, onImageProcessed, onLocationSelected, onFilesSelected, ...restOptions } = options
205
- const nativeOptions = {
258
+ const { onSelectionChange, onImageProcessed, onLocationSelected, onFilesSelected, onProcessingStart, video, ...restOptions } = options
259
+ const nativeOptions: any = {
206
260
  themeColor: _defaultThemeColor,
207
261
  languageCode: _defaultLanguageCode,
208
262
  appearance: _defaultAppearance,
209
263
  ...restOptions,
210
264
  }
265
+ if (video) {
266
+ // onProgress ์ฝœ๋ฐฑ์€ ๋„ค์ดํ‹ฐ๋ธŒ๋กœ ๋„˜๊ธฐ์ง€ ์•Š์Œ
267
+ const { onProgress, ...videoRest } = video
268
+ nativeOptions.video = videoRest
269
+ }
211
270
  nativeOptions.languageCode = normalizeLanguageCode(nativeOptions.languageCode)
212
271
  nativeOptions.appearance = normalizeAppearance(nativeOptions.appearance)
213
272
  const result = await RNAttachmentKitModule.openGallery(nativeOptions)
214
273
  return result
215
274
  } finally {
216
- _galleryOpen = false
275
+ // ์ฒ˜๋ฆฌ ์‹œ์ž‘ ๋•Œ ์ด๋ฏธ ํ’€์—ˆ๊ณ  ๊ทธ ๋’ค ์ƒˆ ํ˜ธ์ถœ์ด ์žก์•˜์„ ์ˆ˜ ์žˆ์Œ โ†’ ๋‚ด ์ž ๊ธˆ์ผ ๋•Œ๋งŒ
276
+ if (_galleryOpenToken === myToken) _galleryOpen = false
277
+ subscriptionOpenLock.remove()
217
278
  // ๊ฐค๋Ÿฌ๋ฆฌ๊ฐ€ ๋‹ซํžˆ๋ฉด onSelectionChange ๋ฆฌ์Šค๋„ˆ ์ œ๊ฑฐ
218
279
  if (subscriptionSelChange) {
219
280
  subscriptionSelChange.remove()
@@ -225,6 +286,12 @@ const AttachmentKit: RNAttachmentKit = {
225
286
  if (subscriptionFiles) {
226
287
  subscriptionFiles.remove()
227
288
  }
289
+ if (subscriptionVideoProgress) {
290
+ subscriptionVideoProgress.remove()
291
+ }
292
+ if (subscriptionProcessingStart) {
293
+ subscriptionProcessingStart.remove()
294
+ }
228
295
  // asyncProcessing ๋ชจ๋“œ๊ฐ€ ์•„๋‹ ๋•Œ๋งŒ onImageProcessed ๋ฆฌ์Šค๋„ˆ ์ œ๊ฑฐ (async ๋ชจ๋“œ์—์„  ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•ด ์œ ์ง€ํ•ด์•ผ ํ•จ)
229
296
  // ํ˜ธ์ถœ๋ถ€์—์„œ ์ˆ˜๋™์œผ๋กœ ์ œ๊ฑฐํ•˜๊ฑฐ๋‚˜, ์ตœ์ข… ์™„๋ฃŒ ์‹œ ์ •๋ฆฌํ•˜๋Š” ๊ตฌ์กฐ๊ฐ€ ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Œ
230
297
  if (!options.asyncProcessing && subscriptionImgProcessed) {
@@ -380,7 +447,22 @@ const AttachmentKit: RNAttachmentKit = {
380
447
  mergedOptions.addressLanguageCode = options.languageCode || _rawLanguageCode || _defaultLanguageCode
381
448
  mergedOptions.languageCode = normalizeLanguageCode(mergedOptions.languageCode)
382
449
  mergedOptions.appearance = normalizeAppearance(mergedOptions.appearance)
383
- await RNAttachmentKitModule.openMapViewer(mergedOptions)
450
+ // ํ•จ์ˆ˜๋Š” ๋„ค์ดํ‹ฐ๋ธŒ๋กœ ๋ชป ๋„˜๊น€ โ€” ๋‹ซ๊ธฐ ์‹œ์ž‘์€ ์ด๋ฒคํŠธ๋กœ ๋ฐ›์Œ (Android ๋Š” RCTDeviceEventEmitter ๋กœ๋„ ์˜ฌ ์ˆ˜ ์žˆ์–ด ๋‘˜ ๋‹ค ๋“ฃ๊ณ  ํ•œ ๋ฒˆ๋งŒ)
451
+ const onWillClose = options.onViewerWillClose
452
+ delete mergedOptions.onViewerWillClose
453
+ let willCloseSent = false
454
+ const willCloseHandler = (e: any) => {
455
+ if (willCloseSent) return
456
+ willCloseSent = true
457
+ onWillClose?.({ durationMs: typeof e?.durationMs === 'number' ? e.durationMs : 0 })
458
+ }
459
+ const subs: any[] = [eventEmitter.addListener("onMapViewerWillClose", willCloseHandler)]
460
+ if (Platform.OS === "android") subs.push(DeviceEventEmitter.addListener("onMapViewerWillClose", willCloseHandler))
461
+ try {
462
+ await RNAttachmentKitModule.openMapViewer(mergedOptions)
463
+ } finally {
464
+ subs.forEach(s => s.remove())
465
+ }
384
466
  },
385
467
 
386
468
  updateMapViewerSourceRect: async (rect: import("./types").SourceRect | null): Promise<void> => {
@@ -439,6 +521,35 @@ const AttachmentKit: RNAttachmentKit = {
439
521
  return RNAttachmentKitModule.closeGallery()
440
522
  },
441
523
 
524
+ cancelVideoProcessing: async (index?: number, processingId?: string): Promise<boolean> => {
525
+ if (!RNAttachmentKitModule) {
526
+ throw new Error(LINKING_ERROR)
527
+ }
528
+ if (typeof RNAttachmentKitModule.cancelVideoProcessing !== "function") return false // ์˜› ๋„ค์ดํ‹ฐ๋ธŒ ๋นŒ๋“œ
529
+ return RNAttachmentKitModule.cancelVideoProcessing(typeof index === "number" && index >= 0 ? index : -1, processingId ?? "")
530
+ },
531
+
532
+ setAIConfig: async (config: AIConfig): Promise<void> => {
533
+ if (!RNAttachmentKitModule) {
534
+ throw new Error(LINKING_ERROR)
535
+ }
536
+ if (typeof RNAttachmentKitModule.setAIConfig !== "function") return // ์˜› ๋„ค์ดํ‹ฐ๋ธŒ ๋นŒ๋“œ
537
+ // undefined ๋Š” "๋ฐ”๊พธ์ง€ ์•Š์Œ" ์ด๋ฏ€๋กœ ๋นผ๊ณ  ๋ณด๋ƒ„ (null ์€ "๋น„์›€")
538
+ const payload: Record<string, unknown> = {}
539
+ Object.entries(config ?? {}).forEach(([k, v]) => { if (v !== undefined) payload[k] = v })
540
+ return RNAttachmentKitModule.setAIConfig(payload)
541
+ },
542
+
543
+ addAIUsageListener: (listener: (event: AIUsageEvent) => void) => {
544
+ const subscription = eventEmitter.addListener("onAIUsage", listener as any)
545
+ return () => subscription.remove()
546
+ },
547
+
548
+ addAIChargeRequiredListener: (listener: (event: AIChargeRequiredEvent) => void) => {
549
+ const subscription = eventEmitter.addListener("onAIChargeRequired", listener as any)
550
+ return () => subscription.remove()
551
+ },
552
+
442
553
  addSelectionChangeListener: (listener: (event: SelectionChangeEvent) => void) => {
443
554
  const subscription = eventEmitter.addListener("onSelectionChange", listener)
444
555
 
package/src/types.ts CHANGED
@@ -20,6 +20,94 @@ export interface ImageResult {
20
20
  fileName?: string // ํŒŒ์ผ๋ช…
21
21
  fileExtension?: string // ํ™•์žฅ์ž
22
22
  fileSize?: number // ํŒŒ์ผ ํฌ๊ธฐ (bytes)
23
+ /** "image"(๊ธฐ๋ณธ) | "video" โ€” mediaType: "all"/"video" ๋กœ ์—ด์—ˆ์„ ๋•Œ ๋™์˜์ƒ์ด๋ฉด "video" */
24
+ mediaType?: "image" | "video"
25
+ /** ๋™์˜์ƒ: ๊ธธ์ด(์ดˆ, ์†Œ์ˆ˜) */
26
+ duration?: number
27
+ /** ๋™์˜์ƒ: ํฌ์Šคํ„ฐ ์ธ๋„ค์ผ file:// (video.posterFormat ํ˜•์‹ โ€” ๊ธฐ๋ณธ webp, ๊ธด ๋ณ€ 512) */
28
+ thumbnailUri?: string
29
+ thumbnailWidth?: number
30
+ thumbnailHeight?: number
31
+ /** ๋™์˜์ƒ: ์ „์†ก๋ณธ ์ฝ”๋ฑยทํ‰๊ท  ๋น„ํŠธ๋ ˆ์ดํŠธ(bps) */
32
+ videoCodec?: "h264" | "hevc" | string
33
+ videoBitrate?: number
34
+ /** ํŽธ์ง‘(trim/crop/overlay/์Œ์†Œ๊ฑฐ/ํ’ˆ์งˆ ๋ณ€๊ฒฝ)ํ–ˆ๋Š”์ง€. false ๋ฉด ์›๋ณธ์„ ๊ทธ๋Œ€๋กœ(๋ฆฌ๋จน์Šค) ๋ณด๋‚ธ ๊ฒƒ */
35
+ edited?: boolean
36
+ /** ๋™์˜์ƒ ๋ณ€ํ™˜์— ์‹คํŒจํ–ˆ์„ ๋•Œ (uri ์—†์Œ). ์‚ฌ์ง„ยท์ •์ƒ ๋™์˜์ƒ์—” ์—†์Œ. ์•ฑ์ด ์ทจ์†Œํ–ˆ์œผ๋ฉด "CANCELLED" */
37
+ error?: string
38
+ /** ์•ฑ์ด cancelVideoProcessing ์œผ๋กœ ์ทจ์†Œํ•œ ๋™์˜์ƒ (uri ์—†์Œ) */
39
+ cancelled?: boolean
40
+ }
41
+
42
+ /**
43
+ * onProcessingStart โ€” ๊ฐค๋Ÿฌ๋ฆฌ์—์„œ ๋ณด๋‚ธ ์งํ›„, ์ฒ˜๋ฆฌ(์‚ฌ์ง„ ๋ฆฌ์‚ฌ์ด์ฆˆยท๋™์˜์ƒ ๋ณ€ํ™˜)๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— ํ•œ ๋ฒˆ.
44
+ * ์•ฑ์€ ์ด๊ฑธ๋กœ ๋งํ’์„  ์ž๋ฆฌ๋ฅผ ๋จผ์ € ๋งŒ๋“ค๊ณ (๋น„์œจยทํฌ์Šคํ„ฐยท๊ธธ์ด), ๋™์˜์ƒ์€ onVideoProgress ๋กœ ์ง„ํ–‰๋ฅ ์„ ๊ทธ๋ฆฐ ๋’ค
45
+ * onImageProcessed(index ๊ฐ™์Œ)๊ฐ€ ์˜ค๋ฉด ์‹ค์ œ ํŒŒ์ผ๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.
46
+ */
47
+ export interface ProcessingStartEvent {
48
+ /**
49
+ * ์ด๋ฒˆ ๋ณด๋‚ด๊ธฐ์˜ ID. onVideoProgress / onImageProcessed ์—๋„ ๊ฐ™์€ ๊ฐ’์ด ๋ถ™์Œ.
50
+ * ๋™์˜์ƒ์„ ๋ณ€ํ™˜ํ•˜๋Š” ๋™์•ˆ์—๋„ ๊ฐค๋Ÿฌ๋ฆฌ๋ฅผ ๋‹ค์‹œ ์—ด์–ด ๋˜ ๋ณด๋‚ผ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, ์ด๋ฒคํŠธ๋ฅผ ์ „์—ญ ๋ฆฌ์Šค๋„ˆ๋กœ ๋ฐ›๋Š” ์•ฑ์€ ์ด ๊ฐ’์œผ๋กœ ๊ตฌ๋ถ„
51
+ */
52
+ processingId: string
53
+ total: number
54
+ items: ProcessingStartItem[]
55
+ }
56
+
57
+ export interface ProcessingStartItem {
58
+ index: number
59
+ mediaType: "image" | "video"
60
+ /** ph://โ€ฆ (iOS) / content://โ€ฆ (Android) */
61
+ originalUri?: string
62
+ /** ์˜ˆ์ƒ ๊ฒฐ๊ณผ ํฌ๊ธฐ (์‚ฌ์ง„: ๋ฆฌ์‚ฌ์ด์ฆˆ ํ›„, ๋™์˜์ƒ: ํ’ˆ์งˆยทํฌ๋กญ ๋ฐ˜์˜). ๋น„์œจ์šฉ */
63
+ width: number
64
+ height: number
65
+ /** ๋™์˜์ƒ: ๋ณด๋‚ผ ๊ธธ์ด(์ดˆ, ๊ตฌ๊ฐ„ ๋ฐ˜์˜) */
66
+ duration?: number
67
+ /** ๋™์˜์ƒ: ํฌ์Šคํ„ฐ file:// (video.posterFormat ํ˜•์‹ โ€” ๊ธฐ๋ณธ webp, ํฌ๋กญยท๊ทธ๋ฆฌ๊ธฐ ๋ฐ˜์˜) โ€” ๋ณ€ํ™˜์ด ๋๋‚˜๊ธฐ ์ „ ๋งํ’์„ ์— */
68
+ thumbnailUri?: string
69
+ thumbnailWidth?: number
70
+ thumbnailHeight?: number
71
+ }
72
+
73
+ /** ๋™์˜์ƒ ์˜ต์…˜ (GalleryOptions.video). mediaType ์ด "video"/"all" ์ผ ๋•Œ๋งŒ ์˜๋ฏธ */
74
+ export interface VideoOptions {
75
+ /** ๊ณ ๋ฅผ ์ˆ˜ ์žˆ๋Š” ์ตœ๋Œ€ ๊ธธ์ด(์ดˆ). ๊ธฐ๋ณธ 600 (10๋ถ„). ๋„˜๋Š” ๋™์˜์ƒ์€ ๋ˆ„๋ฅด๋ฉด ์•ˆ๋‚ด๋งŒ. 0 = ์ œํ•œ ์—†์Œ */
76
+ maxDurationSec?: number
77
+ /** ์ „์†ก ๊ฒฐ๊ณผ ์ตœ๋Œ€ ์šฉ๋Ÿ‰(MB). ๊ธฐ๋ณธ 100. ์ถ”์ •์น˜๊ฐ€ ๋„˜์œผ๋ฉด ๋” ๋‚ฎ์€ ํ’ˆ์งˆ๋กœ ์ž๋™ ์กฐ์ •. 0 = ์ œํ•œ ์—†์Œ */
78
+ maxFileSizeMB?: number
79
+ /** ํ•ด์ƒ๋„ ๋‹จ๊ณ„ (์„ธ๋กœ px). ๊ธฐ๋ณธ [360, 480, 720, 1080]. ์›๋ณธ๋ณด๋‹ค ํฐ ๋‹จ๊ณ„๋Š” ์“ฐ์ง€ ์•Š์Œ(์›๋ณธ ์œ ์ง€) */
80
+ qualities?: number[]
81
+ /** ๊ธฐ๋ณธ ํ’ˆ์งˆ (์„ธ๋กœ px). ๊ธฐ๋ณธ 720. ์›๋ณธ์ด ๋” ์ž‘์œผ๋ฉด ์›๋ณธ ๊ทธ๋Œ€๋กœ */
82
+ defaultQuality?: number
83
+ /** ๊ตฌ๊ฐ„ ์ž๋ฅด๊ธฐ ํ—ˆ์šฉ. ๊ธฐ๋ณธ true (ํŽธ์ง‘ ํ™”๋ฉด์ด ์ƒ๊ธฐ๋Š” P2 ๋ถ€ํ„ฐ) */
84
+ allowTrim?: boolean
85
+ /** ์Œ์†Œ๊ฑฐ ๋ฒ„ํŠผ ํ‘œ์‹œ. ๊ธฐ๋ณธ true (P2 ๋ถ€ํ„ฐ) */
86
+ allowMute?: boolean
87
+ /** ์ฝ”๋ฑ. ๊ธฐ๋ณธ "h264". "hevc" ๋Š” ์šฉ๋Ÿ‰์ด ์ž‘์ง€๋งŒ ์ˆ˜์‹  ๊ธฐ๊ธฐ ํ˜ธํ™˜์„ ํ™•์ธํ•œ ๊ฒฝ์šฐ๋งŒ */
88
+ codec?: "h264" | "hevc"
89
+ /**
90
+ * ๋™์˜์ƒ ํฌ์Šคํ„ฐ(์ธ๋„ค์ผ) ํŒŒ์ผ ํ˜•์‹. ๊ธฐ๋ณธ "webp" (jpg ๋ณด๋‹ค ์ž‘์Œ). "jpg" ๋กœ ํ•˜๋ฉด ์˜ˆ์ „์ฒ˜๋Ÿผ jpg.
91
+ * onProcessingStart / onImageProcessed ์˜ thumbnailUri ํ™•์žฅ์ž๊ฐ€ ์ด ๊ฐ’์„ ๋”ฐ๋ฆ„ (webp ์ธ์ฝ”๋”ฉ์ด ์•ˆ ๋˜๋Š” ๋“œ๋ฌธ ๊ฒฝ์šฐ์—” jpg ๋กœ ๋Œ€์‹ ํ•˜๋‹ˆ, ํ™•์žฅ์ž๋Š” uri ๋กœ ํ™•์ธ)
92
+ */
93
+ posterFormat?: "webp" | "jpg"
94
+ /** ์ „์†ก ์ „ ๋ณ€ํ™˜ ์ง„ํ–‰๋ฅ  (๋™์˜์ƒ๋งˆ๋‹ค 0~1, 1% ์ด์ƒ ๋ฐ”๋€” ๋•Œยท์ตœ์†Œ 0.1์ดˆ ๊ฐ„๊ฒฉ) */
95
+ onProgress?: (e: VideoProgressEvent) => void
96
+ /**
97
+ * ๋ณ€ํ™˜ํ•˜๋Š” ๋™์•ˆ ํ™”๋ฉด ๊ฐ€์šด๋ฐ ์ง„ํ–‰ HUD(์ทจ์†Œ ๋ฒ„ํŠผ ํฌํ•จ)๋ฅผ ๋„์šธ์ง€.
98
+ * ๊ธฐ๋ณธ: asyncProcessing ์ด ์•„๋‹ˆ๋ฉด true, asyncProcessing: true ๋ฉด false โ€”
99
+ * ์ด๋ฒคํŠธ(onProcessingStart / onVideoProgress / onImageProcessed)๋กœ ๋งํ’์„ ์— ์ง„ํ–‰ ์ƒํ™ฉ์„ ๊ทธ๋ฆฌ๋Š” ์•ฑ์€ HUD ์—†์ด ์”๋‹ˆ๋‹ค.
100
+ * HUD ๊ฐ€ ์—†์„ ๋•Œ ์ทจ์†Œ๋Š” AttachmentKit.cancelVideoProcessing(index)
101
+ */
102
+ showProgressHUD?: boolean
103
+ }
104
+
105
+ export interface VideoProgressEvent {
106
+ index: number
107
+ total: number
108
+ progress: number
109
+ /** ์–ด๋А ๋ณด๋‚ด๊ธฐ์˜ ์ง„ํ–‰๋ฅ ์ธ์ง€ (onProcessingStart ์˜ processingId) */
110
+ processingId?: string
23
111
  }
24
112
 
25
113
  export interface SourceRect {
@@ -33,7 +121,10 @@ export interface GalleryOptions {
33
121
  maxSelection?: number
34
122
  maxWidth?: number // ์ตœ๋Œ€ width
35
123
  maxHeight?: number // ์ตœ๋Œ€ height
124
+ /** ๊ธฐ๋ณธ "photo" = ์‚ฌ์ง„๋งŒ(๋™์˜์ƒ ๊ถŒํ•œ๋„ ์š”์ฒญ ์•ˆ ํ•จ). "all" = ์‚ฌ์ง„+๋™์˜์ƒ ๋‚ ์งœ์ˆœ ํ˜ผํ•ฉ, "video" = ๋™์˜์ƒ๋งŒ */
36
125
  mediaType?: "photo" | "video" | "all"
126
+ /** ๋™์˜์ƒ ์˜ต์…˜ (mediaType ์ด video/all ์ผ ๋•Œ) */
127
+ video?: VideoOptions
37
128
  quality?: number
38
129
  allItemsText?: string
39
130
  selectedItemsText?: string
@@ -61,6 +152,8 @@ export interface GalleryOptions {
61
152
  asyncProcessing?: boolean // ์™„์ „ ๋น„๋™๊ธฐ ์ด๋ฒคํŠธ ๋ฆฌํ„ด ์—ฌ๋ถ€
62
153
  onSelectionChange?: (event: SelectionChangeEvent) => void
63
154
  onImageProcessed?: (event: any) => void
155
+ /** ์ฒ˜๋ฆฌ ์‹œ์ž‘ (๋ณด๋‚ธ ์งํ›„ ํ•œ ๋ฒˆ) โ€” ๋ชจ๋“  ์ž๋ฆฌ์˜ ๋ฏธ๋””์–ด ์ข…๋ฅ˜ยท์˜ˆ์ƒ ํฌ๊ธฐยท๋™์˜์ƒ ํฌ์Šคํ„ฐ. ProcessingStartEvent ์ฐธ๊ณ  */
156
+ onProcessingStart?: (event: ProcessingStartEvent) => void
64
157
  /**
65
158
  * ๊ฐค๋Ÿฌ๋ฆฌ ์•„๋ž˜์— ์ฒจ๋ถ€ ๋ฉ”๋‰ด(๊ฐค๋Ÿฌ๋ฆฌ / ์œ„์น˜ / ํŒŒ์ผ)๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ๊ธฐ๋ณธ false.
66
159
  * ์œ„์น˜ ํƒญ: iOS ๋Š” Apple ์ง€๋„(ํ‚ค ํ•„์š” ์—†์Œ), Android ๋Š” Google ์ง€๋„ โ€” ์•ฑ์˜ AndroidManifest ์—
@@ -266,12 +359,29 @@ export interface MapViewerOptions {
266
359
  sourceImageUri?: string
267
360
  /** ๋งํ’์„  ์ด๋ฏธ์ง€ ๋ผ์šด๋“œ (dp/pt, ๊ธฐ๋ณธ 12) */
268
361
  sourceCornerRadius?: number
362
+ /**
363
+ * ๋‹ซ๊ธฐ ์• ๋‹ˆ๋ฉ”์ด์…˜์ด "์‹œ์ž‘"๋  ๋•Œ (durationMs = ๋‹ซ๊ธฐ ์• ๋‹ˆ๋ฉ”์ด์…˜ ๊ธธ์ด). ํ”„๋กœ๋ฏธ์Šค๋Š” ๋‹ค ๋‹ซํžŒ ๋’ค์— ๋๋‚˜๋ฏ€๋กœ,
364
+ * ํ‚ค๋ณด๋“œ ๋ณต๊ท€์ฒ˜๋Ÿผ ๋‹ซํž˜๊ณผ ๋™์‹œ์— ํ•˜๊ณ  ์‹ถ์€ ์ผ์€ ์—ฌ๊ธฐ์„œ. Android ๋Š” ์ด ์‹œ์ ์— ๋ทฐ์–ด ์ฐฝ์ด ์ž…๋ ฅ ํฌ์ปค์Šค๋ฅผ ๋‚ด๋ ค๋†“์Œ
365
+ */
366
+ onViewerWillClose?: (e: { durationMs: number }) => void
269
367
  /** ๋งˆ์ปคยท๋ฒ„ํŠผ ์ƒ‰ (๊ธฐ๋ณธ: setDefaults ์˜ themeColor) */
270
368
  themeColor?: string
271
369
  languageCode?: LanguageCode
272
370
  appearance?: Appearance
273
371
  }
274
372
 
373
+ /** ๋ทฐ์–ด์˜ ๋™์˜์ƒ ํŽ˜์ด์ง€ ์ •๋ณด (ViewerOptions.videos) */
374
+ export interface ViewerVideo {
375
+ /** http(s) ๋˜๋Š” file:// */
376
+ uri: string
377
+ /** ์ดˆ. ๋ชจ๋ฅด๋ฉด ์ƒ๋žต (๋ถˆ๋Ÿฌ์˜จ ๋’ค ์ฑ„์›€) */
378
+ duration?: number
379
+ /** ์ ˆ๋Œ€ ๊ฒฝ๋กœ(file:// ์—†์Œ). ํŒŒ์ผ์ด ์žˆ์œผ๋ฉด ๊ทธ๊ฑธ๋กœ ์žฌ์ƒ, ์—†์œผ๋ฉด ์ŠคํŠธ๋ฆฌ๋ฐํ•˜๊ณ  ๋‹ค ๋ฐ›์œผ๋ฉด ์ด ๊ฒฝ๋กœ์— ์ €์žฅ */
380
+ cacheFile?: string
381
+ width?: number
382
+ height?: number
383
+ }
384
+
275
385
  export interface ViewerOptions {
276
386
  images: string[]
277
387
  placeholderImages?: string[]
@@ -281,6 +391,12 @@ export interface ViewerOptions {
281
391
  * (์•ฑ์ด ์บ์‹œ๋ฅผ ํ•œ ๊ณณ์—์„œ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ์˜ต์…˜ โ€” ํ•ญ๋ชฉ์ด null/๋นˆ ๋ฌธ์ž์—ด์ด๋ฉด ํ•ด๋‹น ์‚ฌ์ง„์€ ๊ธฐ์กด ๋ฐฉ์‹)
282
392
  */
283
393
  cacheFiles?: (string | null)[]
394
+ /**
395
+ * images ์™€ ๊ฐ™์€ ์ˆœ์„œ. ํ•ญ๋ชฉ์ด ์žˆ์œผ๋ฉด ๊ทธ ํŽ˜์ด์ง€๋Š” ๋™์˜์ƒ (null/์ƒ๋žต = ์‚ฌ์ง„) โ€” cacheFiles ์™€ ๊ฐ™์€ "ํ‰ํ–‰ ๋ฐฐ์—ด".
396
+ * ๋™์˜์ƒ ํŽ˜์ด์ง€์—์„œ images[i] ๋Š” ํฌ์Šคํ„ฐ(์ธ๋„ค์ผ) ์ด๋ฏธ์ง€๋กœ ์“ฐ์ž…๋‹ˆ๋‹ค (์—ด๊ธฐยท๋‹ซ๊ธฐ ์• ๋‹ˆ๋ฉ”์ด์…˜, ๋กœ๋”ฉ ์ค‘ ํ‘œ์‹œ).
397
+ * ์ง€์›: iOS ๋ทฐ์–ด, Android ๋Š” useOverlayViewer: true ์ผ ๋•Œ (๊ทธ ์™ธ Android ๋ทฐ์–ด๋Š” ํฌ์Šคํ„ฐ๋งŒ ๋ณด์ž„)
398
+ */
399
+ videos?: (ViewerVideo | null)[]
284
400
  initialIndex?: number
285
401
  themeColor?: string // Added themeColor for Android
286
402
  /**
@@ -414,6 +530,14 @@ export interface MediaGalleryItem {
414
530
  isMine?: boolean
415
531
  width?: number
416
532
  height?: number
533
+ /** ์ƒ๋žต = 'image'. 'video' ๋ฉด imageUri/thumbUri ๋Š” ํฌ์Šคํ„ฐ, ์žฌ์ƒ์€ videoUri */
534
+ mediaType?: 'image' | 'video'
535
+ /** ๋™์˜์ƒ ์›๋ณธ (http(s) ๋˜๋Š” file://) */
536
+ videoUri?: string
537
+ /** ๋™์˜์ƒ ์บ์‹œ ๊ฒฝ๋กœ (ViewerVideo.cacheFile ๊ณผ ๊ฐ™์€ ์˜๋ฏธ) */
538
+ videoCacheFile?: string
539
+ /** ์ดˆ โ€” ๊ทธ๋ฆฌ๋“œ ์นธ์˜ "โ–ถ 0:12" ๋ฐฐ์ง€ */
540
+ duration?: number
417
541
  }
418
542
 
419
543
  export interface MediaGalleryDeleteOption {
@@ -534,3 +658,52 @@ export interface MediaGalleryRemovePayload {
534
658
  galleryId: string
535
659
  groupIds: string[]
536
660
  }
661
+
662
+ /**
663
+ * AI ๊ธฐ๋Šฅ (๊ฐค๋Ÿฌ๋ฆฌ์˜ AI ์ƒ์„ฑ ยท ํŽธ์ง‘ ํ™”๋ฉด์˜ AI ํŽธ์ง‘) ์„ค์ •๊ณผ ์ž”์•ก. `AttachmentKit.setAIConfig` ๋กœ ๋„˜๊ธฐ๋ฉฐ, ๋„˜๊ธด ๊ฐ’๋งŒ ๋ฐ”๋€๋‹ˆ๋‹ค.
664
+ * ์•ฑ ์„œ๋ฒ„๊ฐ€ ์ง„์งœ ์žฅ๋ถ€์ด๊ณ  ๋ชจ๋“ˆ์€ ํ™”๋ฉด ํ‘œ์‹œยท์‚ฌ์šฉ ๊ฐ€๋Šฅ ํŒ๋‹จ์šฉ ์‚ฌ๋ณธ์„ ๋“ค๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
665
+ * ์‚ฌ์šฉ ์ˆœ์„œ: ๊ตฌ๋…์ž์˜ ๋‚จ์€ ๋ฌด๋ฃŒ ํšŸ์ˆ˜(freeCount, ์˜ˆ: ์›” 30ํšŒ) โ†’ ํฌ์ธํŠธ(points, 1ํšŒ costPerUse) โ†’ ๋ชจ์ž๋ผ๋ฉด ์ถฉ์ „ ์•ˆ๋‚ด(onAIChargeRequired).
666
+ * ์„ฑ๊ณตํ•œ ์š”์ฒญ๋งŒ ์ฐจ๊ฐ๋˜๊ณ (์‹คํŒจยท์ทจ์†Œยท์•ˆ์ „ ์ฐจ๋‹จ์€ ๋ฌด๋ฃŒ), ์ฐจ๊ฐํ•  ๋•Œ๋งˆ๋‹ค onAIUsage ๊ฐ€ ์˜ต๋‹ˆ๋‹ค.
667
+ */
668
+ export interface AIConfig {
669
+ /** AI ๊ธฐ๋Šฅ on/off. ๊ธฐ๋ณธ false โ€” ๊บผ์ ธ ์žˆ์œผ๋ฉด ๊ฐค๋Ÿฌ๋ฆฌยทํŽธ์ง‘ ํ™”๋ฉด์— AI ๋ฒ„ํŠผ์ด ๋ณด์ด์ง€ ์•Š์Œ */
670
+ enabled?: boolean
671
+ /** ํ˜„์žฌ ํฌ์ธํŠธ */
672
+ points?: number
673
+ /** ๊ตฌ๋…์ž์˜ ๋‚จ์€ ๋ฌด๋ฃŒ ํšŸ์ˆ˜ (์˜ˆ: ์›” 30ํšŒ ์ค‘ ๋‚จ์€ ๊ฒƒ โ€” ๊ธฐ๊ฐ„ยทํšŸ์ˆ˜๋Š” ์•ฑ/์„œ๋ฒ„๊ฐ€ ์ •ํ•จ). 0 ๋ณด๋‹ค ํฌ๋ฉด ํฌ์ธํŠธ๋ณด๋‹ค ๋จผ์ € ์”€ */
674
+ freeCount?: number
675
+ /** 1ํšŒ ์ฐจ๊ฐ ํฌ์ธํŠธ. 0 ์ด๋ฉด ๊ณผ๊ธˆ ์—†์Œ (๋ฌด์ œํ•œ) */
676
+ costPerUse?: number
677
+ /** ํ™”์งˆ ์˜ต์…˜ "๊ณ ํ™”์งˆ(1K)" 1ํšŒ ์ฐจ๊ฐ ํฌ์ธํŠธ. ์ƒ๋žต/null ์ด๋ฉด costPerUse */
678
+ highQualityCost?: number | null
679
+ /** ์šด์˜: ์•ฑ ์„œ๋ฒ„(ํ”„๋ก์‹œ) ์ฃผ์†Œ. ๋ชจ๋“ˆ์ด Gemini generateContent ๋ณธ๋ฌธ์„ ์ด ์ฃผ์†Œ๋กœ ๋ณด๋‚ด๊ณ  ์„œ๋ฒ„๊ฐ€ ํ‚ค๋ฅผ ๋ถ™์—ฌ ์ „๋‹ฌ (ํ—ค๋” X-AI-Model = ๋ชจ๋ธ ์ด๋ฆ„) */
680
+ endpoint?: string | null
681
+ /** endpoint ๋กœ ๋ณด๋‚ผ ๋•Œ ๋ถ™์ผ ํ—ค๋” (์˜ˆ: { Authorization: "Bearer โ€ฆ" }) */
682
+ headers?: Record<string, string>
683
+ /** ํ…Œ์ŠคํŠธ ์ „์šฉ Gemini ํ‚ค (์•ฑ์— ๋„ฃ์–ด ๋ฐฐํฌํ•˜์ง€ ๋ง ๊ฒƒ). endpoint ๊ฐ€ ์žˆ์œผ๋ฉด ๋ฌด์‹œ */
684
+ apiKey?: string | null
685
+ }
686
+
687
+ /** AI ๋ฅผ ํ•œ ๋ฒˆ ์„ฑ๊ณต์ ์œผ๋กœ ์ผ์„ ๋•Œ (์„œ๋ฒ„์— ์ฐจ๊ฐ์„ ๋ฐ˜์˜ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ) */
688
+ export interface AIUsageEvent {
689
+ /** "generate" = ๊ฐค๋Ÿฌ๋ฆฌ AI ์ƒ์„ฑ, "edit" = ํŽธ์ง‘ ํ™”๋ฉด AI ํŽธ์ง‘ */
690
+ kind: "generate" | "edit"
691
+ /** ๋ฌด๋ฃŒ ํšŸ์ˆ˜๋ฅผ ์ผ์œผ๋ฉด true (์ด๋•Œ pointsDeducted = 0) */
692
+ usedFreeCount: boolean
693
+ /** ์ด๋ฒˆ์— ์ฐจ๊ฐํ•œ ํฌ์ธํŠธ */
694
+ pointsDeducted: number
695
+ /** ๊ณ ํ™”์งˆ(1K)๋กœ ๋งŒ๋“ค์—ˆ๋Š”์ง€ */
696
+ highQuality: boolean
697
+ /** ์ฐจ๊ฐ ํ›„ ๋ชจ๋“ˆ์ด ๋“ค๊ณ  ์žˆ๋Š” ๊ฐ’ */
698
+ points: number
699
+ freeCount: number
700
+ }
701
+
702
+ /** ํฌ์ธํŠธ๊ฐ€ ๋ชจ์ž๋ผ ์‚ฌ์šฉ์ž๊ฐ€ '์ถฉ์ „ํ•˜๊ธฐ'๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ (๋ชจ๋“ˆ์€ AI ํ™”๋ฉด์„ ๋‹ซ์Œ โ†’ ์•ฑ์ด ์ถฉ์ „ ํ™”๋ฉด์œผ๋กœ ์•ˆ๋‚ด) */
703
+ export interface AIChargeRequiredEvent {
704
+ kind: "generate" | "edit"
705
+ /** 1ํšŒ์— ํ•„์š”ํ•œ ํฌ์ธํŠธ */
706
+ required: number
707
+ points: number
708
+ freeCount: number
709
+ }