theta-client-react-native 1.0.2 → 1.2.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.
Files changed (225) hide show
  1. package/README.md +6 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +409 -0
  4. package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +700 -24
  5. package/ios/ThetaClientReactNative.h +6 -0
  6. package/ios/ThetaClientReactNative.mm +1661 -183
  7. package/lib/commonjs/capture/capture.js +118 -0
  8. package/lib/commonjs/capture/capture.js.map +1 -0
  9. package/lib/commonjs/capture/index.js +50 -0
  10. package/lib/commonjs/capture/index.js.map +1 -0
  11. package/lib/commonjs/capture/notify.js +12 -0
  12. package/lib/commonjs/capture/notify.js.map +1 -0
  13. package/lib/commonjs/capture/photo-capture.js +64 -0
  14. package/lib/commonjs/capture/photo-capture.js.map +1 -0
  15. package/lib/commonjs/capture/time-shift-capture.js +91 -0
  16. package/lib/commonjs/capture/time-shift-capture.js.map +1 -0
  17. package/lib/commonjs/capture/video-capture.js +71 -0
  18. package/lib/commonjs/capture/video-capture.js.map +1 -0
  19. package/lib/commonjs/index.js +40 -1041
  20. package/lib/commonjs/index.js.map +1 -1
  21. package/lib/commonjs/theta-repository/access-point.js +23 -0
  22. package/lib/commonjs/theta-repository/access-point.js.map +1 -0
  23. package/lib/commonjs/theta-repository/digest-auth.js +2 -0
  24. package/lib/commonjs/theta-repository/digest-auth.js.map +1 -0
  25. package/lib/commonjs/theta-repository/index.js +105 -0
  26. package/lib/commonjs/theta-repository/index.js.map +1 -0
  27. package/lib/commonjs/theta-repository/options/index.js +138 -0
  28. package/lib/commonjs/theta-repository/options/index.js.map +1 -0
  29. package/lib/commonjs/theta-repository/options/option-camera-control-source.js +29 -0
  30. package/lib/commonjs/theta-repository/options/option-camera-control-source.js.map +1 -0
  31. package/lib/commonjs/theta-repository/options/option-camera-mode.js +26 -0
  32. package/lib/commonjs/theta-repository/options/option-camera-mode.js.map +1 -0
  33. package/lib/commonjs/theta-repository/options/option-network-type.js +26 -0
  34. package/lib/commonjs/theta-repository/options/option-network-type.js.map +1 -0
  35. package/lib/commonjs/theta-repository/options/option-power-saving.js +24 -0
  36. package/lib/commonjs/theta-repository/options/option-power-saving.js.map +1 -0
  37. package/lib/commonjs/theta-repository/options/option-preview-format.js +32 -0
  38. package/lib/commonjs/theta-repository/options/option-preview-format.js.map +1 -0
  39. package/lib/commonjs/theta-repository/options/option-proxy.js +2 -0
  40. package/lib/commonjs/theta-repository/options/option-proxy.js.map +1 -0
  41. package/lib/commonjs/theta-repository/options/option-shooting-method.js +41 -0
  42. package/lib/commonjs/theta-repository/options/option-shooting-method.js.map +1 -0
  43. package/lib/commonjs/theta-repository/options/option-shutter-speed.js +302 -0
  44. package/lib/commonjs/theta-repository/options/option-shutter-speed.js.map +1 -0
  45. package/lib/commonjs/theta-repository/options/option-time-shift.js +43 -0
  46. package/lib/commonjs/theta-repository/options/option-time-shift.js.map +1 -0
  47. package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js +25 -0
  48. package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js.map +1 -0
  49. package/lib/commonjs/theta-repository/options/option-wlan-frequency.js +22 -0
  50. package/lib/commonjs/theta-repository/options/option-wlan-frequency.js.map +1 -0
  51. package/lib/commonjs/theta-repository/options/options.js +490 -0
  52. package/lib/commonjs/theta-repository/options/options.js.map +1 -0
  53. package/lib/commonjs/theta-repository/theta-config.js +6 -0
  54. package/lib/commonjs/theta-repository/theta-config.js.map +1 -0
  55. package/lib/commonjs/theta-repository/theta-files.js +35 -0
  56. package/lib/commonjs/theta-repository/theta-files.js.map +1 -0
  57. package/lib/commonjs/theta-repository/theta-info.js +2 -0
  58. package/lib/commonjs/theta-repository/theta-info.js.map +1 -0
  59. package/lib/commonjs/theta-repository/theta-meta.js +2 -0
  60. package/lib/commonjs/theta-repository/theta-meta.js.map +1 -0
  61. package/lib/commonjs/theta-repository/theta-plugin.js +2 -0
  62. package/lib/commonjs/theta-repository/theta-plugin.js.map +1 -0
  63. package/lib/commonjs/theta-repository/theta-repository.js +510 -0
  64. package/lib/commonjs/theta-repository/theta-repository.js.map +1 -0
  65. package/lib/commonjs/theta-repository/theta-state.js +120 -0
  66. package/lib/commonjs/theta-repository/theta-state.js.map +1 -0
  67. package/lib/commonjs/theta-repository/theta-timeout.js +2 -0
  68. package/lib/commonjs/theta-repository/theta-timeout.js.map +1 -0
  69. package/lib/module/capture/capture.js +111 -0
  70. package/lib/module/capture/capture.js.map +1 -0
  71. package/lib/module/capture/index.js +5 -0
  72. package/lib/module/capture/index.js.map +1 -0
  73. package/lib/module/capture/notify.js +6 -0
  74. package/lib/module/capture/notify.js.map +1 -0
  75. package/lib/module/capture/photo-capture.js +56 -0
  76. package/lib/module/capture/photo-capture.js.map +1 -0
  77. package/lib/module/capture/time-shift-capture.js +83 -0
  78. package/lib/module/capture/time-shift-capture.js.map +1 -0
  79. package/lib/module/capture/video-capture.js +63 -0
  80. package/lib/module/capture/video-capture.js.map +1 -0
  81. package/lib/module/index.js +3 -1009
  82. package/lib/module/index.js.map +1 -1
  83. package/lib/module/theta-repository/access-point.js +16 -0
  84. package/lib/module/theta-repository/access-point.js.map +1 -0
  85. package/lib/module/theta-repository/digest-auth.js +2 -0
  86. package/lib/module/theta-repository/digest-auth.js.map +1 -0
  87. package/lib/module/theta-repository/index.js +10 -0
  88. package/lib/module/theta-repository/index.js.map +1 -0
  89. package/lib/module/theta-repository/options/index.js +13 -0
  90. package/lib/module/theta-repository/options/index.js.map +1 -0
  91. package/lib/module/theta-repository/options/option-camera-control-source.js +22 -0
  92. package/lib/module/theta-repository/options/option-camera-control-source.js.map +1 -0
  93. package/lib/module/theta-repository/options/option-camera-mode.js +19 -0
  94. package/lib/module/theta-repository/options/option-camera-mode.js.map +1 -0
  95. package/lib/module/theta-repository/options/option-network-type.js +19 -0
  96. package/lib/module/theta-repository/options/option-network-type.js.map +1 -0
  97. package/lib/module/theta-repository/options/option-power-saving.js +17 -0
  98. package/lib/module/theta-repository/options/option-power-saving.js.map +1 -0
  99. package/lib/module/theta-repository/options/option-preview-format.js +25 -0
  100. package/lib/module/theta-repository/options/option-preview-format.js.map +1 -0
  101. package/lib/module/theta-repository/options/option-proxy.js +2 -0
  102. package/lib/module/theta-repository/options/option-proxy.js.map +1 -0
  103. package/lib/module/theta-repository/options/option-shooting-method.js +34 -0
  104. package/lib/module/theta-repository/options/option-shooting-method.js.map +1 -0
  105. package/lib/module/theta-repository/options/option-shutter-speed.js +295 -0
  106. package/lib/module/theta-repository/options/option-shutter-speed.js.map +1 -0
  107. package/lib/module/theta-repository/options/option-time-shift.js +36 -0
  108. package/lib/module/theta-repository/options/option-time-shift.js.map +1 -0
  109. package/lib/module/theta-repository/options/option-white-balance-auto-strength.js +18 -0
  110. package/lib/module/theta-repository/options/option-white-balance-auto-strength.js.map +1 -0
  111. package/lib/module/theta-repository/options/option-wlan-frequency.js +15 -0
  112. package/lib/module/theta-repository/options/option-wlan-frequency.js.map +1 -0
  113. package/lib/module/theta-repository/options/options.js +482 -0
  114. package/lib/module/theta-repository/options/options.js.map +1 -0
  115. package/lib/module/theta-repository/theta-config.js +2 -0
  116. package/lib/module/theta-repository/theta-config.js.map +1 -0
  117. package/lib/module/theta-repository/theta-files.js +28 -0
  118. package/lib/module/theta-repository/theta-files.js.map +1 -0
  119. package/lib/module/theta-repository/theta-info.js +2 -0
  120. package/lib/module/theta-repository/theta-info.js.map +1 -0
  121. package/lib/module/theta-repository/theta-meta.js +2 -0
  122. package/lib/module/theta-repository/theta-meta.js.map +1 -0
  123. package/lib/module/theta-repository/theta-plugin.js +2 -0
  124. package/lib/module/theta-repository/theta-plugin.js.map +1 -0
  125. package/lib/module/theta-repository/theta-repository.js +466 -0
  126. package/lib/module/theta-repository/theta-repository.js.map +1 -0
  127. package/lib/module/theta-repository/theta-state.js +113 -0
  128. package/lib/module/theta-repository/theta-state.js.map +1 -0
  129. package/lib/module/theta-repository/theta-timeout.js +2 -0
  130. package/lib/module/theta-repository/theta-timeout.js.map +1 -0
  131. package/lib/typescript/capture/capture.d.ts +71 -0
  132. package/lib/typescript/capture/capture.d.ts.map +1 -0
  133. package/lib/typescript/capture/index.d.ts +5 -0
  134. package/lib/typescript/capture/index.d.ts.map +1 -0
  135. package/lib/typescript/capture/notify.d.ts +13 -0
  136. package/lib/typescript/capture/notify.d.ts.map +1 -0
  137. package/lib/typescript/capture/photo-capture.d.ts +38 -0
  138. package/lib/typescript/capture/photo-capture.d.ts.map +1 -0
  139. package/lib/typescript/capture/time-shift-capture.d.ts +44 -0
  140. package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -0
  141. package/lib/typescript/capture/video-capture.d.ts +43 -0
  142. package/lib/typescript/capture/video-capture.d.ts.map +1 -0
  143. package/lib/typescript/index.d.ts +3 -972
  144. package/lib/typescript/index.d.ts.map +1 -1
  145. package/lib/typescript/theta-repository/access-point.d.ts +36 -0
  146. package/lib/typescript/theta-repository/access-point.d.ts.map +1 -0
  147. package/lib/typescript/theta-repository/digest-auth.d.ts +17 -0
  148. package/lib/typescript/theta-repository/digest-auth.d.ts.map +1 -0
  149. package/lib/typescript/theta-repository/index.d.ts +10 -0
  150. package/lib/typescript/theta-repository/index.d.ts.map +1 -0
  151. package/lib/typescript/theta-repository/options/index.d.ts +13 -0
  152. package/lib/typescript/theta-repository/options/index.d.ts.map +1 -0
  153. package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts +22 -0
  154. package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts.map +1 -0
  155. package/lib/typescript/theta-repository/options/option-camera-mode.d.ts +19 -0
  156. package/lib/typescript/theta-repository/options/option-camera-mode.d.ts.map +1 -0
  157. package/lib/typescript/theta-repository/options/option-network-type.d.ts +19 -0
  158. package/lib/typescript/theta-repository/options/option-network-type.d.ts.map +1 -0
  159. package/lib/typescript/theta-repository/options/option-power-saving.d.ts +16 -0
  160. package/lib/typescript/theta-repository/options/option-power-saving.d.ts.map +1 -0
  161. package/lib/typescript/theta-repository/options/option-preview-format.d.ts +25 -0
  162. package/lib/typescript/theta-repository/options/option-preview-format.d.ts.map +1 -0
  163. package/lib/typescript/theta-repository/options/option-proxy.d.ts +23 -0
  164. package/lib/typescript/theta-repository/options/option-proxy.d.ts.map +1 -0
  165. package/lib/typescript/theta-repository/options/option-shooting-method.d.ts +33 -0
  166. package/lib/typescript/theta-repository/options/option-shooting-method.d.ts.map +1 -0
  167. package/lib/typescript/theta-repository/options/option-shutter-speed.d.ts +295 -0
  168. package/lib/typescript/theta-repository/options/option-shutter-speed.d.ts.map +1 -0
  169. package/lib/typescript/theta-repository/options/option-time-shift.d.ts +54 -0
  170. package/lib/typescript/theta-repository/options/option-time-shift.d.ts.map +1 -0
  171. package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts +18 -0
  172. package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts.map +1 -0
  173. package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts +15 -0
  174. package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts.map +1 -0
  175. package/lib/typescript/theta-repository/options/options.d.ts +566 -0
  176. package/lib/typescript/theta-repository/options/options.d.ts.map +1 -0
  177. package/lib/typescript/theta-repository/theta-config.d.ts +20 -0
  178. package/lib/typescript/theta-repository/theta-config.d.ts.map +1 -0
  179. package/lib/typescript/theta-repository/theta-files.d.ts +45 -0
  180. package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -0
  181. package/lib/typescript/theta-repository/theta-info.d.ts +34 -0
  182. package/lib/typescript/theta-repository/theta-info.d.ts.map +1 -0
  183. package/lib/typescript/theta-repository/theta-meta.d.ts +38 -0
  184. package/lib/typescript/theta-repository/theta-meta.d.ts.map +1 -0
  185. package/lib/typescript/theta-repository/theta-plugin.d.ts +26 -0
  186. package/lib/typescript/theta-repository/theta-plugin.d.ts.map +1 -0
  187. package/lib/typescript/theta-repository/theta-repository.d.ts +333 -0
  188. package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -0
  189. package/lib/typescript/theta-repository/theta-state.d.ts +150 -0
  190. package/lib/typescript/theta-repository/theta-state.d.ts.map +1 -0
  191. package/lib/typescript/theta-repository/theta-timeout.d.ts +22 -0
  192. package/lib/typescript/theta-repository/theta-timeout.d.ts.map +1 -0
  193. package/package.json +1 -1
  194. package/src/capture/capture.ts +124 -0
  195. package/src/capture/index.ts +4 -0
  196. package/src/capture/notify.ts +27 -0
  197. package/src/capture/photo-capture.ts +62 -0
  198. package/src/capture/time-shift-capture.ts +99 -0
  199. package/src/capture/video-capture.ts +69 -0
  200. package/src/index.tsx +3 -1243
  201. package/src/theta-repository/access-point.ts +38 -0
  202. package/src/theta-repository/digest-auth.ts +16 -0
  203. package/src/theta-repository/index.ts +9 -0
  204. package/src/theta-repository/options/index.ts +13 -0
  205. package/src/theta-repository/options/option-camera-control-source.ts +24 -0
  206. package/src/theta-repository/options/option-camera-mode.ts +20 -0
  207. package/src/theta-repository/options/option-network-type.ts +20 -0
  208. package/src/theta-repository/options/option-power-saving.ts +18 -0
  209. package/src/theta-repository/options/option-preview-format.ts +27 -0
  210. package/src/theta-repository/options/option-proxy.ts +22 -0
  211. package/src/theta-repository/options/option-shooting-method.ts +36 -0
  212. package/src/theta-repository/options/option-shutter-speed.ts +360 -0
  213. package/src/theta-repository/options/option-time-shift.ts +59 -0
  214. package/src/theta-repository/options/option-white-balance-auto-strength.ts +19 -0
  215. package/src/theta-repository/options/option-wlan-frequency.ts +16 -0
  216. package/src/theta-repository/options/options.ts +622 -0
  217. package/src/theta-repository/theta-config.ts +20 -0
  218. package/src/theta-repository/theta-files.ts +49 -0
  219. package/src/theta-repository/theta-info.ts +35 -0
  220. package/src/theta-repository/theta-meta.ts +39 -0
  221. package/src/theta-repository/theta-plugin.ts +25 -0
  222. package/src/theta-repository/theta-repository.ts +527 -0
  223. package/src/theta-repository/theta-state.ts +164 -0
  224. package/src/theta-repository/theta-timeout.ts +21 -0
  225. package/theta-client-react-native.podspec +1 -1
