sales-frontend-bridge 0.0.21 → 0.0.23
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/dist/index.cjs +200 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +259 -130
- package/dist/index.d.ts +259 -130
- package/dist/index.js +201 -103
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
1
2
|
import { CSSProperties } from 'react';
|
|
2
3
|
|
|
3
4
|
interface ICommonBridge {
|
|
@@ -120,6 +121,9 @@ interface OnAuthenticationResultRequest {
|
|
|
120
121
|
interface OnAuthenticationResultResponse {
|
|
121
122
|
nlcCtfnId: string;
|
|
122
123
|
}
|
|
124
|
+
interface GetAccessTokenResponse {
|
|
125
|
+
accessToken: string;
|
|
126
|
+
}
|
|
123
127
|
|
|
124
128
|
interface ShowWebPopupOptions {
|
|
125
129
|
/** 0: fullscreen, 1: title bar, 2: size 지정 가능 팝업, 3: wk webview */
|
|
@@ -155,6 +159,170 @@ interface CreateReportExOptions extends CreateReportOptions {
|
|
|
155
159
|
*/
|
|
156
160
|
delimiter?: string;
|
|
157
161
|
}
|
|
162
|
+
type NonEmptyArray$1<T> = [T, ...T[]];
|
|
163
|
+
/**
|
|
164
|
+
* 전자청약에서 관리할 문서 데이터 구조
|
|
165
|
+
* ```tsx
|
|
166
|
+
* [
|
|
167
|
+
* { name: "문서1", file: ["doc1.ozd"], complete: true },
|
|
168
|
+
* { name: "문서2", file: ["doc2.ozd", "doc3.ozd"], complete: true }
|
|
169
|
+
* ]
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
type DocumentInfo$1 = {
|
|
173
|
+
/** 서식이름(복수의 OZD) */
|
|
174
|
+
name: string;
|
|
175
|
+
/** 서식에 매핑된 OZD 목록 */
|
|
176
|
+
file: NonEmptyArray$1<string>;
|
|
177
|
+
/** 서식 입력완료 여부 */
|
|
178
|
+
complete: boolean;
|
|
179
|
+
/** 현재 서식 포커스 여부 */
|
|
180
|
+
focus: boolean;
|
|
181
|
+
/** 전체보고서에서 서식의 시작페이지 */
|
|
182
|
+
startPage: number;
|
|
183
|
+
/** 전체보고서에서 서식의 시작페이지 */
|
|
184
|
+
endPage: number;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* OZD를 다운받을때 사용하는 브릿지의 옵션
|
|
188
|
+
*/
|
|
189
|
+
type DownloadOzdOptions$1 = {
|
|
190
|
+
data: Array<DocumentInfo$1>;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* OZ 관련 브릿지 통신에서 기본적으로 사용되는 리턴 타입 구조.
|
|
194
|
+
* 제네릭 타입 T는 리턴되는 데이터의 형태를 나타냅니다.
|
|
195
|
+
*/
|
|
196
|
+
interface CommonOzBridgetResponseType$1<T> {
|
|
197
|
+
/** 실행된 브릿지 액션의 이름 */
|
|
198
|
+
action: string;
|
|
199
|
+
/** stringify된 리턴 데이터 */
|
|
200
|
+
data: T;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 네이티브 브릿지 구현 함수
|
|
205
|
+
*/
|
|
206
|
+
interface INativeBridge {
|
|
207
|
+
getParameterMap<T>(): Promise<T>;
|
|
208
|
+
dismissPopup<T>(option: any): Promise<T>;
|
|
209
|
+
showWebPopup<T>(options: ShowWebPopupOptions): Promise<T>;
|
|
210
|
+
jumpSafari<T>(options: ShowWebPopupOptions): Promise<T>;
|
|
211
|
+
createOZViewer<T>(options: CreateReportExOptions): Promise<CommonOzBridgetResponseType$1<T>>;
|
|
212
|
+
hideOZViewer<T>(): Promise<CommonOzBridgetResponseType$1<T>>;
|
|
213
|
+
downloadDocument<T>(options: DownloadOzdOptions$1): Promise<CommonOzBridgetResponseType$1<T>>;
|
|
214
|
+
getAccessToken(): Promise<GetAccessTokenResponse>;
|
|
215
|
+
onAuthenticationResult(options: OnAuthenticationResultRequest): Promise<OnAuthenticationResultResponse>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* App - Web Bridge
|
|
220
|
+
*/
|
|
221
|
+
declare class NativeBridge extends CommonBridge implements INativeBridge {
|
|
222
|
+
private core;
|
|
223
|
+
constructor();
|
|
224
|
+
/**
|
|
225
|
+
* Iframe, App 공통으로 구현해야할 함수
|
|
226
|
+
*/
|
|
227
|
+
hello(): void;
|
|
228
|
+
/**
|
|
229
|
+
* getParameterMap
|
|
230
|
+
* @returns
|
|
231
|
+
*/
|
|
232
|
+
getParameterMap<T = any>(): Promise<T>;
|
|
233
|
+
dismissPopup<T = any>(options?: any): Promise<T>;
|
|
234
|
+
/**
|
|
235
|
+
*
|
|
236
|
+
* @param options
|
|
237
|
+
* @returns
|
|
238
|
+
*/
|
|
239
|
+
showWebPopup<T = any>(options: ShowWebPopupOptions): Promise<T>;
|
|
240
|
+
/**
|
|
241
|
+
*
|
|
242
|
+
* @param options
|
|
243
|
+
* @returns
|
|
244
|
+
*/
|
|
245
|
+
jumpSafari<T = any>(options: ShowWebPopupOptions): Promise<T>;
|
|
246
|
+
/**
|
|
247
|
+
* 기능명: 본인인증 결과 정보 넘기기
|
|
248
|
+
* 목적: NXL One 에서 본인인증 결과 값을 네이티브로 넘기기 위함
|
|
249
|
+
* @param options
|
|
250
|
+
* @returns
|
|
251
|
+
*/
|
|
252
|
+
onAuthenticationResult(options: OnAuthenticationResultRequest): Promise<OnAuthenticationResultResponse>;
|
|
253
|
+
/**
|
|
254
|
+
* Access Token 가져오기
|
|
255
|
+
* @returns
|
|
256
|
+
*/
|
|
257
|
+
getAccessToken(): Promise<GetAccessTokenResponse>;
|
|
258
|
+
/**
|
|
259
|
+
* ### Bridge for Oz
|
|
260
|
+
* 설정한 뷰어 파라미터를 기준으로 뷰어에 새로운 보고서를 바인딩합니다.
|
|
261
|
+
* @example
|
|
262
|
+
* ```tsx
|
|
263
|
+
* // 사용 예시
|
|
264
|
+
* Bridge.native.createReportEx({ param: "connection.openfile=sample.ozd" });
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
createOZViewer<T = any>(options: CreateReportExOptions): Promise<CommonOzBridgetResponseType$1<T>>;
|
|
268
|
+
/**
|
|
269
|
+
* ### Bridge for Oz
|
|
270
|
+
* OZ 뷰어를 닫습니다
|
|
271
|
+
* @example
|
|
272
|
+
* ```tsx
|
|
273
|
+
* // 사용 예시
|
|
274
|
+
* Bridge.native.hideViewer();
|
|
275
|
+
* ```
|
|
276
|
+
*/
|
|
277
|
+
hideOZViewer<T = any>(): Promise<CommonOzBridgetResponseType$1<T>>;
|
|
278
|
+
/**
|
|
279
|
+
* ### Bridge for Oz
|
|
280
|
+
* 오즈 파라미터에서 사용할 OZD를 다운받는 브릿지입니다
|
|
281
|
+
* @example
|
|
282
|
+
* ```tsx
|
|
283
|
+
* const data = [
|
|
284
|
+
* { name: "문서1", file: ["doc1.ozd"], complete: true },
|
|
285
|
+
* { name: "문서2", file: ["doc2.ozd", "doc3.ozd"], complete: true }
|
|
286
|
+
* ]
|
|
287
|
+
* await Bridge.native.downloadDocument(data)
|
|
288
|
+
* ```
|
|
289
|
+
* returnData는 file 경로가 절대경로로 매핑되어 돌아온다
|
|
290
|
+
* ```json
|
|
291
|
+
* {
|
|
292
|
+
* "action":"downloadDocument",
|
|
293
|
+
* "data":[
|
|
294
|
+
* {
|
|
295
|
+
* "name":"aaa",
|
|
296
|
+
* "file":[
|
|
297
|
+
* "/data/user/0/com.hanwhalife.ssp.stg/files/A0010.ozd",
|
|
298
|
+
* "/data/user/0/com.hanwhalife.ssp.stg/files/C0401.ozd"
|
|
299
|
+
* ],
|
|
300
|
+
* "complete":false
|
|
301
|
+
* },
|
|
302
|
+
* {
|
|
303
|
+
* "name":"bbb",
|
|
304
|
+
* "file":[
|
|
305
|
+
* "/data/user/0/com.hanwhalife.ssp.stg/files/A1500.ozd"
|
|
306
|
+
* ],
|
|
307
|
+
* "complete":false
|
|
308
|
+
* }
|
|
309
|
+
* ]
|
|
310
|
+
* }
|
|
311
|
+
* ```
|
|
312
|
+
*/
|
|
313
|
+
downloadDocument<T = any>(options: DownloadOzdOptions$1): Promise<CommonOzBridgetResponseType$1<T>>;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* OZ 관련 브릿지 통신에서 기본적으로 사용되는 리턴 타입 구조.
|
|
318
|
+
* 제네릭 타입 T는 리턴되는 데이터의 형태를 나타냅니다.
|
|
319
|
+
*/
|
|
320
|
+
interface CommonOzBridgetResponseType<T> {
|
|
321
|
+
/** 실행된 브릿지 액션의 이름 */
|
|
322
|
+
action: string;
|
|
323
|
+
/** stringify된 리턴 데이터 */
|
|
324
|
+
data: T;
|
|
325
|
+
}
|
|
158
326
|
/**
|
|
159
327
|
* 오즈 뷰어 함수 `CreateReport`를 호출할 때 사용하는 브릿지용 입력 옵션
|
|
160
328
|
*/
|
|
@@ -253,9 +421,6 @@ type DocumentInfo = {
|
|
|
253
421
|
/** 전체보고서에서 서식의 시작페이지 */
|
|
254
422
|
endPage: number;
|
|
255
423
|
};
|
|
256
|
-
/**
|
|
257
|
-
* OZD를 다운받을때 사용하는 브릿지의 옵션
|
|
258
|
-
*/
|
|
259
424
|
type DownloadOzdOptions = {
|
|
260
425
|
data: Array<DocumentInfo>;
|
|
261
426
|
};
|
|
@@ -277,31 +442,15 @@ interface SaveSignImgOptions {
|
|
|
277
442
|
/** 추출할 서명의 FORM ID */
|
|
278
443
|
signImageKey: string;
|
|
279
444
|
}
|
|
280
|
-
/**
|
|
281
|
-
* OZ 관련 브릿지 통신에서 기본적으로 사용되는 리턴 타입 구조.
|
|
282
|
-
* 제네릭 타입 T는 리턴되는 데이터의 형태를 나타냅니다.
|
|
283
|
-
*/
|
|
284
|
-
interface CommonOzBridgetResponseType<T> {
|
|
285
|
-
/** 실행된 브릿지 액션의 이름 */
|
|
286
|
-
action: string;
|
|
287
|
-
/** stringify된 리턴 데이터 */
|
|
288
|
-
data: T;
|
|
289
|
-
}
|
|
290
445
|
interface createOzPdfViewerOptions {
|
|
291
446
|
/** PDF 경로 + 파일이름 */
|
|
292
447
|
filePath: string;
|
|
293
448
|
}
|
|
294
449
|
|
|
295
450
|
/**
|
|
296
|
-
* 네이티브 브릿지 구현 함수
|
|
451
|
+
* 네이티브(오즈 전용) 브릿지 구현 함수
|
|
297
452
|
*/
|
|
298
|
-
interface
|
|
299
|
-
getParameterMap<T>(): Promise<T>;
|
|
300
|
-
dismissPopup<T>(option: any): Promise<T>;
|
|
301
|
-
showWebPopup<T>(options: ShowWebPopupOptions): Promise<T>;
|
|
302
|
-
jumpSafari<T>(options: ShowWebPopupOptions): Promise<T>;
|
|
303
|
-
createReportEx<T>(options: CreateReportExOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
304
|
-
hideViewer<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
453
|
+
interface INativeBridgeOz {
|
|
305
454
|
getInformation<T>(options: GetInformationOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
306
455
|
getGlobal<T>(options: GetGlobalOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
307
456
|
setGlobal<T>(options: SetGlobalOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
@@ -310,63 +459,25 @@ interface INativeBridge {
|
|
|
310
459
|
triggerExternalEvent<T>(options: TriggerExternalEventOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
311
460
|
triggerExternalEventByDocIndex<T>(options: TriggerExternalEventByDocIndexOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
312
461
|
getOzFontParam<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
313
|
-
downloadDocument<T>(options: DownloadOzdOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
314
462
|
updateOzDocumentStatus<T>(options: UpdateOzdOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
315
463
|
savePdf<T>(options: SavePdfOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
316
464
|
saveSignImg<T>(options: SaveSignImgOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
317
465
|
createOzPdfViewer<T>(options: createOzPdfViewerOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
318
466
|
hideOzPdfViewer<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
319
|
-
|
|
467
|
+
showLoader<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
468
|
+
hideLoader<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
320
469
|
}
|
|
321
470
|
|
|
322
471
|
/**
|
|
323
|
-
* App - Web Bridge
|
|
472
|
+
* App - Web Bridge(for OZ)
|
|
324
473
|
*/
|
|
325
|
-
declare class
|
|
474
|
+
declare class NativeBridgeOz extends CommonBridge implements INativeBridgeOz {
|
|
326
475
|
private core;
|
|
327
476
|
constructor();
|
|
328
477
|
/**
|
|
329
478
|
* Iframe, App 공통으로 구현해야할 함수
|
|
330
479
|
*/
|
|
331
480
|
hello(): void;
|
|
332
|
-
/**
|
|
333
|
-
* getParameterMap
|
|
334
|
-
* @returns
|
|
335
|
-
*/
|
|
336
|
-
getParameterMap<T = any>(): Promise<T>;
|
|
337
|
-
dismissPopup<T = any>(options?: any): Promise<T>;
|
|
338
|
-
/**
|
|
339
|
-
*
|
|
340
|
-
* @param options
|
|
341
|
-
* @returns
|
|
342
|
-
*/
|
|
343
|
-
showWebPopup<T = any>(options: ShowWebPopupOptions): Promise<T>;
|
|
344
|
-
/**
|
|
345
|
-
*
|
|
346
|
-
* @param options
|
|
347
|
-
* @returns
|
|
348
|
-
*/
|
|
349
|
-
jumpSafari<T = any>(options: ShowWebPopupOptions): Promise<T>;
|
|
350
|
-
/**
|
|
351
|
-
* ### Bridge for Oz
|
|
352
|
-
* 설정한 뷰어 파라미터를 기준으로 뷰어에 새로운 보고서를 바인딩합니다.
|
|
353
|
-
* @example
|
|
354
|
-
* ```tsx
|
|
355
|
-
* // 사용 예시
|
|
356
|
-
* Bridge.native.createReportEx({ param: "connection.openfile=sample.ozd" });
|
|
357
|
-
* ```
|
|
358
|
-
*/
|
|
359
|
-
createReportEx<T = any>(options: CreateReportExOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
360
|
-
/**
|
|
361
|
-
* ### Bridge for Oz
|
|
362
|
-
* OZ 뷰어를 닫습니다
|
|
363
|
-
* @example
|
|
364
|
-
* ```tsx
|
|
365
|
-
* // 사용 예시
|
|
366
|
-
* Bridge.native.hideViewer();
|
|
367
|
-
* ```
|
|
368
|
-
*/
|
|
369
|
-
hideViewer<T = any>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
370
481
|
/**
|
|
371
482
|
* ### Bridge for Oz
|
|
372
483
|
* 오즈 뷰어의 정보를 가져옵니다
|
|
@@ -454,42 +565,6 @@ declare class NativeBridge extends CommonBridge implements INativeBridge {
|
|
|
454
565
|
* ```
|
|
455
566
|
*/
|
|
456
567
|
getOzFontParam<T = any>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
457
|
-
/**
|
|
458
|
-
* ### Bridge for Oz
|
|
459
|
-
* 오즈 파라미터에서 사용할 OZD를 다운받는 브릿지입니다
|
|
460
|
-
* @example
|
|
461
|
-
* ```tsx
|
|
462
|
-
* const data = [
|
|
463
|
-
* { name: "문서1", file: ["doc1.ozd"], complete: true },
|
|
464
|
-
* { name: "문서2", file: ["doc2.ozd", "doc3.ozd"], complete: true }
|
|
465
|
-
* ]
|
|
466
|
-
* await Bridge.native.downloadDocument(data)
|
|
467
|
-
* ```
|
|
468
|
-
* returnData는 file 경로가 절대경로로 매핑되어 돌아온다
|
|
469
|
-
* ```json
|
|
470
|
-
* {
|
|
471
|
-
* "action":"downloadDocument",
|
|
472
|
-
* "data":[
|
|
473
|
-
* {
|
|
474
|
-
* "name":"aaa",
|
|
475
|
-
* "file":[
|
|
476
|
-
* "/data/user/0/com.hanwhalife.ssp.stg/files/A0010.ozd",
|
|
477
|
-
* "/data/user/0/com.hanwhalife.ssp.stg/files/C0401.ozd"
|
|
478
|
-
* ],
|
|
479
|
-
* "complete":false
|
|
480
|
-
* },
|
|
481
|
-
* {
|
|
482
|
-
* "name":"bbb",
|
|
483
|
-
* "file":[
|
|
484
|
-
* "/data/user/0/com.hanwhalife.ssp.stg/files/A1500.ozd"
|
|
485
|
-
* ],
|
|
486
|
-
* "complete":false
|
|
487
|
-
* }
|
|
488
|
-
* ]
|
|
489
|
-
* }
|
|
490
|
-
* ```
|
|
491
|
-
*/
|
|
492
|
-
downloadDocument<T = any>(options: DownloadOzdOptions): Promise<CommonOzBridgetResponseType<T>>;
|
|
493
568
|
/**
|
|
494
569
|
* ### Bridge for Oz
|
|
495
570
|
* 서식의 진행중/완료 상태를 업데이트하는 브릿지
|
|
@@ -536,34 +611,84 @@ declare class NativeBridge extends CommonBridge implements INativeBridge {
|
|
|
536
611
|
*/
|
|
537
612
|
hideOzPdfViewer<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
538
613
|
/**
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
*
|
|
614
|
+
* 로더 컴포넌트 show
|
|
615
|
+
* @example
|
|
616
|
+
* ```tsx
|
|
617
|
+
* // 사용 예시
|
|
618
|
+
* await Bridge.native.showLoader()
|
|
619
|
+
* ```
|
|
543
620
|
*/
|
|
544
|
-
|
|
621
|
+
showLoader<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
622
|
+
/**
|
|
623
|
+
* 로더 컴포넌트 hide
|
|
624
|
+
* @example
|
|
625
|
+
* ```tsx
|
|
626
|
+
* // 사용 예시
|
|
627
|
+
* await Bridge.native.hideLoader()
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
hideLoader<T>(): Promise<CommonOzBridgetResponseType<T>>;
|
|
545
631
|
}
|
|
546
632
|
|
|
547
|
-
type NativeAction = keyof INativeBridge;
|
|
548
|
-
type RetainCallback<T = any> = (params: T) => void;
|
|
549
633
|
/**
|
|
550
634
|
* Command의 옵션
|
|
551
635
|
*/
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
636
|
+
type NativeBridgeOptions = Record<string, any>;
|
|
637
|
+
/**
|
|
638
|
+
* Promise를 위한 타입
|
|
639
|
+
*/
|
|
640
|
+
interface NativeBridgePromise<T = any> {
|
|
641
|
+
resolve: (value: T) => void;
|
|
642
|
+
reject: (reason?: any) => void;
|
|
643
|
+
}
|
|
644
|
+
interface PromiseHandleBridge {
|
|
645
|
+
promises: Record<string, NativeBridgePromise>;
|
|
646
|
+
resolvePromise: (promiseId: string, data?: any, error?: any) => void;
|
|
647
|
+
finallyResolvePromise: (promiseId: string, data?: any, error?: any) => void;
|
|
648
|
+
}
|
|
649
|
+
interface CallBridge {
|
|
650
|
+
callFromWeb?: (command: string) => void;
|
|
651
|
+
}
|
|
652
|
+
interface CombinedBridge extends PromiseHandleBridge, CallBridge {
|
|
653
|
+
}
|
|
654
|
+
declare global {
|
|
655
|
+
interface Window {
|
|
656
|
+
n2bridge: PromiseHandleBridge;
|
|
657
|
+
n2Bridge: CallBridge;
|
|
658
|
+
n2OzBridge: CombinedBridge;
|
|
659
|
+
webkit: {
|
|
660
|
+
messageHandlers: {
|
|
661
|
+
n2Bridge: {
|
|
662
|
+
postMessage: (command: string) => void;
|
|
663
|
+
};
|
|
664
|
+
n2OzBridge: {
|
|
665
|
+
postMessage: (command: string) => void;
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
}
|
|
555
670
|
}
|
|
556
671
|
|
|
557
672
|
/**
|
|
558
|
-
* Native
|
|
673
|
+
* Native <-> Web 처리를 위한 핵심 클래스
|
|
559
674
|
* 담당: 앱 호출, Promise 관리
|
|
560
675
|
*/
|
|
561
|
-
declare class NativeBridgeCore extends CommonBridgeCore {
|
|
562
|
-
|
|
676
|
+
declare class NativeBridgeCore<TAction extends string> extends CommonBridgeCore {
|
|
677
|
+
private promiseHandleName;
|
|
678
|
+
private callBridgeName;
|
|
679
|
+
constructor(callBridgeName?: string, promiseHandleName?: string);
|
|
563
680
|
/**
|
|
564
|
-
*
|
|
681
|
+
* Promise 관리용 브릿지 객체 가져오기 (window.n2bridge)
|
|
565
682
|
*/
|
|
566
|
-
private
|
|
683
|
+
private getPromiseHandleBridge;
|
|
684
|
+
/**
|
|
685
|
+
* 앱 호출용 브릿지 객체 가져오기 (window.n2Bridge)
|
|
686
|
+
*/
|
|
687
|
+
private getCallBridge;
|
|
688
|
+
/**
|
|
689
|
+
* 네이티브 통신을 위해 window.n2OzBridge 객체 초기화
|
|
690
|
+
*/
|
|
691
|
+
private initializeWindowOzBridge;
|
|
567
692
|
/**
|
|
568
693
|
* Promise 처리 함수(Native에서 호출)
|
|
569
694
|
* @returns
|
|
@@ -574,19 +699,13 @@ declare class NativeBridgeCore extends CommonBridgeCore {
|
|
|
574
699
|
* @returns
|
|
575
700
|
*/
|
|
576
701
|
private createFinallyResolvePromiseHandler;
|
|
577
|
-
/**
|
|
578
|
-
* Native 에서 웹으로 호출하는 함수
|
|
579
|
-
* TODO: 필요시 추가 코딩
|
|
580
|
-
* @returns
|
|
581
|
-
*/
|
|
582
|
-
private createCallFromNativeHandler;
|
|
583
702
|
/**
|
|
584
703
|
* 네이티브 통신
|
|
585
704
|
* @param action
|
|
586
705
|
* @param options
|
|
587
706
|
* @returns
|
|
588
707
|
*/
|
|
589
|
-
callToTarget<T>(action:
|
|
708
|
+
callToTarget<T>(action: TAction, option?: NativeBridgeOptions): Promise<T>;
|
|
590
709
|
/**
|
|
591
710
|
* promiseId를 초기화 해줍니다.
|
|
592
711
|
* @param promiseId
|
|
@@ -596,8 +715,9 @@ declare class NativeBridgeCore extends CommonBridgeCore {
|
|
|
596
715
|
|
|
597
716
|
declare const Bridge: {
|
|
598
717
|
native: NativeBridge;
|
|
718
|
+
nativeOz: NativeBridgeOz;
|
|
599
719
|
iframe: IframeBridge;
|
|
600
|
-
nativeCore: NativeBridgeCore
|
|
720
|
+
nativeCore: NativeBridgeCore<string>;
|
|
601
721
|
iframeCore: IframeBridgeCore;
|
|
602
722
|
};
|
|
603
723
|
|
|
@@ -832,14 +952,23 @@ type ExtraDataType = Record<string, {
|
|
|
832
952
|
extraParam?: string[];
|
|
833
953
|
}>;
|
|
834
954
|
type Props$1 = {
|
|
835
|
-
|
|
955
|
+
documentList: string[];
|
|
836
956
|
extraData?: ExtraDataType;
|
|
837
957
|
};
|
|
838
|
-
declare function useCreateReport({
|
|
839
|
-
documentList: string[];
|
|
958
|
+
declare function useCreateReport({ documentList, extraData }: Props$1): {
|
|
840
959
|
CreateReport: () => Promise<void>;
|
|
841
960
|
};
|
|
842
961
|
|
|
962
|
+
declare function useDocumentInfo(initialValue: DocumentInfo$1[]): {
|
|
963
|
+
setDocumentInfo: react.Dispatch<react.SetStateAction<DocumentInfo$1[]>>;
|
|
964
|
+
documentInfo: DocumentInfo$1[];
|
|
965
|
+
documentList: string[];
|
|
966
|
+
documentTemplateMap: Record<string, DocumentInfo$1>;
|
|
967
|
+
documentIndexMap: Record<string, number>;
|
|
968
|
+
nameTemplateMap: Record<string, DocumentInfo$1>;
|
|
969
|
+
groupIndexes: number[][];
|
|
970
|
+
};
|
|
971
|
+
|
|
843
972
|
type Props<T, R = void> = {
|
|
844
973
|
event: OZViewerEvent;
|
|
845
974
|
handler: (e: CustomEvent<T>) => Promise<R>;
|
|
@@ -849,16 +978,16 @@ type Props<T, R = void> = {
|
|
|
849
978
|
*/
|
|
850
979
|
declare function useOzEventListener<T, R = void>({ event, handler }: Props<T, R>): void;
|
|
851
980
|
|
|
852
|
-
declare function fetchDocument(options: Array<DocumentInfo>): Promise<{
|
|
981
|
+
declare function fetchDocument(options: Array<DocumentInfo$1>): Promise<{
|
|
853
982
|
startPage: number;
|
|
854
983
|
endPage: number;
|
|
855
984
|
name: string;
|
|
856
|
-
file: NonEmptyArray<string>;
|
|
985
|
+
file: NonEmptyArray$1<string>;
|
|
857
986
|
complete: boolean;
|
|
858
987
|
focus: boolean;
|
|
859
988
|
}[]>;
|
|
860
989
|
declare function fetchFont(): Promise<string[]>;
|
|
861
|
-
declare function categorizeByPageRange(data: DocumentInfo[], pageCounts: number[]): DocumentInfo[];
|
|
990
|
+
declare function categorizeByPageRange(data: DocumentInfo$1[], pageCounts: number[]): DocumentInfo$1[];
|
|
862
991
|
/**
|
|
863
992
|
* 주어진 파일 경로에서 파일 이름만 추출합니다.
|
|
864
993
|
* @param filePath 파일 경로 (예: `/a/b/c/file.ext`)
|
|
@@ -866,6 +995,6 @@ declare function categorizeByPageRange(data: DocumentInfo[], pageCounts: number[
|
|
|
866
995
|
* @throws {Error} 유효하지 않은 파일 경로일 경우 예외 처리
|
|
867
996
|
*/
|
|
868
997
|
declare function extractFileName(filePath: string): string;
|
|
869
|
-
declare function getFileListByGlobalIndex(index: number, data: DocumentInfo[]): DocumentInfo | null;
|
|
998
|
+
declare function getFileListByGlobalIndex(index: number, data: DocumentInfo$1[]): DocumentInfo$1 | null;
|
|
870
999
|
|
|
871
|
-
export { Bridge, type ExtraDataType, type OZBtnTouchEvent, type OZEFormInputEvent, type OZExportEvent, type OZViewerChangeEvent, type OZViewerErrorEvent, OZViewerEvent, type OZViewerPageBindEvent, type OZViewerProgressEvent, type OZViewerUserEvent, btnStyle, categorizeByPageRange, commonOzParam, commonPdfExportParam, extractFileName, fetchDocument, fetchFont, getFileListByGlobalIndex, useCreateReport, useOzEventListener, wrapperStyle };
|
|
1000
|
+
export { Bridge, type ExtraDataType, type OZBtnTouchEvent, type OZEFormInputEvent, type OZExportEvent, type OZViewerChangeEvent, type OZViewerErrorEvent, OZViewerEvent, type OZViewerPageBindEvent, type OZViewerProgressEvent, type OZViewerUserEvent, btnStyle, categorizeByPageRange, commonOzParam, commonPdfExportParam, extractFileName, fetchDocument, fetchFont, getFileListByGlobalIndex, useCreateReport, useDocumentInfo, useOzEventListener, wrapperStyle };
|