theta-client-react-native 1.3.1 → 1.5.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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +441 -1035
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +327 -251
- package/ios/ConvertUtil.swift +1053 -0
- package/ios/ThetaClientReactNative-Bridging-Header.h +3 -0
- package/ios/ThetaClientReactNative.m +228 -0
- package/ios/ThetaClientReactNative.swift +1608 -0
- package/ios/ThetaClientReactNative.xcodeproj/project.pbxproj +15 -57
- package/lib/commonjs/capture/index.js +22 -0
- package/lib/commonjs/capture/index.js.map +1 -1
- package/lib/commonjs/capture/limitless-interval-capture.js +89 -0
- package/lib/commonjs/capture/limitless-interval-capture.js.map +1 -0
- package/lib/commonjs/capture/photo-capture.js +26 -3
- package/lib/commonjs/capture/photo-capture.js.map +1 -1
- package/lib/commonjs/capture/shot-count-specified-interval-capture.js +112 -0
- package/lib/commonjs/capture/shot-count-specified-interval-capture.js.map +1 -0
- package/lib/commonjs/capture/time-shift-capture.js +27 -23
- package/lib/commonjs/capture/time-shift-capture.js.map +1 -1
- package/lib/commonjs/capture/video-capture.js +33 -5
- package/lib/commonjs/capture/video-capture.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/notify-controller.js +40 -0
- package/lib/commonjs/theta-repository/notify-controller.js.map +1 -0
- package/lib/commonjs/theta-repository/options/index.js +88 -0
- package/lib/commonjs/theta-repository/options/index.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-face-detect.js +22 -0
- package/lib/commonjs/theta-repository/options/option-face-detect.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-function.js +27 -0
- package/lib/commonjs/theta-repository/options/option-function.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-gain.js +26 -0
- package/lib/commonjs/theta-repository/options/option-gain.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-image-stitching.js +38 -0
- package/lib/commonjs/theta-repository/options/option-image-stitching.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation.js +2 -0
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction.js +52 -0
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-video-stitching.js +24 -0
- package/lib/commonjs/theta-repository/options/option-video-stitching.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-visibility-reduction.js +23 -0
- package/lib/commonjs/theta-repository/options/option-visibility-reduction.js.map +1 -0
- package/lib/commonjs/theta-repository/options/options.js +18 -0
- package/lib/commonjs/theta-repository/options/options.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-repository.js +26 -4
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state.js +1 -13
- package/lib/commonjs/theta-repository/theta-state.js.map +1 -1
- package/lib/module/capture/index.js +2 -0
- package/lib/module/capture/index.js.map +1 -1
- package/lib/module/capture/limitless-interval-capture.js +81 -0
- package/lib/module/capture/limitless-interval-capture.js.map +1 -0
- package/lib/module/capture/photo-capture.js +26 -3
- package/lib/module/capture/photo-capture.js.map +1 -1
- package/lib/module/capture/shot-count-specified-interval-capture.js +104 -0
- package/lib/module/capture/shot-count-specified-interval-capture.js.map +1 -0
- package/lib/module/capture/time-shift-capture.js +27 -23
- package/lib/module/capture/time-shift-capture.js.map +1 -1
- package/lib/module/capture/video-capture.js +33 -5
- package/lib/module/capture/video-capture.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/theta-repository/notify-controller.js +33 -0
- package/lib/module/theta-repository/notify-controller.js.map +1 -0
- package/lib/module/theta-repository/options/index.js +8 -0
- package/lib/module/theta-repository/options/index.js.map +1 -1
- package/lib/module/theta-repository/options/option-face-detect.js +15 -0
- package/lib/module/theta-repository/options/option-face-detect.js.map +1 -0
- package/lib/module/theta-repository/options/option-function.js +20 -0
- package/lib/module/theta-repository/options/option-function.js.map +1 -0
- package/lib/module/theta-repository/options/option-gain.js +19 -0
- package/lib/module/theta-repository/options/option-gain.js.map +1 -0
- package/lib/module/theta-repository/options/option-image-stitching.js +31 -0
- package/lib/module/theta-repository/options/option-image-stitching.js.map +1 -0
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation.js +2 -0
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation.js.map +1 -0
- package/lib/module/theta-repository/options/option-top-bottom-correction.js +45 -0
- package/lib/module/theta-repository/options/option-top-bottom-correction.js.map +1 -0
- package/lib/module/theta-repository/options/option-video-stitching.js +17 -0
- package/lib/module/theta-repository/options/option-video-stitching.js.map +1 -0
- package/lib/module/theta-repository/options/option-visibility-reduction.js +16 -0
- package/lib/module/theta-repository/options/option-visibility-reduction.js.map +1 -0
- package/lib/module/theta-repository/options/options.js +18 -0
- package/lib/module/theta-repository/options/options.js.map +1 -1
- package/lib/module/theta-repository/theta-repository.js +25 -5
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/module/theta-repository/theta-state.js +0 -12
- package/lib/module/theta-repository/theta-state.js.map +1 -1
- package/lib/typescript/capture/index.d.ts +2 -0
- package/lib/typescript/capture/index.d.ts.map +1 -1
- package/lib/typescript/capture/limitless-interval-capture.d.ts +40 -0
- package/lib/typescript/capture/limitless-interval-capture.d.ts.map +1 -0
- package/lib/typescript/capture/photo-capture.d.ts +8 -2
- package/lib/typescript/capture/photo-capture.d.ts.map +1 -1
- package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts +47 -0
- package/lib/typescript/capture/shot-count-specified-interval-capture.d.ts.map +1 -0
- package/lib/typescript/capture/time-shift-capture.d.ts +4 -7
- package/lib/typescript/capture/time-shift-capture.d.ts.map +1 -1
- package/lib/typescript/capture/video-capture.d.ts +5 -1
- package/lib/typescript/capture/video-capture.d.ts.map +1 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts +17 -0
- package/lib/typescript/theta-repository/notify-controller.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/index.d.ts +8 -0
- package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-face-detect.d.ts +15 -0
- package/lib/typescript/theta-repository/options/option-face-detect.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-function.d.ts +20 -0
- package/lib/typescript/theta-repository/options/option-function.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-gain.d.ts +19 -0
- package/lib/typescript/theta-repository/options/option-gain.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-image-stitching.d.ts +30 -0
- package/lib/typescript/theta-repository/options/option-image-stitching.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation.d.ts +22 -0
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-top-bottom-correction.d.ts +45 -0
- package/lib/typescript/theta-repository/options/option-top-bottom-correction.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-video-stitching.d.ts +17 -0
- package/lib/typescript/theta-repository/options/option-video-stitching.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-visibility-reduction.d.ts +16 -0
- package/lib/typescript/theta-repository/options/option-visibility-reduction.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/options.d.ts +47 -0
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-repository.d.ts +17 -2
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state.d.ts +2 -12
- package/lib/typescript/theta-repository/theta-state.d.ts.map +1 -1
- package/package.json +17 -9
- package/src/capture/index.ts +2 -0
- package/src/capture/limitless-interval-capture.ts +99 -0
- package/src/capture/photo-capture.ts +27 -5
- package/src/capture/shot-count-specified-interval-capture.ts +146 -0
- package/src/capture/time-shift-capture.ts +40 -33
- package/src/capture/video-capture.ts +49 -6
- package/src/theta-repository/notify-controller.ts +50 -0
- package/src/theta-repository/options/index.ts +8 -0
- package/src/theta-repository/options/option-face-detect.ts +16 -0
- package/src/theta-repository/options/option-function.ts +21 -0
- package/src/theta-repository/options/option-gain.ts +19 -0
- package/src/theta-repository/options/option-image-stitching.ts +32 -0
- package/src/theta-repository/options/option-top-bottom-correction-rotation.ts +21 -0
- package/src/theta-repository/options/option-top-bottom-correction.ts +46 -0
- package/src/theta-repository/options/option-video-stitching.ts +18 -0
- package/src/theta-repository/options/option-visibility-reduction.ts +17 -0
- package/src/theta-repository/options/options.ts +47 -0
- package/src/theta-repository/theta-repository.ts +29 -4
- package/src/theta-repository/theta-state.ts +3 -15
- package/theta-client-react-native.podspec +2 -2
- package/ios/ThetaClientReactNative.h +0 -34
- package/ios/ThetaClientReactNative.mm +0 -4087
- package/lib/commonjs/capture/notify.js +0 -12
- package/lib/commonjs/capture/notify.js.map +0 -1
- package/lib/module/capture/notify.js +0 -6
- package/lib/module/capture/notify.js.map +0 -1
- package/lib/typescript/capture/notify.d.ts +0 -13
- package/lib/typescript/capture/notify.d.ts.map +0 -1
- package/src/capture/notify.ts +0 -27
|
@@ -5,7 +5,7 @@ import type { ThetaInfo, ThetaModel } from './theta-info';
|
|
|
5
5
|
import type { MetaInfo } from './theta-meta';
|
|
6
6
|
import type { PluginInfo } from './theta-plugin';
|
|
7
7
|
import type { OptionNameEnum, Options, CaptureModeEnum, Proxy } from './options';
|
|
8
|
-
import { PhotoCaptureBuilder, VideoCaptureBuilder, TimeShiftCaptureBuilder } from '../capture';
|
|
8
|
+
import { PhotoCaptureBuilder, VideoCaptureBuilder, TimeShiftCaptureBuilder, LimitlessIntervalCaptureBuilder, ShotCountSpecifiedIntervalCaptureBuilder } from '../capture';
|
|
9
9
|
import type { ThetaConfig } from './theta-config';
|
|
10
10
|
import type { ThetaTimeout } from './theta-timeout';
|
|
11
11
|
/**
|
|
@@ -48,12 +48,27 @@ export declare function getPhotoCaptureBuilder(): PhotoCaptureBuilder;
|
|
|
48
48
|
*/
|
|
49
49
|
export declare function getTimeShiftCaptureBuilder(): TimeShiftCaptureBuilder;
|
|
50
50
|
/**
|
|
51
|
-
* Get
|
|
51
|
+
* Get VideoCapture.Builder for capture video.
|
|
52
52
|
*
|
|
53
53
|
* @function getVideoCaptureBuilder
|
|
54
54
|
* @return created VideoCaptureBuilder instance
|
|
55
55
|
*/
|
|
56
56
|
export declare function getVideoCaptureBuilder(): VideoCaptureBuilder;
|
|
57
|
+
/**
|
|
58
|
+
* Get LimitlessIntervalCapture.Builder for take limitless interval shooting.
|
|
59
|
+
*
|
|
60
|
+
* @function getLimitlessIntervalCaptureBuilder
|
|
61
|
+
* @return created LimitlessIntervalCaptureBuilder instance
|
|
62
|
+
*/
|
|
63
|
+
export declare function getLimitlessIntervalCaptureBuilder(): LimitlessIntervalCaptureBuilder;
|
|
64
|
+
/**
|
|
65
|
+
* Get ShotCountSpecifiedIntervalCapture.Builder for take interval shooting with the shot count specified.
|
|
66
|
+
*
|
|
67
|
+
* @function getShotCountSpecifiedIntervalCaptureBuilder
|
|
68
|
+
* @param {shotCount} shot count specified
|
|
69
|
+
* @return created ShotCountSpecifiedIntervalCaptureBuilder instance
|
|
70
|
+
*/
|
|
71
|
+
export declare function getShotCountSpecifiedIntervalCaptureBuilder(shotCount: number): ShotCountSpecifiedIntervalCaptureBuilder;
|
|
57
72
|
/**
|
|
58
73
|
* Start live preview.
|
|
59
74
|
* preview frame (JPEG DataURL) send THETA_EVENT_NAME event as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theta-repository.d.ts","sourceRoot":"","sources":["../../../src/theta-repository/theta-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,eAAe,EACf,KAAK,EACN,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"theta-repository.d.ts","sourceRoot":"","sources":["../../../src/theta-repository/theta-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,eAAe,EACf,KAAK,EACN,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,+BAA+B,EAC/B,wCAAwC,EACzC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;;;;;;;IAQI;AACJ,wBAAgB,UAAU,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,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAErE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAEnE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ShootingFunctionEnum } from './options/option-function';
|
|
1
2
|
/** Battery charging state constants */
|
|
2
3
|
export declare const ChargingStateEnum: {
|
|
3
4
|
/** Charging */
|
|
@@ -30,17 +31,6 @@ export declare const CaptureStatusEnum: {
|
|
|
30
31
|
};
|
|
31
32
|
/** type definition of CaptureStatusEnum */
|
|
32
33
|
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
34
|
/** Microphone option constants */
|
|
45
35
|
export declare const MicrophoneOptionEnum: {
|
|
46
36
|
/** auto */
|
|
@@ -135,7 +125,7 @@ export type ThetaState = {
|
|
|
135
125
|
/** Plugin web server state (true: enabled, false: disabled) */
|
|
136
126
|
isPluginWebServer: boolean | null;
|
|
137
127
|
/** Shooting function status*/
|
|
138
|
-
function: ShootingFunctionEnum;
|
|
128
|
+
function: ShootingFunctionEnum | null;
|
|
139
129
|
/** My setting changed state */
|
|
140
130
|
isMySettingChanged: boolean | null;
|
|
141
131
|
/** Identifies the microphone used while recording video */
|
|
@@ -1 +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,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D,+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,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D,
|
|
1
|
+
{"version":3,"file":"theta-state.d.ts","sourceRoot":"","sources":["../../../src/theta-repository/theta-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,uCAAuC;AACvC,eAAO,MAAM,iBAAiB;IAC5B,eAAe;;IAEf,yBAAyB;;IAEzB,mBAAmB;;CAEX,CAAC;AAEX,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D,+BAA+B;AAC/B,eAAO,MAAM,iBAAiB;IAC5B,oCAAoC;;IAEpC,iBAA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ChC,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,GAAG,IAAI,CAAC;IACtC,+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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theta-client-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.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",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
16
|
"*.podspec",
|
|
17
|
-
"!lib/typescript/
|
|
17
|
+
"!lib/typescript/verification-tool",
|
|
18
18
|
"!ios/build",
|
|
19
19
|
"!android/build",
|
|
20
20
|
"!android/gradle",
|
|
@@ -28,11 +28,13 @@
|
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
30
|
"test": "jest",
|
|
31
|
-
"
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
32
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
33
|
-
"
|
|
33
|
+
"prepack": "bob build",
|
|
34
34
|
"release": "release-it",
|
|
35
|
-
"
|
|
35
|
+
"verification-tool": "yarn --cwd verification-tool",
|
|
36
|
+
"bootstrap": "yarn verification-tool && yarn install && yarn verification-tool pods",
|
|
37
|
+
"clean": "del-cli android/build verification-tool/android/build verification-tool/android/app/build verification-tool/ios/build"
|
|
36
38
|
},
|
|
37
39
|
"keywords": [
|
|
38
40
|
"react-native",
|
|
@@ -51,8 +53,7 @@
|
|
|
51
53
|
"registry": "https://registry.npmjs.org/"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@commitlint/config-conventional": "^17.3.0",
|
|
56
|
+
"@commitlint/config-conventional": "^17.0.3",
|
|
56
57
|
"@react-native-community/eslint-config": "^3.0.2",
|
|
57
58
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
58
59
|
"@types/jest": "^29.2.4",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
"pod-install": "^0.1.0",
|
|
68
69
|
"prettier": "^2.8.1",
|
|
69
70
|
"react": "18.2.0",
|
|
70
|
-
"react-native": "0.
|
|
71
|
+
"react-native": "0.71.7",
|
|
71
72
|
"react-native-builder-bob": "^0.20.3",
|
|
72
73
|
"release-it": "^15.5.1",
|
|
73
74
|
"typescript": "^4.9.4"
|
|
@@ -79,9 +80,14 @@
|
|
|
79
80
|
"react": "*",
|
|
80
81
|
"react-native": "*"
|
|
81
82
|
},
|
|
83
|
+
"engines": {
|
|
84
|
+
"node": ">= 16.0.0"
|
|
85
|
+
},
|
|
86
|
+
"packageManager": "^yarn@1.22.15",
|
|
82
87
|
"jest": {
|
|
83
88
|
"preset": "react-native",
|
|
84
89
|
"modulePathIgnorePatterns": [
|
|
90
|
+
"<rootDir>/verification-tool/node_modules",
|
|
85
91
|
"<rootDir>/lib/"
|
|
86
92
|
]
|
|
87
93
|
},
|
|
@@ -128,7 +134,9 @@
|
|
|
128
134
|
},
|
|
129
135
|
"eslintIgnore": [
|
|
130
136
|
"node_modules/",
|
|
131
|
-
"lib/"
|
|
137
|
+
"lib/",
|
|
138
|
+
"marzipano.js",
|
|
139
|
+
"verification-tool/node_modules"
|
|
132
140
|
],
|
|
133
141
|
"prettier": {
|
|
134
142
|
"quoteProps": "consistent",
|
package/src/capture/index.ts
CHANGED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { CaptureBuilder } from './capture';
|
|
2
|
+
import { NativeModules } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
BaseNotify,
|
|
5
|
+
NotifyController,
|
|
6
|
+
} from '../theta-repository/notify-controller';
|
|
7
|
+
const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
8
|
+
|
|
9
|
+
const NOTIFY_NAME = 'LIMITLESS-INTERVAL-CAPTURE-STOP-ERROR';
|
|
10
|
+
|
|
11
|
+
interface CaptureStopErrorNotify extends BaseNotify {
|
|
12
|
+
params?: {
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* LimitlessIntervalCapture class
|
|
19
|
+
*/
|
|
20
|
+
export class LimitlessIntervalCapture {
|
|
21
|
+
notify: NotifyController;
|
|
22
|
+
constructor(notify: NotifyController) {
|
|
23
|
+
this.notify = notify;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* start limitless interval capture
|
|
28
|
+
* @param onStopFailed the block for error of stopCapture
|
|
29
|
+
* @return promise of captured file url
|
|
30
|
+
*/
|
|
31
|
+
startCapture(
|
|
32
|
+
onStopFailed?: (error: any) => void
|
|
33
|
+
): Promise<string[] | undefined> {
|
|
34
|
+
if (onStopFailed) {
|
|
35
|
+
this.notify.addNotify(NOTIFY_NAME, (event: CaptureStopErrorNotify) => {
|
|
36
|
+
onStopFailed(event.params);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
40
|
+
await ThetaClientReactNative.startLimitlessIntervalCapture()
|
|
41
|
+
.then((result?: string[]) => {
|
|
42
|
+
resolve(result ?? undefined);
|
|
43
|
+
})
|
|
44
|
+
.catch((error: any) => {
|
|
45
|
+
reject(error);
|
|
46
|
+
})
|
|
47
|
+
.finally(() => {
|
|
48
|
+
this.notify.removeNotify(NOTIFY_NAME);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* stop limitless interval capture
|
|
55
|
+
*/
|
|
56
|
+
stopCapture() {
|
|
57
|
+
ThetaClientReactNative.stopLimitlessIntervalCapture();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* LimitlessIntervalCaptureBuilder class
|
|
63
|
+
*/
|
|
64
|
+
export class LimitlessIntervalCaptureBuilder extends CaptureBuilder<LimitlessIntervalCaptureBuilder> {
|
|
65
|
+
/** construct LimitlessIntervalCaptureBuilder instance */
|
|
66
|
+
constructor() {
|
|
67
|
+
super();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Set shooting interval (sec.) for interval shooting.
|
|
72
|
+
* @param {interval} interval sec.
|
|
73
|
+
* @return LimitlessIntervalCaptureBuilder
|
|
74
|
+
*/
|
|
75
|
+
setCaptureInterval(interval: number): LimitlessIntervalCaptureBuilder {
|
|
76
|
+
this.options.captureInterval = interval;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Builds an instance of a LimitlessIntervalCapture that has all the combined
|
|
82
|
+
* parameters of the Options that have been added to the Builder.
|
|
83
|
+
*
|
|
84
|
+
* @return promise of LimitlessIntervalCapture instance
|
|
85
|
+
*/
|
|
86
|
+
build(): Promise<LimitlessIntervalCapture> {
|
|
87
|
+
return new Promise<LimitlessIntervalCapture>(async (resolve, reject) => {
|
|
88
|
+
try {
|
|
89
|
+
await ThetaClientReactNative.getLimitlessIntervalCaptureBuilder();
|
|
90
|
+
await ThetaClientReactNative.buildLimitlessIntervalCapture(
|
|
91
|
+
this.options
|
|
92
|
+
);
|
|
93
|
+
resolve(new LimitlessIntervalCapture(NotifyController.instance));
|
|
94
|
+
} catch (error) {
|
|
95
|
+
reject(error);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -2,6 +2,7 @@ import { CaptureBuilder } from './capture';
|
|
|
2
2
|
import type {
|
|
3
3
|
FilterEnum,
|
|
4
4
|
PhotoFileFormatEnum,
|
|
5
|
+
PresetEnum,
|
|
5
6
|
} from '../theta-repository/options';
|
|
6
7
|
|
|
7
8
|
import { NativeModules } from 'react-native';
|
|
@@ -14,8 +15,13 @@ export class PhotoCapture {
|
|
|
14
15
|
/**
|
|
15
16
|
* @return promise of token file url
|
|
16
17
|
*/
|
|
17
|
-
takePicture(): Promise<string> {
|
|
18
|
-
|
|
18
|
+
async takePicture(): Promise<string | undefined> {
|
|
19
|
+
try {
|
|
20
|
+
const fileUrl = await ThetaClientReactNative.takePicture();
|
|
21
|
+
return fileUrl ?? undefined;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
|
|
@@ -48,6 +54,16 @@ export class PhotoCaptureBuilder extends CaptureBuilder<PhotoCaptureBuilder> {
|
|
|
48
54
|
return this;
|
|
49
55
|
}
|
|
50
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Set preset mode of Theta SC2 and Theta SC2 for business.
|
|
59
|
+
* @param {FilterEnum} preset Preset mode to set
|
|
60
|
+
* @return PhotoCaptureBuilder
|
|
61
|
+
*/
|
|
62
|
+
setPreset(preset: PresetEnum): PhotoCaptureBuilder {
|
|
63
|
+
this.options.preset = preset;
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
|
|
51
67
|
/**
|
|
52
68
|
* Builds an instance of a PhotoCapture that has all the combined
|
|
53
69
|
* parameters of the Options that have been added to the Builder.
|
|
@@ -55,8 +71,14 @@ export class PhotoCaptureBuilder extends CaptureBuilder<PhotoCaptureBuilder> {
|
|
|
55
71
|
* @return promise of PhotoCapture instance
|
|
56
72
|
*/
|
|
57
73
|
build(): Promise<PhotoCapture> {
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
74
|
+
return new Promise<PhotoCapture>(async (resolve, reject) => {
|
|
75
|
+
try {
|
|
76
|
+
await ThetaClientReactNative.getPhotoCaptureBuilder();
|
|
77
|
+
await ThetaClientReactNative.buildPhotoCapture(this.options);
|
|
78
|
+
resolve(new PhotoCapture());
|
|
79
|
+
} catch (error) {
|
|
80
|
+
reject(error);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
61
83
|
}
|
|
62
84
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { CaptureBuilder } from './capture';
|
|
2
|
+
import { NativeModules } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
BaseNotify,
|
|
5
|
+
NotifyController,
|
|
6
|
+
} from '../theta-repository/notify-controller';
|
|
7
|
+
const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
8
|
+
|
|
9
|
+
const NOTIFY_PROGRESS = 'SHOT-COUNT-SPECIFIED-INTERVAL-PROGRESS';
|
|
10
|
+
const NOTIFY_STOP_ERROR = 'SHOT-COUNT-SPECIFIED-INTERVAL-STOP-ERROR';
|
|
11
|
+
|
|
12
|
+
interface CaptureProgressNotify extends BaseNotify {
|
|
13
|
+
params?: {
|
|
14
|
+
completion: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface CaptureStopErrorNotify extends BaseNotify {
|
|
19
|
+
params?: {
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* ShotCountSpecifiedIntervalCapture class
|
|
26
|
+
*/
|
|
27
|
+
export class ShotCountSpecifiedIntervalCapture {
|
|
28
|
+
notify: NotifyController;
|
|
29
|
+
constructor(notify: NotifyController) {
|
|
30
|
+
this.notify = notify;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* start interval shooting with the shot count specified
|
|
34
|
+
* @param onProgress the block for interval shooting with the shot count specified onProgress
|
|
35
|
+
* @return promise of captured file url
|
|
36
|
+
*/
|
|
37
|
+
async startCapture(
|
|
38
|
+
onProgress?: (completion?: number) => void,
|
|
39
|
+
onStopFailed?: (error: any) => void
|
|
40
|
+
): Promise<string[] | undefined> {
|
|
41
|
+
if (onProgress) {
|
|
42
|
+
this.notify.addNotify(NOTIFY_PROGRESS, (event: CaptureProgressNotify) => {
|
|
43
|
+
onProgress(event.params?.completion);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (onStopFailed) {
|
|
47
|
+
this.notify.addNotify(
|
|
48
|
+
NOTIFY_STOP_ERROR,
|
|
49
|
+
(event: CaptureStopErrorNotify) => {
|
|
50
|
+
onStopFailed(event.params);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return new Promise<string[] | undefined>(async (resolve, reject) => {
|
|
56
|
+
await ThetaClientReactNative.startShotCountSpecifiedIntervalCapture()
|
|
57
|
+
.then((result?: string[]) => {
|
|
58
|
+
resolve(result ?? undefined);
|
|
59
|
+
})
|
|
60
|
+
.catch((error: any) => {
|
|
61
|
+
reject(error);
|
|
62
|
+
})
|
|
63
|
+
.finally(() => {
|
|
64
|
+
this.notify.removeNotify(NOTIFY_PROGRESS);
|
|
65
|
+
this.notify.removeNotify(NOTIFY_STOP_ERROR);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* cancel interval shooting with the shot count specified
|
|
72
|
+
*/
|
|
73
|
+
async cancelCapture(): Promise<any> {
|
|
74
|
+
return await ThetaClientReactNative.cancelShotCountSpecifiedIntervalCapture();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* ShotCountSpecifiedIntervalCaptureBuilder class
|
|
80
|
+
*/
|
|
81
|
+
export class ShotCountSpecifiedIntervalCaptureBuilder extends CaptureBuilder<ShotCountSpecifiedIntervalCaptureBuilder> {
|
|
82
|
+
interval?: number;
|
|
83
|
+
readonly shotCount: number;
|
|
84
|
+
|
|
85
|
+
/** construct ShotCountSpecifiedIntervalCaptureBuilder instance */
|
|
86
|
+
constructor(shotCount: number) {
|
|
87
|
+
super();
|
|
88
|
+
|
|
89
|
+
this.interval = undefined;
|
|
90
|
+
this.shotCount = shotCount;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* set interval of checking interval shooting with the shot count specified status command
|
|
95
|
+
* @param timeMillis interval
|
|
96
|
+
* @returns ShotCountSpecifiedIntervalCaptureBuilder
|
|
97
|
+
*/
|
|
98
|
+
setCheckStatusCommandInterval(
|
|
99
|
+
timeMillis: number
|
|
100
|
+
): ShotCountSpecifiedIntervalCaptureBuilder {
|
|
101
|
+
this.interval = timeMillis;
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Set shooting interval (sec.) for interval shooting.
|
|
107
|
+
* @param {interval} interval sec.
|
|
108
|
+
* @return ShotCountSpecifiedIntervalCaptureBuilder
|
|
109
|
+
*/
|
|
110
|
+
setCaptureInterval(
|
|
111
|
+
interval: number
|
|
112
|
+
): ShotCountSpecifiedIntervalCaptureBuilder {
|
|
113
|
+
this.options.captureInterval = interval;
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Builds an instance of a ShotCountSpecifiedIntervalCapture that has all the combined
|
|
119
|
+
* parameters of the Options that have been added to the Builder.
|
|
120
|
+
* @return promise of ShotCountSpecifiedIntervalCapture instance
|
|
121
|
+
*/
|
|
122
|
+
build(): Promise<ShotCountSpecifiedIntervalCapture> {
|
|
123
|
+
let params = {
|
|
124
|
+
...this.options,
|
|
125
|
+
// Cannot pass negative values in IOS, use objects
|
|
126
|
+
_capture_interval: this.interval ?? -1,
|
|
127
|
+
};
|
|
128
|
+
return new Promise<ShotCountSpecifiedIntervalCapture>(
|
|
129
|
+
async (resolve, reject) => {
|
|
130
|
+
try {
|
|
131
|
+
await ThetaClientReactNative.getShotCountSpecifiedIntervalCaptureBuilder(
|
|
132
|
+
this.shotCount
|
|
133
|
+
);
|
|
134
|
+
await ThetaClientReactNative.buildShotCountSpecifiedIntervalCapture(
|
|
135
|
+
params
|
|
136
|
+
);
|
|
137
|
+
resolve(
|
|
138
|
+
new ShotCountSpecifiedIntervalCapture(NotifyController.instance)
|
|
139
|
+
);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
reject(error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import type { EmitterSubscription } from 'react-native';
|
|
2
1
|
import { CaptureBuilder } from './capture';
|
|
3
2
|
import { NativeModules } from 'react-native';
|
|
4
|
-
import { BaseNotify, CaptureProgressNotify, addNotifyListener } from './notify';
|
|
5
3
|
import type { TimeShiftIntervalEnum } from '../theta-repository/options';
|
|
4
|
+
import {
|
|
5
|
+
BaseNotify,
|
|
6
|
+
NotifyController,
|
|
7
|
+
} from '../theta-repository/notify-controller';
|
|
6
8
|
const ThetaClientReactNative = NativeModules.ThetaClientReactNative;
|
|
7
9
|
|
|
10
|
+
const NOTIFY_NAME = 'TIME-SHIFT-PROGRESS';
|
|
11
|
+
|
|
12
|
+
interface CaptureProgressNotify extends BaseNotify {
|
|
13
|
+
params?: {
|
|
14
|
+
completion: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
8
18
|
/**
|
|
9
19
|
* TimeShiftCapture class
|
|
10
20
|
*/
|
|
11
21
|
export class TimeShiftCapture {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
notify: NotifyController;
|
|
23
|
+
constructor(notify: NotifyController) {
|
|
24
|
+
this.notify = notify;
|
|
25
|
+
}
|
|
15
26
|
/**
|
|
16
27
|
* start time-shift
|
|
17
28
|
* @param onProgress the block for time-shift onProgress
|
|
@@ -19,27 +30,23 @@ export class TimeShiftCapture {
|
|
|
19
30
|
*/
|
|
20
31
|
async startCapture(
|
|
21
32
|
onProgress?: (completion?: number) => void
|
|
22
|
-
): Promise<string> {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onProgress(event.params?.completion);
|
|
29
|
-
}
|
|
30
|
-
: undefined
|
|
31
|
-
);
|
|
33
|
+
): Promise<string | undefined> {
|
|
34
|
+
if (onProgress) {
|
|
35
|
+
this.notify.addNotify(NOTIFY_NAME, (event: CaptureProgressNotify) => {
|
|
36
|
+
onProgress(event.params?.completion);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
32
39
|
|
|
33
|
-
return new Promise<string>(async (resolve, reject) => {
|
|
40
|
+
return new Promise<string | undefined>(async (resolve, reject) => {
|
|
34
41
|
await ThetaClientReactNative.startTimeShiftCapture()
|
|
35
|
-
.then((result
|
|
36
|
-
resolve(result);
|
|
42
|
+
.then((result?: string) => {
|
|
43
|
+
resolve(result ?? undefined);
|
|
37
44
|
})
|
|
38
45
|
.catch((error: any) => {
|
|
39
46
|
reject(error);
|
|
40
47
|
})
|
|
41
48
|
.finally(() => {
|
|
42
|
-
this.
|
|
49
|
+
this.notify.removeNotify(NOTIFY_NAME);
|
|
43
50
|
});
|
|
44
51
|
});
|
|
45
52
|
}
|
|
@@ -50,16 +57,6 @@ export class TimeShiftCapture {
|
|
|
50
57
|
async cancelCapture(): Promise<any> {
|
|
51
58
|
return await ThetaClientReactNative.cancelTimeShiftCapture();
|
|
52
59
|
}
|
|
53
|
-
|
|
54
|
-
async initNotify() {
|
|
55
|
-
this.eventListener = addNotifyListener((notify: BaseNotify) => {
|
|
56
|
-
this.notifyList.get(notify.name)?.(notify as BaseNotify);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
releaseNotify() {
|
|
61
|
-
this.eventListener?.remove();
|
|
62
|
-
}
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
/**
|
|
@@ -137,9 +134,19 @@ export class TimeShiftCaptureBuilder extends CaptureBuilder<TimeShiftCaptureBuil
|
|
|
137
134
|
* @return promise of TimeShiftCapture instance
|
|
138
135
|
*/
|
|
139
136
|
build(): Promise<TimeShiftCapture> {
|
|
140
|
-
|
|
141
|
-
this.options,
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
let params = {
|
|
138
|
+
...this.options,
|
|
139
|
+
// Cannot pass negative values in IOS, use objects
|
|
140
|
+
_capture_interval: this.interval ?? -1,
|
|
141
|
+
};
|
|
142
|
+
return new Promise<TimeShiftCapture>(async (resolve, reject) => {
|
|
143
|
+
try {
|
|
144
|
+
await ThetaClientReactNative.getTimeShiftCaptureBuilder();
|
|
145
|
+
await ThetaClientReactNative.buildTimeShiftCapture(params);
|
|
146
|
+
resolve(new TimeShiftCapture(NotifyController.instance));
|
|
147
|
+
} catch (error) {
|
|
148
|
+
reject(error);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
144
151
|
}
|
|
145
152
|
}
|