@@ -0,0 +1,150 @@
1
+ /** Battery charging state constants */
2
+ export declare const ChargingStateEnum: {
3
+ /** Charging */
4
+ readonly CHARGING: "CHARGING";
5
+ /** Charging completed */
6
+ readonly COMPLETED: "COMPLETED";
7
+ /** Not charging */
8
+ readonly NOT_CHARGING: "NOT_CHARGING";
9
+ };
10
+ /** type definition of ChargingStateEnum */
11
+ export type ChargingStateEnum = typeof ChargingStateEnum[keyof typeof ChargingStateEnum];
12
+ /** Capture Status constants */
13
+ export declare const CaptureStatusEnum: {
14
+ /** Performing continuously shoot */
15
+ readonly SHOOTING: "SHOOTING";
16
+ /** In standby */
17
+ readonly IDLE: "IDLE";
18
+ /** Self-timer is operating */
19
+ readonly SELF_TIMER_COUNTDOWN: "SELF_TIMER_COUNTDOWN";
20
+ /** Performing multi bracket shooting */
21
+ readonly BRACKET_SHOOTING: "BRACKET_SHOOTING";
22
+ /** Converting post file... */
23
+ readonly CONVERTING: "CONVERTING";
24
+ /** Performing timeShift shooting */
25
+ readonly TIME_SHIFT_SHOOTING: "TIME_SHIFT_SHOOTING";
26
+ /** Performing continuous shooting */
27
+ readonly CONTINUOUS_SHOOTING: "CONTINUOUS_SHOOTING";
28
+ /** Waiting for retrospective video... */
29
+ readonly RETROSPECTIVE_IMAGE_RECORDING: "RETROSPECTIVE_IMAGE_RECORDING";
30
+ };
31
+ /** type definition of CaptureStatusEnum */
32
+ export type CaptureStatusEnum = typeof CaptureStatusEnum[keyof typeof CaptureStatusEnum];
33
+ /** Shooting function status constants */
34
+ export declare const ShootingFunctionEnum: {
35
+ /** normal */
36
+ readonly NORMAL: "NORMAL";
37
+ /** selfTimer */
38
+ readonly SELF_TIMER: "SELF_TIMER";
39
+ /** mySetting */
40
+ readonly MY_SETTING: "MY_SETTING";
41
+ };
42
+ /** type definition of ShootingFunctionEnum */
43
+ export type ShootingFunctionEnum = typeof ShootingFunctionEnum[keyof typeof ShootingFunctionEnum];
44
+ /** Microphone option constants */
45
+ export declare const MicrophoneOptionEnum: {
46
+ /** auto */
47
+ readonly AUTO: "AUTO";
48
+ /** built-in microphone */
49
+ readonly INTERNAL: "INTERNAL";
50
+ /** external microphone */
51
+ readonly EXTERNAL: "EXTERNAL";
52
+ };
53
+ /** type definition of MicrophoneOptionEnum */
54
+ export type MicrophoneOptionEnum = typeof MicrophoneOptionEnum[keyof typeof MicrophoneOptionEnum];
55
+ /** Camera error constants */
56
+ export declare const CameraErrorEnum: {
57
+ /** Insufficient memory */
58
+ readonly NO_MEMORY: "NO_MEMORY";
59
+ /** Maximum file number exceeded */
60
+ readonly FILE_NUMBER_OVER: "FILE_NUMBER_OVER";
61
+ /** Camera clock not set */
62
+ readonly NO_DATA_SETTING: "NO_DATE_SETTING";
63
+ /** Includes when the card is removed */
64
+ readonly READ_ERROR: "READ_ERROR";
65
+ /** Unsupported media (SDHC, etc.) */
66
+ readonly NOT_SUPPORTED_MEDIA_TYPE: "NOT_SUPPORTED_MEDIA_TYPE";
67
+ /** FAT32, etc. */
68
+ readonly NOT_SUPPORTED_FILE_SYSTEM: "NOT_SUPPORTED_FILE_SYSTEM";
69
+ /** Error warning while mounting */
70
+ readonly MEDIA_NOT_READY: "MEDIA_NOT_READY";
71
+ /** Battery level warning (firmware update) */
72
+ readonly NOT_ENOUGH_BATTERY: "NOT_ENOUGH_BATTERY";
73
+ /** Firmware file mismatch warning */
74
+ readonly INVALID_FILE: "INVALID_FILE";
75
+ /** Plugin start warning (IoT technical standards compliance) */
76
+ readonly PLUGIN_BOOT_ERROR: "PLUGIN_BOOT_ERROR";
77
+ /**
78
+ * When performing continuous shooting by operating the camera while executing <Delete object>,
79
+ * <Transfer firmware file>, <Install plugin> or <Uninstall plugin> with the WebAPI or MTP.
80
+ */
81
+ readonly IN_PROGRESS_ERROR: "IN_PROGRESS_ERROR";
82
+ /** Battery inserted + WLAN ON + Video mode + 4K 60fps / 5.7K 10fps / 5.7K 15fps / 5.7K 30fps / 8K 10fps */
83
+ readonly CANNOT_RECORDING: "CANNOT_RECORDING";
84
+ /** Battery inserted AND Specified battery level or lower + WLAN ON + Video mode + 4K 30fps */
85
+ readonly CANNOT_RECORD_LOWBAT: "CANNOT_RECORD_LOWBAT";
86
+ /** Shooting hardware failure */
87
+ readonly CAPTURE_HW_FAILED: "CAPTURE_HW_FAILED";
88
+ /** Software error */
89
+ readonly CAPTURE_SW_FAILED: "CAPTURE_SW_FAILED";
90
+ /** Internal memory access error */
91
+ readonly INTERNAL_MEM_ACCESS_FAIL: "INTERNAL_MEM_ACCESS_FAIL";
92
+ /** Undefined error */
93
+ readonly UNEXPECTED_ERROR: "UNEXPECTED_ERROR";
94
+ /** Charging error */
95
+ readonly BATTERY_CHARGE_FAIL: "BATTERY_CHARGE_FAIL";
96
+ /** (Board) temperature warning */
97
+ readonly HIGH_TEMPERATURE_WARNING: "HIGH_TEMPERATURE_WARNING";
98
+ /** (Board) temperature error */
99
+ readonly HIGH_TEMPERATURE: "HIGH_TEMPERATURE";
100
+ /** Battery temperature error */
101
+ readonly BATTERY_HIGH_TEMPERATURE: "BATTERY_HIGH_TEMPERATURE";
102
+ /** Electronic compass error */
103
+ readonly COMPASS_CALIBRATION: "COMPASS_CALIBRATION";
104
+ };
105
+ /** type definition of CameraErrorEnum */
106
+ export type CameraErrorEnum = typeof CameraErrorEnum[keyof typeof CameraErrorEnum];
107
+ /** Mutable values representing Theta status. */
108
+ export type ThetaState = {
109
+ /** Fingerprint (unique identifier) of the current camera state */
110
+ fingerprint: string;
111
+ /** Battery level between 0.0 and 1.0 */
112
+ batteryLevel: number;
113
+ /** Storage URI */
114
+ storageUri: string | null;
115
+ /** Storage ID */
116
+ storageID: string | null;
117
+ /** Continuously shoots state */
118
+ captureStatus: CaptureStatusEnum;
119
+ /** Recorded time of movie (seconds) */
120
+ recordedTime: number;
121
+ /** Recordable time of movie (seconds) */
122
+ recordableTime: number;
123
+ /** Number of still images captured during continuous shooting, Unit: images */
124
+ capturedPictures: number | null;
125
+ /** Elapsed time for interval composite shooting (sec) */
126
+ compositeShootingElapsedTime: number | null;
127
+ /** URL of the last saved file */
128
+ latestFileUrl: string;
129
+ /** Charging state */
130
+ chargingState: ChargingStateEnum;
131
+ /** API version currently set (1: v2.0, 2: v2.1) */
132
+ apiVersion: number;
133
+ /** Plugin running state (true: running, false: stop) */
134
+ isPluginRunning: boolean | null;
135
+ /** Plugin web server state (true: enabled, false: disabled) */
136
+ isPluginWebServer: boolean | null;
137
+ /** Shooting function status*/
138
+ function: ShootingFunctionEnum;
139
+ /** My setting changed state */
140
+ isMySettingChanged: boolean | null;
141
+ /** Identifies the microphone used while recording video */
142
+ currentMicrophone: MicrophoneOptionEnum | null;
143
+ /** true if record to SD card */
144
+ isSdCard: boolean;
145
+ /** Error information of the camera */
146
+ cameraError: Array<CameraErrorEnum> | null;
147
+ /** true: Battery inserted; false: Battery not inserted */
148
+ isBatteryInsert: boolean | null;
149
+ };
150
+ //# sourceMappingURL=theta-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theta-state.d.ts","sourceRoot":"","sources":["../../../src/theta-repository/theta-state.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,eAAO,MAAM,iBAAiB;IAC5B,eAAe;;IAEf,yBAAyB;;IAEzB,mBAAmB;;CAEX,CAAC;AAEX,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAC3B,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE3D,+BAA+B;AAC/B,eAAO,MAAM,iBAAiB;IAC5B,oCAAoC;;IAEpC,iBAAiB;;IAEjB,8BAA8B;;IAE9B,wCAAwC;;IAExC,8BAA8B;;IAE9B,oCAAoC;;IAEpC,qCAAqC;;IAErC,yCAAyC;;CAEjC,CAAC;AAEX,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAC3B,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE3D,yCAAyC;AACzC,eAAO,MAAM,oBAAoB;IAC/B,aAAa;;IAEb,gBAAgB;;IAEhB,gBAAgB;;CAER,CAAC;AAEX,8CAA8C;AAC9C,MAAM,MAAM,oBAAoB,GAC9B,OAAO,oBAAoB,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEjE,kCAAkC;AAClC,eAAO,MAAM,oBAAoB;IAC/B,WAAW;;IAEX,0BAA0B;;IAE1B,0BAA0B;;CAElB,CAAC;AAEX,8CAA8C;AAC9C,MAAM,MAAM,oBAAoB,GAC9B,OAAO,oBAAoB,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEjE,6BAA6B;AAC7B,eAAO,MAAM,eAAe;IAC1B,0BAA0B;;IAE1B,mCAAmC;;IAEnC,2BAA2B;;IAE3B,wCAAwC;;IAExC,qCAAqC;;IAErC,kBAAkB;;IAElB,mCAAmC;;IAEnC,8CAA8C;;IAE9C,qCAAqC;;IAErC,gEAAgE;;IAEhE;;;OAGG;;IAEH,2GAA2G;;IAE3G,8FAA8F;;IAE9F,gCAAgC;;IAEhC,qBAAqB;;IAErB,mCAAmC;;IAEnC,sBAAsB;;IAEtB,qBAAqB;;IAErB,kCAAkC;;IAElC,gCAAgC;;IAEhC,gCAAgC;;IAEhC,+BAA+B;;CAEvB,CAAC;AAEX,yCAAyC;AACzC,MAAM,MAAM,eAAe,GACzB,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEvD,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG;IACvB,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gCAAgC;IAChC,aAAa,EAAE,iBAAiB,CAAC;IACjC,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,yDAAyD;IACzD,4BAA4B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,aAAa,EAAE,iBAAiB,CAAC;IACjC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,+DAA+D;IAC/D,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,8BAA8B;IAC9B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,+BAA+B;IAC/B,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,2DAA2D;IAC3D,iBAAiB,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC/C,gCAAgC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;IAC3C,0DAA0D;IAC1D,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;CACjC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Timeout of HTTP call.
3
+ */
4
+ export type ThetaTimeout = {
5
+ /**
6
+ * Specifies a time period (in milliseconds) in
7
+ * which a client should establish a connection with a server.
8
+ */
9
+ connectTimeout: number;
10
+ /**
11
+ * Specifies a time period (in milliseconds) required to process an HTTP call:
12
+ * from sending a request to receiving first response bytes.
13
+ * To disable this timeout, set its value to 0.
14
+ */
15
+ requestTimeout: number;
16
+ /**
17
+ * Specifies a maximum time (in milliseconds) of inactivity between two data packets
18
+ * when exchanging data with a server.
19
+ */
20
+ socketTimeout: number;
21
+ };
22
+ //# sourceMappingURL=theta-timeout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theta-timeout.d.ts","sourceRoot":"","sources":["../../../src/theta-repository/theta-timeout.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theta-client-react-native",
3
- "version": "1.0.2",
3
+ "version": "1.2.0",
4
4
  "description": "This library provides a way to control RICOH THETA using.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -0,0 +1,124 @@
