@univerjs-pro/exchange-client 0.4.2-nightly.202411071606 → 0.4.2-nightly.202411091134
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/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +2 -1
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/types/index.d.ts +483 -10
- package/lib/umd/facade.js +1 -2
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +23 -15
- package/lib/exchange.service-j28_A1tl.mjs +0 -2481
- package/lib/locale/en-US.js +0 -1
- package/lib/locale/fa-IR.js +0 -1
- package/lib/locale/ru-RU.js +0 -1
- package/lib/locale/vi-VN.js +0 -1
- package/lib/locale/zh-CN.js +0 -1
- package/lib/locale/zh-TW.js +0 -1
- package/lib/types/controllers/config.schema.d.ts +0 -16
- package/lib/types/controllers/exchange.controller.d.ts +0 -8
- package/lib/types/facade/f-univer.d.ts +0 -36
- package/lib/types/facade/index.d.ts +0 -1
- package/lib/types/locale/en-US.d.ts +0 -3
- package/lib/types/locale/fa-IR.d.ts +0 -3
- package/lib/types/locale/ru-RU.d.ts +0 -3
- package/lib/types/locale/vi-VN.d.ts +0 -3
- package/lib/types/locale/zh-CN.d.ts +0 -21
- package/lib/types/locale/zh-TW.d.ts +0 -3
- package/lib/types/plugin.d.ts +0 -11
- package/lib/types/services/__tests__/snapshot.spec.d.ts +0 -16
- package/lib/types/services/exchange.service.d.ts +0 -87
- package/lib/types/services/operate.service.d.ts +0 -121
- package/lib/types/services/request.service.d.ts +0 -107
- package/lib/types/services/upload-notification.service.d.ts +0 -52
- package/lib/types/services/utils/snapshot.d.ts +0 -76
- package/lib/types/services/utils/tool.d.ts +0 -19
- package/lib/types/views/UploadNotificationContainer.d.ts +0 -2
- package/lib/types/views/link-list/LinkList.d.ts +0 -6
- package/lib/types/views/upload-again/UploadAgain.d.ts +0 -2
- package/lib/types/views/upload-button/UploadButton.d.ts +0 -7
- package/lib/types/views/upload-error/UploadError.d.ts +0 -2
- package/lib/types/views/upload-notification/UploadNotification.d.ts +0 -2
- package/lib/types/views/upload-success/UploadSuccess.d.ts +0 -5
- package/lib/types/views/uploading/Uploading.d.ts +0 -2
- package/lib/types/views/uploading/upload-cancel/UploadCancel.d.ts +0 -2
- package/lib/types/views/uploading/upload-progress/UploadProgress.d.ts +0 -5
package/lib/locale/en-US.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
const _0x25f02f=_0xd927;(function(_0x429d02,_0x15334f){const _0x434c1f=_0xd927,_0x39cc04=_0x429d02();while(!![]){try{const _0x12283f=parseInt(_0x434c1f(0x1b6))/0x1*(-parseInt(_0x434c1f(0x1a4))/0x2)+parseInt(_0x434c1f(0x1a6))/0x3*(parseInt(_0x434c1f(0x1bc))/0x4)+parseInt(_0x434c1f(0x1ad))/0x5+parseInt(_0x434c1f(0x1b8))/0x6+parseInt(_0x434c1f(0x1a8))/0x7*(parseInt(_0x434c1f(0x1ae))/0x8)+-parseInt(_0x434c1f(0x1b9))/0x9*(parseInt(_0x434c1f(0x1a9))/0xa)+parseInt(_0x434c1f(0x1a3))/0xb*(-parseInt(_0x434c1f(0x1b0))/0xc);if(_0x12283f===_0x15334f)break;else _0x39cc04['push'](_0x39cc04['shift']());}catch(_0x32648){_0x39cc04['push'](_0x39cc04['shift']());}}}(_0x32a5,0x5a002));const e={'exchange':{'file':_0x25f02f(0x1b4),'upload':'Open(File)','download':_0x25f02f(0x1b3),'uploading':_0x25f02f(0x1b2),'uploadSuccess':_0x25f02f(0x1a5),'uploadSuccessTip':_0x25f02f(0x1b1),'downloading':_0x25f02f(0x1a2),'downloadSuccess':_0x25f02f(0x1ab),'unknownMistake':_0x25f02f(0x1ba),'networkError':_0x25f02f(0x1b7),'tooLarge':_0x25f02f(0x1bb),'internalError':_0x25f02f(0x1af),'interrupt':_0x25f02f(0x1aa),'wait':_0x25f02f(0x1ac),'cancel':_0x25f02f(0x1b5),'uploadAgain':_0x25f02f(0x1a7)}};function _0xd927(_0x2beff8,_0x576cde){const _0x32a5df=_0x32a5();return _0xd927=function(_0xd92728,_0x332f1e){_0xd92728=_0xd92728-0x1a2;let _0x560b56=_0x32a5df[_0xd92728];return _0x560b56;},_0xd927(_0x2beff8,_0x576cde);}export{e as default};function _0x32a5(){const _0xa15c45=['Downloading','818136udyUOg','112364KBtYNp','File\x20uploaded\x20successfully','66tDGmqD','Upload\x20again','1766135NJnHTa','10vFmTcV','The\x20network\x20connection\x20was\x20interrupted\x20and\x20the\x20file\x20upload\x20failed.','Download\x20success','Please\x20wait...','3488355mibBAo','16FsiWsg','Internal\x20unknown\x20error','48oUJuiB','{0}\x20file(s)\x20uploaded\x20successfully','Uploading','Save\x20As','File','Cancel','10zZxkIa','Network\x20error','1464144fRtZSg','4305411rrXtWl','Unknown\x20mistake','Data\x20is\x20too\x20large','47280eqkrxH'];_0x32a5=function(){return _0xa15c45;};return _0x32a5();}
|
package/lib/locale/fa-IR.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
function _0x4ec6(_0x1f5e19,_0x152b1a){const _0x2e80e6=_0x2e80();return _0x4ec6=function(_0x4ec62a,_0x282009){_0x4ec62a=_0x4ec62a-0xc2;let _0x1569cc=_0x2e80e6[_0x4ec62a];return _0x1569cc;},_0x4ec6(_0x1f5e19,_0x152b1a);}const _0x5baddc=_0x4ec6;(function(_0x1bb4c6,_0x316b4b){const _0x463110=_0x4ec6,_0x321b52=_0x1bb4c6();while(!![]){try{const _0x3cc996=parseInt(_0x463110(0xc8))/0x1*(parseInt(_0x463110(0xc7))/0x2)+-parseInt(_0x463110(0xcb))/0x3*(parseInt(_0x463110(0xc3))/0x4)+-parseInt(_0x463110(0xd2))/0x5*(-parseInt(_0x463110(0xd3))/0x6)+parseInt(_0x463110(0xcc))/0x7+-parseInt(_0x463110(0xcf))/0x8*(parseInt(_0x463110(0xd5))/0x9)+parseInt(_0x463110(0xce))/0xa*(parseInt(_0x463110(0xd8))/0xb)+parseInt(_0x463110(0xc5))/0xc;if(_0x3cc996===_0x316b4b)break;else _0x321b52['push'](_0x321b52['shift']());}catch(_0x192762){_0x321b52['push'](_0x321b52['shift']());}}}(_0x2e80,0xd0971));function _0x2e80(){const _0x47bc59=['داده\x20خیلی\x20بزرگ\x20است','{0}\x20فایل\x20با\x20موفقیت\x20بارگذاری\x20شد','6AOTZwI','1903720aBmwDR','اتصال\x20شبکه\x20قطع\x20شد\x20و\x20بارگذاری\x20فایل\x20ناموفق\x20بود.','10lGqCRU','268544WOQLHw','فایل\x20با\x20موفقیت\x20بارگذاری\x20شد','خطای\x20شبکه','25hFXAia','698310RTPsxZ','لغو','342hvNoaP','خطای\x20ناشناخته','فایل','9477237KfJDNc','لطفا\x20صبر\x20کنید...','2974972tNLUZW','در\x20حال\x20دانلود','4097280AqXhFI','بارگذاری\x20مجدد','3121126OLwBxj','1ObyjOt'];_0x2e80=function(){return _0x47bc59;};return _0x2e80();}const o={'exchange':{'file':_0x5baddc(0xd7),'upload':'بازکردن(فایل)','download':'ذخیره\x20به\x20عنوان','uploading':'در\x20حال\x20بارگذاری','uploadSuccess':_0x5baddc(0xd0),'uploadSuccessTip':_0x5baddc(0xca),'downloading':_0x5baddc(0xc4),'downloadSuccess':'دانلود\x20موفقیت\x20آمیز','unknownMistake':_0x5baddc(0xd6),'networkError':_0x5baddc(0xd1),'tooLarge':_0x5baddc(0xc9),'internalError':'خطای\x20داخلی\x20ناشناخته','interrupt':_0x5baddc(0xcd),'wait':_0x5baddc(0xc2),'cancel':_0x5baddc(0xd4),'uploadAgain':_0x5baddc(0xc6)}};export{o as default};
|
package/lib/locale/ru-RU.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
const _0x5c1ba6=_0x2c1b;function _0x2c1b(_0x3e081f,_0xd862f2){const _0x559c80=_0x559c();return _0x2c1b=function(_0x2c1b2f,_0x4ac944){_0x2c1b2f=_0x2c1b2f-0xe7;let _0x54a6e3=_0x559c80[_0x2c1b2f];return _0x54a6e3;},_0x2c1b(_0x3e081f,_0xd862f2);}function _0x559c(){const _0x4471f0=['Открыть(Файл)','Пожалуйста,\x20подождите...','Скачивание\x20успешно','Файл','Отмена','11626420WlLuha','Внутренняя\x20неизвестная\x20ошибка','Скачивание','56135jEJibv','224bNYlwe','2381904JBwaHh','Данные\x20слишком\x20большие','Файл\x20успешно\x20загружен','Неизвестная\x20ошибка','Загрузить\x20снова','1326776Btevov','Загрузка','1190399OGksbo','Сетевое\x20соединение\x20было\x20прервано,\x20и\x20загрузка\x20файла\x20не\x20удалась.','2aeLhSk','1192095nMRRHh','7UJKkUI','4419966DefHVa'];_0x559c=function(){return _0x4471f0;};return _0x559c();}(function(_0x377f4c,_0x31d5f2){const _0x27ed39=_0x2c1b,_0x5ea723=_0x377f4c();while(!![]){try{const _0x1ae19f=-parseInt(_0x27ed39(0xe7))/0x1*(-parseInt(_0x27ed39(0xe9))/0x2)+-parseInt(_0x27ed39(0xea))/0x3+parseInt(_0x27ed39(0xf6))/0x4*(-parseInt(_0x27ed39(0xf5))/0x5)+-parseInt(_0x27ed39(0xec))/0x6*(parseInt(_0x27ed39(0xeb))/0x7)+-parseInt(_0x27ed39(0xfc))/0x8+parseInt(_0x27ed39(0xf7))/0x9+parseInt(_0x27ed39(0xf2))/0xa;if(_0x1ae19f===_0x31d5f2)break;else _0x5ea723['push'](_0x5ea723['shift']());}catch(_0x3ce569){_0x5ea723['push'](_0x5ea723['shift']());}}}(_0x559c,0xa83d8));const o={'exchange':{'file':_0x5c1ba6(0xf0),'upload':_0x5c1ba6(0xed),'download':'Сохранить\x20как','uploading':_0x5c1ba6(0xfd),'uploadSuccess':_0x5c1ba6(0xf9),'uploadSuccessTip':'{0}\x20файл(ов)\x20успешно\x20загружен(о)','downloading':_0x5c1ba6(0xf4),'downloadSuccess':_0x5c1ba6(0xef),'unknownMistake':_0x5c1ba6(0xfa),'networkError':'Сетевая\x20ошибка','tooLarge':_0x5c1ba6(0xf8),'internalError':_0x5c1ba6(0xf3),'interrupt':_0x5c1ba6(0xe8),'wait':_0x5c1ba6(0xee),'cancel':_0x5c1ba6(0xf1),'uploadAgain':_0x5c1ba6(0xfb)}};export{o as default};
|
package/lib/locale/vi-VN.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
const _0x4eb4ba=_0x48b6;(function(_0xbf6143,_0x513bb8){const _0x43b9f1=_0x48b6,_0x10877b=_0xbf6143();while(!![]){try{const _0x3107a7=-parseInt(_0x43b9f1(0x1d7))/0x1+-parseInt(_0x43b9f1(0x1c8))/0x2*(parseInt(_0x43b9f1(0x1ce))/0x3)+parseInt(_0x43b9f1(0x1c1))/0x4+-parseInt(_0x43b9f1(0x1d6))/0x5*(parseInt(_0x43b9f1(0x1c5))/0x6)+parseInt(_0x43b9f1(0x1c6))/0x7+-parseInt(_0x43b9f1(0x1d1))/0x8*(parseInt(_0x43b9f1(0x1d2))/0x9)+parseInt(_0x43b9f1(0x1d4))/0xa*(parseInt(_0x43b9f1(0x1ca))/0xb);if(_0x3107a7===_0x513bb8)break;else _0x10877b['push'](_0x10877b['shift']());}catch(_0x28138c){_0x10877b['push'](_0x10877b['shift']());}}}(_0x43fe,0x762c4));function _0x48b6(_0x4ce268,_0xb66e4){const _0x43fe6f=_0x43fe();return _0x48b6=function(_0x48b630,_0x27919c){_0x48b630=_0x48b630-0x1c1;let _0x1f936d=_0x43fe6f[_0x48b630];return _0x1f936d;},_0x48b6(_0x4ce268,_0xb66e4);}const n={'exchange':{'file':_0x4eb4ba(0x1c3),'upload':_0x4eb4ba(0x1cc),'download':'Lưu\x20dưới\x20dạng','uploading':'Đang\x20tải\x20lên','uploadSuccess':_0x4eb4ba(0x1c2),'uploadSuccessTip':_0x4eb4ba(0x1c7),'downloading':_0x4eb4ba(0x1d0),'downloadSuccess':_0x4eb4ba(0x1c4),'unknownMistake':_0x4eb4ba(0x1cb),'networkError':_0x4eb4ba(0x1d3),'tooLarge':_0x4eb4ba(0x1c9),'internalError':'Lỗi\x20không\x20xác\x20định\x20bên\x20trong','interrupt':_0x4eb4ba(0x1d5),'wait':'Vui\x20lòng\x20đợi...','cancel':_0x4eb4ba(0x1cf),'uploadAgain':_0x4eb4ba(0x1cd)}};function _0x43fe(){const _0x2c54c7=['Tệp','Tải\x20xuống\x20thành\x20công','151074lldOtZ','2224803OycMSy','{0}\x20tệp\x20đã\x20được\x20tải\x20lên\x20thành\x20công','38JwuBpE','Luồng\x20dữ\x20liệu\x20quá\x20lớn','13013EQrZXS','Lỗi\x20không\x20xác\x20định','Mở\x20(Tệp)','Tải\x20lên\x20lại','23211RwkPux','Hủy\x20bỏ','Đang\x20tải\x20xuống','4057928KeJPLj','9CcHRIF','Lỗi\x20mạng','6310SwSXzx','Kết\x20nối\x20mạng\x20bị\x20gián\x20đoạn,\x20tải\x20lên\x20tệp\x20thất\x20bại.','110JiZOPj','258254vnOvWS','3544680HBqOCv','Tải\x20lên\x20tệp\x20thành\x20công'];_0x43fe=function(){return _0x2c54c7;};return _0x43fe();}export{n as default};
|
package/lib/locale/zh-CN.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
const _0x47cf78=_0x4f15;(function(_0x20a2a4,_0x8c3c79){const _0x44365f=_0x4f15,_0x55f945=_0x20a2a4();while(!![]){try{const _0x2a63de=-parseInt(_0x44365f(0x7a))/0x1*(-parseInt(_0x44365f(0x76))/0x2)+parseInt(_0x44365f(0x7c))/0x3+-parseInt(_0x44365f(0x77))/0x4*(parseInt(_0x44365f(0x6e))/0x5)+-parseInt(_0x44365f(0x75))/0x6+parseInt(_0x44365f(0x7b))/0x7+-parseInt(_0x44365f(0x7e))/0x8+parseInt(_0x44365f(0x73))/0x9;if(_0x2a63de===_0x8c3c79)break;else _0x55f945['push'](_0x55f945['shift']());}catch(_0x1f10ac){_0x55f945['push'](_0x55f945['shift']());}}}(_0x5282,0xe2f49));function _0x5282(){const _0x4fac2f=['1ZDcMRc','1988826LPcMao','169425AhtzsJ','网络异常','2036568xJYvfk','下载中','855LTeiHI','未知错误','内部未知错误','{0}个文件上传成功','下载成功','15940053OHntVi','另存为','10073496vjqMsb','3652926ccqcbu','25148jTvDdZ','文件上传成功','数据流过大'];_0x5282=function(){return _0x4fac2f;};return _0x5282();}function _0x4f15(_0x423588,_0x1f89a5){const _0x5282a3=_0x5282();return _0x4f15=function(_0x4f157e,_0x376259){_0x4f157e=_0x4f157e-0x6e;let _0x3dc398=_0x5282a3[_0x4f157e];return _0x3dc398;},_0x4f15(_0x423588,_0x1f89a5);}const o={'exchange':{'file':'文件','upload':'打开(文件)','download':_0x47cf78(0x74),'uploading':'上传中','uploadSuccess':_0x47cf78(0x78),'uploadSuccessTip':_0x47cf78(0x71),'downloading':_0x47cf78(0x7f),'downloadSuccess':_0x47cf78(0x72),'unknownMistake':_0x47cf78(0x6f),'networkError':_0x47cf78(0x7d),'tooLarge':_0x47cf78(0x79),'internalError':_0x47cf78(0x70),'interrupt':'网络连接中断,文件上传失败。','wait':'请稍等...','cancel':'取消','uploadAgain':'再次上传'}};export{o as default};
|
package/lib/locale/zh-TW.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
function _0x4e0a(){const _0x564042=['未知錯誤','下載成功','5XcNqtM','下載中','檔案上傳成功','內部未知錯誤','7KOpHMN','再次上傳','6550mpbTWk','56578VwxZpQ','上傳中','{0}個檔案上傳成功','631617ydDAHo','請稍等...','29748675uFyWee','6109504Ueescy','21UaXVNr','網路連線中斷,檔案上傳失敗。\x20','7353iUalIH','網路異常','4423638KsQEYt','1969988IYelkP','資料流過大','開啟(檔案)'];_0x4e0a=function(){return _0x564042;};return _0x4e0a();}const _0x597679=_0x5220;(function(_0x53ef36,_0xf2d98c){const _0x2e0a1d=_0x5220,_0x2d7e08=_0x53ef36();while(!![]){try{const _0x216fd2=-parseInt(_0x2e0a1d(0xcb))/0x1+parseInt(_0x2e0a1d(0xc8))/0x2*(-parseInt(_0x2e0a1d(0xcf))/0x3)+parseInt(_0x2e0a1d(0xd4))/0x4*(-parseInt(_0x2e0a1d(0xd9))/0x5)+parseInt(_0x2e0a1d(0xd3))/0x6*(-parseInt(_0x2e0a1d(0xc5))/0x7)+-parseInt(_0x2e0a1d(0xce))/0x8+parseInt(_0x2e0a1d(0xd1))/0x9*(parseInt(_0x2e0a1d(0xc7))/0xa)+parseInt(_0x2e0a1d(0xcd))/0xb;if(_0x216fd2===_0xf2d98c)break;else _0x2d7e08['push'](_0x2d7e08['shift']());}catch(_0x3b5fc1){_0x2d7e08['push'](_0x2d7e08['shift']());}}}(_0x4e0a,0x65ace));function _0x5220(_0x303686,_0x2aca8a){const _0x4e0ade=_0x4e0a();return _0x5220=function(_0x52202d,_0x21c885){_0x52202d=_0x52202d-0xc2;let _0x4fe193=_0x4e0ade[_0x52202d];return _0x4fe193;},_0x5220(_0x303686,_0x2aca8a);}const o={'exchange':{'file':'檔案','upload':_0x597679(0xd6),'download':'另存為','uploading':_0x597679(0xc9),'uploadSuccess':_0x597679(0xc3),'uploadSuccessTip':_0x597679(0xca),'downloading':_0x597679(0xc2),'downloadSuccess':_0x597679(0xd8),'unknownMistake':_0x597679(0xd7),'networkError':_0x597679(0xd2),'tooLarge':_0x597679(0xd5),'internalError':_0x597679(0xc4),'interrupt':_0x597679(0xd0),'wait':_0x597679(0xcc),'cancel':'取消','uploadAgain':_0x597679(0xc6)}};export{o as default};
|
@@ -1,16 +0,0 @@
|
|
1
|
-
export declare const PLUGIN_CONFIG_KEY = "exchange-client.config";
|
2
|
-
export declare const configSymbol: unique symbol;
|
3
|
-
export interface IUniverExchangeClientConfig {
|
4
|
-
/**
|
5
|
-
* The URL of the endpoint for downloading files.
|
6
|
-
* @default 'location.origin'
|
7
|
-
*/
|
8
|
-
downloadEndpointUrl?: string;
|
9
|
-
uploadFileServerUrl?: string;
|
10
|
-
importServerUrl?: string;
|
11
|
-
exportServerUrl?: string;
|
12
|
-
getTaskServerUrl?: string;
|
13
|
-
signUrlServerUrl?: string;
|
14
|
-
maxTimeoutTime?: number;
|
15
|
-
}
|
16
|
-
export declare const defaultPluginConfig: IUniverExchangeClientConfig;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { Disposable, Injector } from '@univerjs/core';
|
2
|
-
import { IUIPartsService } from '@univerjs/ui';
|
3
|
-
export declare class ExchangeClientController extends Disposable {
|
4
|
-
private readonly _injector;
|
5
|
-
private readonly _uiPartsService;
|
6
|
-
constructor(_injector: Injector, _uiPartsService: IUIPartsService);
|
7
|
-
private _registerComponents;
|
8
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { IDocumentData, IWorkbookData } from '@univerjs/core';
|
2
|
-
interface IFUniverExchangeClientMixin {
|
3
|
-
/**
|
4
|
-
* Import XLSX file to unit id
|
5
|
-
* @param file File path or file object
|
6
|
-
*/
|
7
|
-
importXLSXToUnitId(file: string | File): Promise<string | undefined>;
|
8
|
-
/**
|
9
|
-
* Import XLSX file to workbook data
|
10
|
-
* @param file File path or file object
|
11
|
-
*/
|
12
|
-
importXLSXToSnapshot(file: string | File): Promise<IWorkbookData | undefined>;
|
13
|
-
/**
|
14
|
-
* Export XLSX file by unit id
|
15
|
-
*/
|
16
|
-
exportXLSXByUnitId(unitId: string): Promise<File | undefined>;
|
17
|
-
/**
|
18
|
-
* Export XLSX file by workbook data
|
19
|
-
*/
|
20
|
-
exportXLSXBySnapshot(snapshot: IWorkbookData): Promise<File | undefined>;
|
21
|
-
/**
|
22
|
-
* Import DOCX file to unit id
|
23
|
-
* @param file File path or file object
|
24
|
-
*/
|
25
|
-
importDOCXToUnitId(file: string | File): Promise<string | undefined>;
|
26
|
-
/**
|
27
|
-
* Import DOCX file to document data
|
28
|
-
* @param file File path or file object
|
29
|
-
*/
|
30
|
-
importDOCXToSnapshot(file: string | File): Promise<IDocumentData | undefined>;
|
31
|
-
}
|
32
|
-
declare module '@univerjs/core' {
|
33
|
-
interface FUniver extends IFUniverExchangeClientMixin {
|
34
|
-
}
|
35
|
-
}
|
36
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
import './f-univer';
|
@@ -1,21 +0,0 @@
|
|
1
|
-
declare const locales: {
|
2
|
-
exchange: {
|
3
|
-
file: string;
|
4
|
-
upload: string;
|
5
|
-
download: string;
|
6
|
-
uploading: string;
|
7
|
-
uploadSuccess: string;
|
8
|
-
uploadSuccessTip: string;
|
9
|
-
downloading: string;
|
10
|
-
downloadSuccess: string;
|
11
|
-
unknownMistake: string;
|
12
|
-
networkError: string;
|
13
|
-
tooLarge: string;
|
14
|
-
internalError: string;
|
15
|
-
interrupt: string;
|
16
|
-
wait: string;
|
17
|
-
cancel: string;
|
18
|
-
uploadAgain: string;
|
19
|
-
};
|
20
|
-
};
|
21
|
-
export default locales;
|
package/lib/types/plugin.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import { IUniverExchangeClientConfig } from './controllers/config.schema';
|
2
|
-
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
3
|
-
export declare class UniverExchangeClientPlugin extends Plugin {
|
4
|
-
private readonly _config;
|
5
|
-
readonly _injector: Injector;
|
6
|
-
private readonly _configService;
|
7
|
-
static pluginName: string;
|
8
|
-
constructor(_config: IUniverExchangeClientConfig | undefined, _injector: Injector, _configService: IConfigService);
|
9
|
-
onStarting(): void;
|
10
|
-
onReady(): void;
|
11
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
export {};
|
@@ -1,87 +0,0 @@
|
|
1
|
-
import { IDisposable, IDocumentData, IWorkbookData, Disposable, IConfigService } from '@univerjs/core';
|
2
|
-
import { IError, UniverType } from '@univerjs/protocol';
|
3
|
-
import { RequestService } from './request.service';
|
4
|
-
import { Observable } from 'rxjs';
|
5
|
-
export declare enum RequestState {
|
6
|
-
UPLOAD = 0,
|
7
|
-
IMPORT = 1,
|
8
|
-
EXPORT = 2,
|
9
|
-
GET_TASK = 3,
|
10
|
-
SIGN_URL = 4,
|
11
|
-
GET_JSON = 5,
|
12
|
-
GET_FILE = 6
|
13
|
-
}
|
14
|
-
export interface IRequestState {
|
15
|
-
error: IError | undefined;
|
16
|
-
state: RequestState;
|
17
|
-
}
|
18
|
-
export interface IExchangeService {
|
19
|
-
requestState$: Observable<IRequestState>;
|
20
|
-
/**
|
21
|
-
* Import XLSX file to workbook data
|
22
|
-
* @param file
|
23
|
-
*/
|
24
|
-
importXLSXToSnapshot(file: File | string): Promise<IWorkbookData | undefined>;
|
25
|
-
/**
|
26
|
-
* Export XLSX file by unit id
|
27
|
-
* @param unitId
|
28
|
-
*/
|
29
|
-
exportXLSXByUnitId(unitId: string): Promise<File | undefined>;
|
30
|
-
/**
|
31
|
-
* Export XLSX file by workbook data
|
32
|
-
* @param data
|
33
|
-
* @returns
|
34
|
-
*/
|
35
|
-
exportXLSXBySnapshot(snapshot: IWorkbookData): Promise<File | undefined>;
|
36
|
-
/**
|
37
|
-
* Import DOCX file to document data
|
38
|
-
* @param file
|
39
|
-
*/
|
40
|
-
importDOCXToSnapshot(file: File | string): Promise<IDocumentData | undefined>;
|
41
|
-
/**
|
42
|
-
* Export DOCX file by unit id
|
43
|
-
* @param unitId
|
44
|
-
*/
|
45
|
-
exportDOCXByUnitId(unitId: string): Promise<File | undefined>;
|
46
|
-
/**
|
47
|
-
* Export DOCX file by document data
|
48
|
-
* @param data
|
49
|
-
* @returns
|
50
|
-
*/
|
51
|
-
exportDOCXBySnapshot(snapshot: IDocumentData): Promise<File | undefined>;
|
52
|
-
/**
|
53
|
-
* Import file to unit id
|
54
|
-
* @param file
|
55
|
-
* @param univerType
|
56
|
-
*/
|
57
|
-
importFileToUnitId(file: File | string, univerType: UniverType): Promise<string | undefined>;
|
58
|
-
}
|
59
|
-
export declare const IExchangeService: import('@wendellhu/redi').IdentifierDecorator<IExchangeService>;
|
60
|
-
export declare class ExchangeService extends Disposable implements IExchangeService, IDisposable {
|
61
|
-
private readonly _configService;
|
62
|
-
private readonly _requestService;
|
63
|
-
private readonly _requestState$;
|
64
|
-
readonly requestState$: Observable<IRequestState>;
|
65
|
-
constructor(_configService: IConfigService, _requestService: RequestService);
|
66
|
-
dispose(): void;
|
67
|
-
importDOCXToSnapshot(file: File | string): Promise<IDocumentData | undefined>;
|
68
|
-
exportDOCXByUnitId(unitId: string): Promise<File | undefined>;
|
69
|
-
exportDOCXBySnapshot(snapshot: IDocumentData): Promise<File | undefined>;
|
70
|
-
importXLSXToSnapshot(file: File | string): Promise<IWorkbookData | undefined>;
|
71
|
-
exportXLSXByUnitId(unitId: string): Promise<File | undefined>;
|
72
|
-
exportXLSXBySnapshot(data: IWorkbookData): Promise<File | undefined>;
|
73
|
-
importFileToUnitId(file: File | string, univerType: UniverType): Promise<string | undefined>;
|
74
|
-
private _importToSnapshot;
|
75
|
-
/**
|
76
|
-
* Export file by snapshot
|
77
|
-
* @param snapshot
|
78
|
-
* @param univerType
|
79
|
-
* @returns
|
80
|
-
*/
|
81
|
-
private _exportBySnapshot;
|
82
|
-
private _export;
|
83
|
-
private _upload;
|
84
|
-
private _import;
|
85
|
-
private _signUrl;
|
86
|
-
private _getDownloadEndpointURL;
|
87
|
-
}
|
@@ -1,121 +0,0 @@
|
|
1
|
-
import { IDisposable, Disposable, ILogService, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
|
2
|
-
import { Observable } from 'rxjs';
|
3
|
-
import { ExchangeService } from './exchange.service';
|
4
|
-
import { UploadNotificationService } from './upload-notification.service';
|
5
|
-
import { UniverType } from '@univerjs/protocol';
|
6
|
-
import { IMessageService } from '@univerjs/ui';
|
7
|
-
export interface IExchangeOperateService {
|
8
|
-
interrupt(): void;
|
9
|
-
/**
|
10
|
-
* Upload file to server, get unitId and open unit
|
11
|
-
* @param file
|
12
|
-
*/
|
13
|
-
importXLSXToUnitId(): Promise<string | undefined>;
|
14
|
-
/**
|
15
|
-
* Upload xlsx file to server, get snapshot and refresh current sheet
|
16
|
-
* @param file
|
17
|
-
*/
|
18
|
-
importXLSXToSnapshot(): Promise<void>;
|
19
|
-
/**
|
20
|
-
* Export xlsx file by unitId
|
21
|
-
* @returns
|
22
|
-
*/
|
23
|
-
exportXLSXByUnitId(unitId?: string, unitName?: string, unitType?: UniverInstanceType): Promise<void>;
|
24
|
-
/**
|
25
|
-
* Export xlsx file by snapshot
|
26
|
-
* @returns
|
27
|
-
*/
|
28
|
-
exportXLSXBySnapshot(): Promise<void>;
|
29
|
-
/**
|
30
|
-
* Upload file to server, get unitId and open unit
|
31
|
-
* @param file
|
32
|
-
*/
|
33
|
-
importDOCXToUnitId(): Promise<string | undefined>;
|
34
|
-
/**
|
35
|
-
* Upload docx file to server, get snapshot and refresh current doc
|
36
|
-
* @param file
|
37
|
-
*/
|
38
|
-
importDOCXToSnapshot(): Promise<void>;
|
39
|
-
/**
|
40
|
-
* Export docx file by unitId
|
41
|
-
* @returns
|
42
|
-
*/
|
43
|
-
exportDOCXByUnitId(unitId?: string, unitName?: string, unitType?: UniverType): Promise<void>;
|
44
|
-
/**
|
45
|
-
* Export docx file by snapshot
|
46
|
-
* @returns
|
47
|
-
*/
|
48
|
-
exportDOCXBySnapshot(): Promise<void>;
|
49
|
-
/**
|
50
|
-
* Upload file, supports multiple types
|
51
|
-
* @param file
|
52
|
-
*/
|
53
|
-
uploadFileToUnitId(types: UniverType[]): Promise<{
|
54
|
-
unitId: string;
|
55
|
-
type: UniverType;
|
56
|
-
} | undefined>;
|
57
|
-
/**
|
58
|
-
* Customize the imported Unit URL format according to the needs of your own scene
|
59
|
-
* @param getLink
|
60
|
-
*/
|
61
|
-
registerLink(getLink: (unitId: string, univerType: UniverInstanceType) => string): void;
|
62
|
-
/**
|
63
|
-
* Observable of upload progress
|
64
|
-
*/
|
65
|
-
progress$: Observable<IUploadProgress>;
|
66
|
-
}
|
67
|
-
export interface IUploadProgress {
|
68
|
-
/** Task that already completed. */
|
69
|
-
done: number;
|
70
|
-
/** The total number of tasks need to execute. */
|
71
|
-
count: number;
|
72
|
-
}
|
73
|
-
export declare const IExchangeOperateService: import('@wendellhu/redi').IdentifierDecorator<IExchangeOperateService>;
|
74
|
-
export declare class ExchangeOperateService extends Disposable implements IExchangeOperateService, IDisposable {
|
75
|
-
private _univerInstanceService;
|
76
|
-
private readonly _messageService;
|
77
|
-
private readonly _localeService;
|
78
|
-
private readonly _exchangeService;
|
79
|
-
private readonly _uploadNotificationService;
|
80
|
-
protected readonly _logService: ILogService;
|
81
|
-
private _interrupted;
|
82
|
-
private readonly _progress$;
|
83
|
-
readonly progress$: Observable<IUploadProgress>;
|
84
|
-
private _totalUploadTaskCount;
|
85
|
-
private _doneUploadTaskCount;
|
86
|
-
constructor(_univerInstanceService: IUniverInstanceService, _messageService: IMessageService, _localeService: LocaleService, _exchangeService: ExchangeService, _uploadNotificationService: UploadNotificationService, _logService: ILogService);
|
87
|
-
interrupt(): void;
|
88
|
-
uploadFileToUnitId(types: UniverType[]): Promise<{
|
89
|
-
unitId: string;
|
90
|
-
type: UniverType;
|
91
|
-
} | undefined>;
|
92
|
-
importDOCXToUnitId(): Promise<string | undefined>;
|
93
|
-
importDOCXToSnapshot(): Promise<void>;
|
94
|
-
exportDOCXByUnitId(unitId?: string, unitName?: string, unitType?: UniverInstanceType): Promise<void>;
|
95
|
-
exportDOCXBySnapshot(): Promise<void>;
|
96
|
-
importXLSXToUnitId(): Promise<string | undefined>;
|
97
|
-
importXLSXToSnapshot(): Promise<void>;
|
98
|
-
exportXLSXByUnitId(unitId?: string, unitName?: string): Promise<void>;
|
99
|
-
exportXLSXBySnapshot(): Promise<void>;
|
100
|
-
registerLink(getLink: (unitId: string, univerType: UniverInstanceType) => string): void;
|
101
|
-
private _importFileToUnitId;
|
102
|
-
private _getUnitID;
|
103
|
-
private _getUnitName;
|
104
|
-
private _getUnitJson;
|
105
|
-
/**
|
106
|
-
* Get unit link /?unit={unitId}&type=2
|
107
|
-
* @param unitId
|
108
|
-
* @param type
|
109
|
-
* @returns
|
110
|
-
*/
|
111
|
-
private _getLinkByUnitId;
|
112
|
-
private _refresh;
|
113
|
-
private _showNetworkError;
|
114
|
-
private _showDownloadMessage;
|
115
|
-
private _showUploadMessage;
|
116
|
-
private _emitProgress;
|
117
|
-
private _addTotalCount;
|
118
|
-
private _addDoneTask;
|
119
|
-
private _completeProgress;
|
120
|
-
private _clearProgress;
|
121
|
-
}
|
@@ -1,107 +0,0 @@
|
|
1
|
-
import { IDisposable, IConfigService } from '@univerjs/core';
|
2
|
-
import { IError, UniverType } from '@univerjs/protocol';
|
3
|
-
import { ISheetBlockJson, ISnapshotJson } from './utils/snapshot';
|
4
|
-
import { HTTPService } from '@univerjs/network';
|
5
|
-
/** @deprecated Will be removed in the 0.2.19 release */
|
6
|
-
export declare const EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY = "EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY";
|
7
|
-
/** @deprecated Will be removed in the 0.2.19 release */
|
8
|
-
export declare const EXCHANGE_IMPORT_SERVER_URL_KEY = "EXCHANGE_IMPORT_SERVER_URL_KEY";
|
9
|
-
/** @deprecated Will be removed in the 0.2.19 release */
|
10
|
-
export declare const EXCHANGE_EXPORT_SERVER_URL_KEY = "EXCHANGE_EXPORT_SERVER_URL_KEY";
|
11
|
-
/** @deprecated Will be removed in the 0.2.19 release */
|
12
|
-
export declare const EXCHANGE_GET_TASK_SERVER_URL_KEY = "EXCHANGE_GET_TASK_SERVER_URL_KEY";
|
13
|
-
/** @deprecated Will be removed in the 0.2.19 release */
|
14
|
-
export declare const EXCHANGE_SIGN_URL_SERVER_URL_KEY = "EXCHANGE_SIGN_URL_SERVER_URL_KEY";
|
15
|
-
export interface IFileUploadResponse {
|
16
|
-
FileId: string;
|
17
|
-
error: IError;
|
18
|
-
}
|
19
|
-
export declare enum ImportOutputType {
|
20
|
-
UNDEFINED = 0,
|
21
|
-
/** UNIT - Import to univer unit, unit is store in the database */
|
22
|
-
UNIT = 1,
|
23
|
-
/** JSON - Import and convert to a json file which represents a univer unit, not store in the database */
|
24
|
-
JSON = 2,
|
25
|
-
UNRECOGNIZED = -1
|
26
|
-
}
|
27
|
-
export interface IImportRequest {
|
28
|
-
fileID: string;
|
29
|
-
type: UniverType;
|
30
|
-
outputType: ImportOutputType;
|
31
|
-
/** not supported yet */
|
32
|
-
fileUrl: string;
|
33
|
-
}
|
34
|
-
export interface IImportResponse {
|
35
|
-
taskID: string;
|
36
|
-
error: IError;
|
37
|
-
}
|
38
|
-
export interface IExportRequest {
|
39
|
-
/** if unitID is specified, the input is the unit in the database */
|
40
|
-
unitID: string;
|
41
|
-
/** if jsonID is specified, the input is the json file which represents a univer unit */
|
42
|
-
jsonID: string;
|
43
|
-
type: UniverType;
|
44
|
-
}
|
45
|
-
export interface IExportResponse {
|
46
|
-
error: IError | undefined;
|
47
|
-
taskID: string;
|
48
|
-
}
|
49
|
-
export interface IGetTaskResponse {
|
50
|
-
error: IError | undefined;
|
51
|
-
taskID: string;
|
52
|
-
status: string;
|
53
|
-
import?: IImportTaskResult | undefined;
|
54
|
-
export?: IExportTaskResult | undefined;
|
55
|
-
}
|
56
|
-
export interface IImportTaskResult {
|
57
|
-
outputType: ImportOutputType;
|
58
|
-
unitID: string;
|
59
|
-
jsonID: string;
|
60
|
-
}
|
61
|
-
export interface IExportTaskResult {
|
62
|
-
fileID: string;
|
63
|
-
fileUrl: string;
|
64
|
-
}
|
65
|
-
export interface ISignUrlResponse {
|
66
|
-
error: IError | undefined;
|
67
|
-
url: string;
|
68
|
-
}
|
69
|
-
export interface IBindingResponse {
|
70
|
-
error: IError;
|
71
|
-
}
|
72
|
-
export interface ISnapshotJsonResponse {
|
73
|
-
snapshot: Partial<ISnapshotJson>;
|
74
|
-
sheetBlocks: ISheetBlockJson;
|
75
|
-
}
|
76
|
-
export interface IRequestService {
|
77
|
-
upload(file: File | string): Promise<IFileUploadResponse | undefined>;
|
78
|
-
import(importRequest: IImportRequest): Promise<IImportResponse | undefined>;
|
79
|
-
export(exportRequest: IExportRequest): Promise<IExportResponse | undefined>;
|
80
|
-
getTask(taskID: string): Promise<IGetTaskResponse | undefined>;
|
81
|
-
signUrl(fileID: string): Promise<ISignUrlResponse | undefined>;
|
82
|
-
}
|
83
|
-
export declare const IRequestService: import('@wendellhu/redi').IdentifierDecorator<IRequestService>;
|
84
|
-
/**
|
85
|
-
* TODO@Dushusir maybe move to ExchangeClientPlugin plugin for reuse
|
86
|
-
*/
|
87
|
-
export declare class RequestService implements IRequestService, IDisposable {
|
88
|
-
private readonly _configService;
|
89
|
-
private readonly _httpService;
|
90
|
-
constructor(_configService: IConfigService, _httpService: HTTPService);
|
91
|
-
dispose(): void;
|
92
|
-
/**
|
93
|
-
* upload file to server
|
94
|
-
* @param file
|
95
|
-
*/
|
96
|
-
upload(file: File | string, size?: number, flate?: boolean): Promise<IFileUploadResponse | undefined>;
|
97
|
-
import(importRequest: IImportRequest): Promise<IImportResponse | undefined>;
|
98
|
-
export(exportRequest: IExportRequest): Promise<IExportResponse | undefined>;
|
99
|
-
getTask(taskID: string): Promise<IGetTaskResponse | undefined>;
|
100
|
-
signUrl(fileID: string): Promise<ISignUrlResponse | undefined>;
|
101
|
-
private _getUploadFileURL;
|
102
|
-
private _getImportURL;
|
103
|
-
private _getExportURL;
|
104
|
-
private _getTaskURL;
|
105
|
-
private _getSignURL;
|
106
|
-
private _getMaxPollingTime;
|
107
|
-
}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import { Disposable, IDisposable } from '@univerjs/core';
|
2
|
-
import { Observable } from 'rxjs';
|
3
|
-
import { UniverType } from '@univerjs/protocol';
|
4
|
-
export declare enum UploadNotificationState {
|
5
|
-
UPLOADING = 0,
|
6
|
-
SUCCESS = 1,
|
7
|
-
ERROR = 2
|
8
|
-
}
|
9
|
-
export interface ILinkList {
|
10
|
-
link: string;
|
11
|
-
name: string;
|
12
|
-
type: UniverType;
|
13
|
-
}
|
14
|
-
export interface IUploadNotificationService {
|
15
|
-
visible$: Observable<boolean>;
|
16
|
-
state$: Observable<UploadNotificationState>;
|
17
|
-
list$: Observable<ILinkList[]>;
|
18
|
-
/**
|
19
|
-
* Show upload notification
|
20
|
-
*/
|
21
|
-
show(): void;
|
22
|
-
/**
|
23
|
-
* Hide upload notification
|
24
|
-
*/
|
25
|
-
hide(): void;
|
26
|
-
/**
|
27
|
-
* Update upload notification state
|
28
|
-
* @param state
|
29
|
-
*/
|
30
|
-
updateState(state: UploadNotificationState): void;
|
31
|
-
/**
|
32
|
-
* Push link to upload notification
|
33
|
-
* @param link
|
34
|
-
*/
|
35
|
-
pushLink(link: ILinkList): void;
|
36
|
-
}
|
37
|
-
export declare const IUploadNotificationService: import('@wendellhu/redi').IdentifierDecorator<IUploadNotificationService>;
|
38
|
-
export declare class UploadNotificationService extends Disposable implements IUploadNotificationService, IDisposable {
|
39
|
-
private readonly _visible$;
|
40
|
-
private readonly _state$;
|
41
|
-
private readonly _list$;
|
42
|
-
readonly visible$: Observable<boolean>;
|
43
|
-
readonly state$: Observable<UploadNotificationState>;
|
44
|
-
readonly list$: Observable<ILinkList[]>;
|
45
|
-
private _list;
|
46
|
-
constructor();
|
47
|
-
dispose(): void;
|
48
|
-
show(): void;
|
49
|
-
hide(): void;
|
50
|
-
updateState(state: UploadNotificationState): void;
|
51
|
-
pushLink(link: ILinkList): void;
|
52
|
-
}
|
@@ -1,76 +0,0 @@
|
|
1
|
-
import { IWorkbookData, Nullable } from '@univerjs/core';
|
2
|
-
import { ICopyFileMetaRequest, ICopyFileMetaResponse, IDocumentMeta, IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetDeserializedSheetBlockResponse, IGetLatestCsReqIdBySidRequest, IGetLatestCsReqIdBySidResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse, ISheetBlock, ISnapshot, IWorkbookMeta, IWorksheetMeta } from '@univerjs/protocol';
|
3
|
-
import { ILogContext, ISnapshotServerService } from '@univerjs-pro/collaboration';
|
4
|
-
export interface IWorksheetMetaJson extends Omit<IWorksheetMeta, 'originalMeta'> {
|
5
|
-
originalMeta: string;
|
6
|
-
}
|
7
|
-
export interface IWorkbookMetaJson extends Omit<IWorkbookMeta, 'originalMeta' | 'sheets'> {
|
8
|
-
originalMeta: string;
|
9
|
-
sheets: {
|
10
|
-
[key: string]: Partial<IWorksheetMetaJson>;
|
11
|
-
};
|
12
|
-
}
|
13
|
-
export interface IDocumentMetaJson extends Omit<IDocumentMeta, 'originalMeta'> {
|
14
|
-
originalMeta: string;
|
15
|
-
}
|
16
|
-
export interface ISnapshotJson extends Omit<ISnapshot, 'workbook' | 'doc'> {
|
17
|
-
workbook: Partial<IWorkbookMetaJson>;
|
18
|
-
doc: Partial<IDocumentMetaJson>;
|
19
|
-
}
|
20
|
-
export interface ISheetBlockData extends Omit<ISheetBlock, 'data'> {
|
21
|
-
data: string;
|
22
|
-
}
|
23
|
-
export interface ISheetBlockJson {
|
24
|
-
[key: string]: Partial<ISheetBlockData>;
|
25
|
-
}
|
26
|
-
export interface ISnapshotBlockJson {
|
27
|
-
snapshot: ISnapshotJson;
|
28
|
-
sheetBlocks: ISheetBlockJson;
|
29
|
-
}
|
30
|
-
export interface ISnapshotBlockJsonResponse {
|
31
|
-
snapshot: ISnapshot;
|
32
|
-
sheetBlocks: {
|
33
|
-
[key: string]: ISheetBlock;
|
34
|
-
};
|
35
|
-
}
|
36
|
-
/**
|
37
|
-
* Convert the Uint8Array in the snapshot to a string for easy transmission to the backend
|
38
|
-
* @param snapshot
|
39
|
-
* @returns
|
40
|
-
*/
|
41
|
-
export declare function transformSnapshotMetaToString(snapshot: ISnapshot): Nullable<ISnapshotJson>;
|
42
|
-
/**
|
43
|
-
* Convert the Uint8Array in the sheet block to a string for easy transmission to the backend
|
44
|
-
* @param sheetBlocks
|
45
|
-
* @returns
|
46
|
-
*/
|
47
|
-
export declare function transformSheetBlockMetaToString(sheetBlocks: ISheetBlock[]): ISheetBlockJson;
|
48
|
-
/**
|
49
|
-
* Convert the workbook data to snapshot data
|
50
|
-
* @param workbookData
|
51
|
-
* @returns
|
52
|
-
*/
|
53
|
-
export declare function transformWorkbookDataToSnapshotJson(workbookData: IWorkbookData): Promise<ISnapshotBlockJson>;
|
54
|
-
/**
|
55
|
-
* The server needs to fully implement all interfaces, but when used by the client, use saveSheetBlock to cache the sheet block locally, and use getSheetBlock to obtain the sheet block.
|
56
|
-
*/
|
57
|
-
export declare class ClientSnapshotServerService implements ISnapshotServerService {
|
58
|
-
private _sheetBlockCache;
|
59
|
-
/** Load snapshot from a database. */
|
60
|
-
getUnitOnRev(context: ILogContext, params: IGetUnitOnRevRequest): Promise<IGetUnitOnRevResponse>;
|
61
|
-
/** Load sheet block from a database. */
|
62
|
-
getSheetBlock(context: ILogContext, params: IGetSheetBlockRequest): Promise<IGetSheetBlockResponse>;
|
63
|
-
/** Load deserialized sheet block from a database. */
|
64
|
-
getDeserializedSheetBlock(context: ILogContext, params: IGetSheetBlockRequest): Promise<IGetDeserializedSheetBlockResponse>;
|
65
|
-
/** Fetch missing changeset */
|
66
|
-
fetchMissingChangesets(context: ILogContext, params: IFetchMissingChangesetsRequest): Promise<IFetchMissingChangesetsResponse>;
|
67
|
-
getResourcesRequest(context: ILogContext, params: IGetResourcesRequest): Promise<IGetResourcesResponse>;
|
68
|
-
/** Save snapshot to a database. */
|
69
|
-
saveSnapshot(context: ILogContext, params: ISaveSnapshotRequest): Promise<ISaveSnapshotResponse>;
|
70
|
-
/** Save sheet block to a database. */
|
71
|
-
saveSheetBlock(context: ILogContext, params: ISaveSheetBlockRequest): Promise<ISaveSheetBlockResponse>;
|
72
|
-
/** Save changeset to a database. */
|
73
|
-
saveChangeset(context: ILogContext, params: ISaveChangesetRequest): Promise<ISaveChangesetResponse>;
|
74
|
-
copyFileMeta(context: ILogContext, params: ICopyFileMetaRequest): Promise<ICopyFileMetaResponse>;
|
75
|
-
getLatestCsReqIdBySid(context: ILogContext, params: IGetLatestCsReqIdBySidRequest): Promise<IGetLatestCsReqIdBySidResponse>;
|
76
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { UniverType } from '@univerjs/protocol';
|
2
|
-
export declare function downloadFileByURL(url: string, filename: string, fileExt: string): void;
|
3
|
-
/**
|
4
|
-
* Triggers a download of a given File object.
|
5
|
-
*
|
6
|
-
* @param {File} file - The File object to be downloaded.
|
7
|
-
*/
|
8
|
-
export declare function downloadFile(file: File | Blob, filename: string, fileExt: string): void;
|
9
|
-
export declare function getUniverTypeByFile(file: File): UniverType.UNIVER_UNKNOWN | UniverType.UNIVER_DOC | UniverType.UNIVER_SHEET | UniverType.UNIVER_SLIDE;
|
10
|
-
export declare function getUploadFile(types: UniverType[], multiple?: boolean): Promise<FileList | null>;
|
11
|
-
export declare function getFileByURL(url: string): Promise<File | undefined>;
|
12
|
-
export declare function getFileNameFromURL(url: string): string | undefined;
|
13
|
-
export declare function getTextFromURL(url: string): Promise<string | undefined>;
|
14
|
-
export declare function blobToString(blob: Blob): Promise<string>;
|
15
|
-
export declare function bufferToFile(buffer: Uint8Array): File;
|
16
|
-
export declare function replaceType(path: string, type: string): string;
|
17
|
-
export declare function replaceUnitId(path: string, type: string): string;
|
18
|
-
export declare function replaceTaskID(path: string, taskID: string): string;
|
19
|
-
export declare function replaceFileID(path: string, fileID: string): string;
|