theta-client-react-native 1.0.1 → 1.1.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 (119) 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 +34 -0
  4. package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +311 -9
  5. package/ios/ThetaClientReactNative.mm +552 -67
  6. package/lib/commonjs/capture/capture.js +118 -0
  7. package/lib/commonjs/capture/capture.js.map +1 -0
  8. package/lib/commonjs/capture/index.js +39 -0
  9. package/lib/commonjs/capture/index.js.map +1 -0
  10. package/lib/commonjs/capture/photo-capture.js +64 -0
  11. package/lib/commonjs/capture/photo-capture.js.map +1 -0
  12. package/lib/commonjs/capture/video-capture.js +71 -0
  13. package/lib/commonjs/capture/video-capture.js.map +1 -0
  14. package/lib/commonjs/index.js +40 -1041
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/theta-repository/access-point.js +23 -0
  17. package/lib/commonjs/theta-repository/access-point.js.map +1 -0
  18. package/lib/commonjs/theta-repository/index.js +72 -0
  19. package/lib/commonjs/theta-repository/index.js.map +1 -0
  20. package/lib/commonjs/theta-repository/options/index.js +28 -0
  21. package/lib/commonjs/theta-repository/options/index.js.map +1 -0
  22. package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js +25 -0
  23. package/lib/commonjs/theta-repository/options/option-white-balance-auto-strength.js.map +1 -0
  24. package/lib/commonjs/theta-repository/options/options.js +462 -0
  25. package/lib/commonjs/theta-repository/options/options.js.map +1 -0
  26. package/lib/commonjs/theta-repository/theta-files.js +23 -0
  27. package/lib/commonjs/theta-repository/theta-files.js.map +1 -0
  28. package/lib/commonjs/theta-repository/theta-info.js +2 -0
  29. package/lib/commonjs/theta-repository/theta-info.js.map +1 -0
  30. package/lib/commonjs/theta-repository/theta-meta.js +2 -0
  31. package/lib/commonjs/theta-repository/theta-meta.js.map +1 -0
  32. package/lib/commonjs/theta-repository/theta-plugin.js +2 -0
  33. package/lib/commonjs/theta-repository/theta-plugin.js.map +1 -0
  34. package/lib/commonjs/theta-repository/theta-repository.js +479 -0
  35. package/lib/commonjs/theta-repository/theta-repository.js.map +1 -0
  36. package/lib/commonjs/theta-repository/theta-state.js +120 -0
  37. package/lib/commonjs/theta-repository/theta-state.js.map +1 -0
  38. package/lib/module/capture/capture.js +111 -0
  39. package/lib/module/capture/capture.js.map +1 -0
  40. package/lib/module/capture/index.js +4 -0
  41. package/lib/module/capture/index.js.map +1 -0
  42. package/lib/module/capture/photo-capture.js +56 -0
  43. package/lib/module/capture/photo-capture.js.map +1 -0
  44. package/lib/module/capture/video-capture.js +63 -0
  45. package/lib/module/capture/video-capture.js.map +1 -0
  46. package/lib/module/index.js +3 -1009
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/theta-repository/access-point.js +16 -0
  49. package/lib/module/theta-repository/access-point.js.map +1 -0
  50. package/lib/module/theta-repository/index.js +7 -0
  51. package/lib/module/theta-repository/index.js.map +1 -0
  52. package/lib/module/theta-repository/options/index.js +3 -0
  53. package/lib/module/theta-repository/options/index.js.map +1 -0
  54. package/lib/module/theta-repository/options/option-white-balance-auto-strength.js +18 -0
  55. package/lib/module/theta-repository/options/option-white-balance-auto-strength.js.map +1 -0
  56. package/lib/module/theta-repository/options/options.js +454 -0
  57. package/lib/module/theta-repository/options/options.js.map +1 -0
  58. package/lib/module/theta-repository/theta-files.js +16 -0
  59. package/lib/module/theta-repository/theta-files.js.map +1 -0
  60. package/lib/module/theta-repository/theta-info.js +2 -0
  61. package/lib/module/theta-repository/theta-info.js.map +1 -0
  62. package/lib/module/theta-repository/theta-meta.js +2 -0
  63. package/lib/module/theta-repository/theta-meta.js.map +1 -0
  64. package/lib/module/theta-repository/theta-plugin.js +2 -0
  65. package/lib/module/theta-repository/theta-plugin.js.map +1 -0
  66. package/lib/module/theta-repository/theta-repository.js +437 -0
  67. package/lib/module/theta-repository/theta-repository.js.map +1 -0
  68. package/lib/module/theta-repository/theta-state.js +113 -0
  69. package/lib/module/theta-repository/theta-state.js.map +1 -0
  70. package/lib/typescript/capture/capture.d.ts +71 -0
  71. package/lib/typescript/capture/capture.d.ts.map +1 -0
  72. package/lib/typescript/capture/index.d.ts +4 -0
  73. package/lib/typescript/capture/index.d.ts.map +1 -0
  74. package/lib/typescript/capture/photo-capture.d.ts +38 -0
  75. package/lib/typescript/capture/photo-capture.d.ts.map +1 -0
  76. package/lib/typescript/capture/video-capture.d.ts +43 -0
  77. package/lib/typescript/capture/video-capture.d.ts.map +1 -0
  78. package/lib/typescript/index.d.ts +3 -972
  79. package/lib/typescript/index.d.ts.map +1 -1
  80. package/lib/typescript/theta-repository/access-point.d.ts +33 -0
  81. package/lib/typescript/theta-repository/access-point.d.ts.map +1 -0
  82. package/lib/typescript/theta-repository/index.d.ts +7 -0
  83. package/lib/typescript/theta-repository/index.d.ts.map +1 -0
  84. package/lib/typescript/theta-repository/options/index.d.ts +3 -0
  85. package/lib/typescript/theta-repository/options/index.d.ts.map +1 -0
  86. package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts +18 -0
  87. package/lib/typescript/theta-repository/options/option-white-balance-auto-strength.d.ts.map +1 -0
  88. package/lib/typescript/theta-repository/options/options.d.ts +499 -0
  89. package/lib/typescript/theta-repository/options/options.d.ts.map +1 -0
  90. package/lib/typescript/theta-repository/theta-files.d.ts +32 -0
  91. package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -0
  92. package/lib/typescript/theta-repository/theta-info.d.ts +34 -0
  93. package/lib/typescript/theta-repository/theta-info.d.ts.map +1 -0
  94. package/lib/typescript/theta-repository/theta-meta.d.ts +38 -0
  95. package/lib/typescript/theta-repository/theta-meta.d.ts.map +1 -0
  96. package/lib/typescript/theta-repository/theta-plugin.d.ts +26 -0
  97. package/lib/typescript/theta-repository/theta-plugin.d.ts.map +1 -0
  98. package/lib/typescript/theta-repository/theta-repository.d.ts +312 -0
  99. package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -0
  100. package/lib/typescript/theta-repository/theta-state.d.ts +150 -0
  101. package/lib/typescript/theta-repository/theta-state.d.ts.map +1 -0
  102. package/package.json +1 -1
  103. package/src/capture/capture.ts +124 -0
  104. package/src/capture/index.ts +3 -0
  105. package/src/capture/photo-capture.ts +62 -0
  106. package/src/capture/video-capture.ts +69 -0
  107. package/src/index.tsx +3 -1243
  108. package/src/theta-repository/access-point.ts +34 -0
  109. package/src/theta-repository/index.ts +6 -0
  110. package/src/theta-repository/options/index.ts +2 -0
  111. package/src/theta-repository/options/option-white-balance-auto-strength.ts +19 -0
  112. package/src/theta-repository/options/options.ts +554 -0
  113. package/src/theta-repository/theta-files.ts +34 -0
  114. package/src/theta-repository/theta-info.ts +35 -0
  115. package/src/theta-repository/theta-meta.ts +39 -0
  116. package/src/theta-repository/theta-plugin.ts +25 -0
  117. package/src/theta-repository/theta-repository.ts +476 -0
  118. package/src/theta-repository/theta-state.ts +164 -0
  119. package/theta-client-react-native.podspec +1 -1
@@ -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,3 @@
1
+ export * from './capture';
2
+ export * from './photo-capture';
3
+ export * from './video-capture';
@@ -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,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
+ }