1
+ import type {
2
+ ApertureEnum,
3
+ ExposureCompensationEnum,
4
+ ExposureDelayEnum,
5
+ ExposureProgramEnum,
6
+ GpsInfo,
7
+ GpsTagRecordingEnum,
8
+ IsoAutoHighLimitEnum,
9
+ IsoEnum,
10
+ Options,
11
+ WhiteBalanceEnum,
12
+ } from 'src/theta-repository/options';
13
+
14
+ /**
15
+ * Capture Builder class
16
+ */
17
+ export abstract class CaptureBuilder<T extends CaptureBuilder<T>> {
18
+ /** capture options */
19
+ options: Options;
20
+
21
+ /** construct capture builder instance */
22
+ constructor() {
23
+ this.options = {};
24
+ }
25
+
26
+ /**
27
+ * Set aperture value.
28
+ * @param {ApertureEnum} aperture aperture value to set
29
+ * @return CaptureBuilder
30
+ */
31
+ setAperture(aperture: ApertureEnum): T {
32
+ this.options.aperture = aperture;
33
+ return this as unknown as T;
34
+ }
35
+
36
+ /**
37
+ * Set color temperature of the camera (Kelvin).
38
+ * @param {number} kelvin Color temperature to set
39
+ * @return CaptureBuilder
40
+ */
41
+ setColorTemperature(kelvin: number): T {
42
+ this.options.colorTemperature = kelvin;
43
+ return this as unknown as T;
44
+ }
45
+
46
+ /**
47
+ * Set exposure compensation (EV).
48
+ * @param {ExposureCompensationEnum} value Exposure compensation to set
49
+ * @return CaptureBuilder
50
+ */
51
+ setExposureCompensation(value: ExposureCompensationEnum): T {
52
+ this.options.exposureCompensation = value;
53
+ return this as unknown as T;
54
+ }
55
+
56
+ /**
57
+ * Set operating time (sec.) of the self-timer.
58
+ * @param {ExposureDelayEnum} delay Operating time to set
59
+ * @return CaptureBuilder
60
+ */
61
+ setExposureDelay(delay: ExposureDelayEnum): T {
62
+ this.options.exposureDelay = delay;
63
+ return this as unknown as T;
64
+ }
65
+
66
+ /**
67
+ * Set exposure program. The exposure settings that take priority can be selected.
68
+ * @param {ExposureProgramEnum} program Exposure program to set
69
+ * @return CaptureBuilder
70
+ */
71
+ setExposureProgram(program: ExposureProgramEnum): T {
72
+ this.options.exposureProgram = program;
73
+ return this as unknown as T;
74
+ }
75
+ /**
76
+ * Set GPS information.
77
+ * @param {GpsInfo} gpsInfo GPS information to set
78
+ * @return CaptureBuilder
79
+ */
80
+ setGpsInfo(gpsInfo: GpsInfo): T {
81
+ this.options.gpsInfo = gpsInfo;
82
+ return this as unknown as T;
83
+ }
84
+
85
+ /**
86
+ * Set turns position information assigning ON/OFF.
87
+ * @param {GpsTagRecordingEnum} value Turns position information assigning ON/OFF to set
88
+ * @return CaptureBuilder
89
+ */
90
+ setGpsTagRecording(value: GpsTagRecordingEnum): T {
91
+ this.options._gpsTagRecording = value;
92
+ return this as unknown as T;
93
+ }
94
+
95
+ /**
96
+ * Set ISO sensitivity.
97
+ * @param {IsoEnum} iso ISO sensitivity to set
98
+ * @return CaptureBuilder
99
+ */
100
+ setIso(iso: IsoEnum): T {
101
+ this.options.iso = iso;
102
+ return this as unknown as T;
103
+ }
104
+
105
+ /**
106
+ * Set ISO sensitivity upper limit when ISO sensitivity is set to automatic.
107
+ * @param {IsoAutoHighLimitEnum} iso ISO sensitivity upper limit to set
108
+ * @return CaptureBuilder
109
+ */
110
+ setIsoAutoHighLimit(iso: IsoAutoHighLimitEnum): T {
111
+ this.options.isoAutoHighLimit = iso;
112
+ return this as unknown as T;
113
+ }
114
+
115
+ /**
116
+ * Set white balance.
117
+ * @param {WhiteBalanceEnum} whiteBalance White balance to set
118
+ * @return CaptureBuilder
119
+ */
120
+ setWhiteBalance(whiteBalance: WhiteBalanceEnum): T {
121
+ this.options.whiteBalance = whiteBalance;
122
+ return this as unknown as T;
123
+ }
124
+ }
@@ -0,0 +1,4 @@
1
+ export * from './capture';
2
+ export * from './photo-capture';
3
+ export * from './video-capture';
4
+ export * from './time-shift-capture';
@@ -0,0 +1,27 @@
1
+ import {
2
+ EmitterSubscription,
3
+ NativeEventEmitter,
4
+ NativeModules,
5
+ } from 'react-native';
6
+
7
+ export interface BaseNotify {
8
+ name: string;
9
+
10
+ params?: any;
11
+ }
12
+
13
+ export interface CaptureProgressNotify {
14
+ name: string;
15
+ params?: {
16
+ completion: number;
17
+ };
18
+ }
19
+
20
+ export function addNotifyListener(
21
+ callback: (event: BaseNotify) => void
22
+ ): EmitterSubscription {
23
+ const eventEmitter = new NativeEventEmitter(
24
+ NativeModules.ThetaClientReactNative
25
+ );
26
+ return eventEmitter.addListener('ThetaNotify', callback);
27
+ }
@@ -0,0 +1,62 @@
1
+ import { CaptureBuilder } from './capture';
2
+ import type {
3
+ FilterEnum,
4
+ PhotoFileFormatEnum,
5
+ } from '../theta-repository/options';
6
+
7
+ import { NativeModules } from 'react-native';
8
+ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
9
+
10
+ /**
11
+ * PhotoCapture class
12
+ */
13
+ export class PhotoCapture {
14
+ /**
15
+ * @return promise of token file url
16
+ */
17
+ takePicture(): Promise<string> {
18
+ return ThetaClientReactNative.takePicture();
19
+ }
20
+ }
21
+
22
+ /**
23
+ * PhotoCaptureBaseBuilder class
24
+ */
25
+ export class PhotoCaptureBuilder extends CaptureBuilder<PhotoCaptureBuilder> {
26
+ /** construct PhotoCaptureBuilder instance */
27
+ constructor() {
28
+ super();
29
+ }
30
+
31
+ /**
32
+ * Set photo file format.
33
+ * @param {PhotoFileFormatEnum} fileFormat Photo file format to set
34
+ * @return PhotoCaptureBuilder
35
+ */
36
+ setFileFormat(fileFormat: PhotoFileFormatEnum): PhotoCaptureBuilder {
37
+ this.options.fileFormat = fileFormat;
38
+ return this;
39
+ }
40
+
41
+ /**
42
+ * Set image processing filter.
43
+ * @param {FilterEnum} filter Image processing filter to set
44
+ * @return PhotoCaptureBuilder
45
+ */
46
+ setFilter(filter: FilterEnum): PhotoCaptureBuilder {
47
+ this.options.filter = filter;
48
+ return this;
49
+ }
50
+
51
+ /**
52
+ * Builds an instance of a PhotoCapture that has all the combined
53
+ * parameters of the Options that have been added to the Builder.
54
+ *
55
+ * @return promise of PhotoCapture instance
56
+ */
57
+ build(): Promise<PhotoCapture> {
58
+ return ThetaClientReactNative.buildPhotoCapture(this.options).then(
59
+ () => new PhotoCapture()
60
+ );
61
+ }
62
+ }
@@ -0,0 +1,99 @@
1
+ import type { EmitterSubscription } from 'react-native';
2
+ import { CaptureBuilder } from './capture';
3
+ import { NativeModules } from 'react-native';
4
+ import { BaseNotify, CaptureProgressNotify, addNotifyListener } from './notify';
5
+ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
6
+
7
+ /**
8
+ * TimeShiftCapture class
9
+ */
10
+ export class TimeShiftCapture {
11
+ eventListener?: EmitterSubscription = undefined;
12
+ notifyList = new Map<string, ((notify: BaseNotify) => void) | undefined>();
13
+
14
+ /**
15
+ * start time-shift
16
+ * @param onProgress the block for time-shift onProgress
17
+ * @return promise of captured file url
18
+ */
19
+ async startCapture(
20
+ onProgress?: (completion?: number) => void
21
+ ): Promise<string> {
22
+ await this.initNotify();
23
+ this.notifyList.set(
24
+ 'TIME-SHIFT-PROGRESS',
25
+ onProgress
26
+ ? (event: CaptureProgressNotify) => {
27
+ onProgress(event.params?.completion);
28
+ }
29
+ : undefined
30
+ );
31
+
32
+ return new Promise<string>(async (resolve, reject) => {
33
+ await ThetaClientReactNative.startTimeShiftCapture()
34
+ .then((result: string) => {
35
+ resolve(result);
36
+ })
37
+ .catch((error: any) => {
38
+ reject(error);
39
+ })
40
+ .finally(() => {
41
+ this.releaseNotify();
42
+ });
43
+ });
44
+ }
45
+
46
+ /**
47
+ * cancel time-shift
48
+ */
49
+ async cancelCapture(): Promise<any> {
50
+ return await ThetaClientReactNative.cancelTimeShiftCapture();
51
+ }
52
+
53
+ async initNotify() {
54
+ this.eventListener = addNotifyListener((notify: BaseNotify) => {
55
+ this.notifyList.get(notify.name)?.(notify as BaseNotify);
56
+ });
57
+ }
58
+
59
+ releaseNotify() {
60
+ this.eventListener?.remove();
61
+ }
62
+ }
63
+
64
+ /**
65
+ * TimeShiftCaptureBuilder class
66
+ */
67
+ export class TimeShiftCaptureBuilder extends CaptureBuilder<TimeShiftCaptureBuilder> {
68
+ interval?: number;
69
+
70
+ /** construct TimeShiftCaptureBuilder instance */
71
+ constructor() {
72
+ super();
73
+
74
+ this.interval = undefined;
75
+ }
76
+
77
+ /**
78
+ * set interval of checking time-shift status command
79
+ * @param timeMillis interval
80
+ * @returns TimeShiftCaptureBuilder
81
+ */
82
+ setCheckStatusCommandInterval(timeMillis: number): TimeShiftCaptureBuilder {
83
+ this.interval = timeMillis;
84
+ return this;
85
+ }
86
+
87
+ /**
88
+ * Builds an instance of a TimeShiftCapture that has all the combined
89
+ * parameters of the Options that have been added to the Builder.
90
+ *
91
+ * @return promise of TimeShiftCapture instance
92
+ */
93
+ build(): Promise<TimeShiftCapture> {
94
+ return ThetaClientReactNative.buildTimeShiftCapture(
95
+ this.options,
96
+ this.interval ?? -1
97
+ ).then(() => new TimeShiftCapture());
98
+ }
99
+ }
@@ -0,0 +1,69 @@
1
+ import { CaptureBuilder } from './capture';
2
+ import type {
3
+ MaxRecordableTimeEnum,
4
+ VideoFileFormatEnum,
5
+ } from '../theta-repository/options';
6
+
7
+ import { NativeModules } from 'react-native';
8
+ const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
9
+
10
+ /**
11
+ * VideoCapture class
12
+ */
13
+ export class VideoCapture {
14
+ /**
15
+ * start video capture
16
+ * @return promise of captured file url
17
+ */
18
+ startCapture(): Promise<string> {
19
+ return ThetaClientReactNative.startCapture();
20
+ }
21
+ /**
22
+ * stop video capture
23
+ */
24
+ stopCapture() {
25
+ ThetaClientReactNative.stopCapture();
26
+ }
27
+ }
28
+
29
+ /**
30
+ * VideoCaptureBuilder class
31
+ */
32
+ export class VideoCaptureBuilder extends CaptureBuilder<VideoCaptureBuilder> {
33
+ /** construct VideoCaptureBuilder instance */
34
+ constructor() {
35
+ super();
36
+ }
37
+
38
+ /**
39
+ * Set video file format.
40
+ * @param {VideoFileFormatEnum} fileFormat Video file format to set
41
+ * @return VideoCaptureBuilder
42
+ */
43
+ setFileFormat(fileFormat: VideoFileFormatEnum): VideoCaptureBuilder {
44
+ this.options.fileFormat = fileFormat;
45
+ return this;
46
+ }
47
+
48
+ /**
49
+ * Set maximum recordable time (in seconds) of the camera.
50
+ * @param {MaxRecordableTimeEnum} time Maximum recordable time to set
51
+ * @return VideoCaptureBuilder
52
+ */
53
+ setMaxRecordableTime(time: MaxRecordableTimeEnum): VideoCaptureBuilder {
54
+ this.options.maxRecordableTime = time;
55
+ return this;
56
+ }
57
+
58
+ /**
59
+ * Builds an instance of a VideoCapture that has all the combined
60
+ * parameters of the Options that have been added to the Builder.
61
+ *
62
+ * @return promise of VideoCapture instance
63
+ */
64
+ build(): Promise<VideoCapture> {
65
+ return ThetaClientReactNative.buildVideoCapture(this.options).then(
66
+ () => new VideoCapture()
67
+ );
68
+ }
69
+ }