yx-web-sdk 0.0.19 → 0.0.21
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/ait-person-popover/index.js +1 -1
- package/dist/chat-card/index.js +1 -1
- package/dist/chat-content/index.js +1 -1
- package/dist/chat-page/index.js +1 -1
- package/dist/chat-room/index.js +1 -1
- package/dist/common-avatar/index.js +1 -1
- package/dist/components/img-info-wrapper/index.d.ts +0 -0
- package/dist/components/img-info-wrapper/index.vue.d.ts +6 -0
- package/dist/img-info-wrapper/index.js +1 -0
- package/dist/index/style2.css +30 -162
- package/dist/index/style4.css +177 -125
- package/dist/index/style6.css +513 -25
- package/dist/index/style7.css +143 -466
- package/dist/{index-DHnPD8u9.mjs → index-BPnLB3av.mjs} +1 -1
- package/dist/{index-BjIqS2ZC.mjs → index-DME8_VYv.mjs} +2 -2
- package/dist/{index-D5gp5t2F.mjs → index-Dwglj7_M.mjs} +1 -1
- package/dist/index-entry/index.js +4 -4
- package/dist/{index.vue_vue_type_script_setup_true_lang-CkWszgC3.mjs → index.vue_vue_type_script_setup_true_lang-CD6o8jT4.mjs} +9 -3
- package/dist/{index.vue_vue_type_style_index_0_lang-C-imP01W.mjs → index.vue_vue_type_style_index_0_lang-BJGCxPce.mjs} +3 -3
- package/dist/{index.vue_vue_type_style_index_0_lang-CAZ44kgX.mjs → index.vue_vue_type_style_index_0_lang-BaKNB-4q.mjs} +33 -7
- package/dist/{index.vue_vue_type_style_index_0_lang-CA27kCm1.mjs → index.vue_vue_type_style_index_0_lang-CsNgkPt9.mjs} +101 -17
- package/dist/{index.vue_vue_type_style_index_0_lang-5DeqmRdw.mjs → index.vue_vue_type_style_index_0_lang-iBkYSdDj.mjs} +156 -38
- package/dist/members-sidebar/index.js +1 -1
- package/dist/notice-box/index.js +1 -1
- package/dist/server-channel-sidebar/index.js +1 -1
- package/dist/stores/channel.d.ts +18 -2
- package/dist/style.css +155 -70
- package/dist/utils/index.d.ts +10 -2
- package/dist/yx-web-sdk.es.js +321 -90
- package/dist/yx-web-sdk.umd.js +320 -89
- package/package.json +1 -1
- /package/dist/{index.vue_vue_type_style_index_0_lang-B2YRkoln.mjs → index.vue_vue_type_style_index_0_lang-BxXBf_VA.mjs} +0 -0
|
@@ -1,12 +1,45 @@
|
|
|
1
|
-
import { ref, computed, watch, nextTick, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, unref, normalizeClass, createBlock, createCommentVNode,
|
|
1
|
+
import { createVNode, ref, computed, watch, nextTick, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, unref, normalizeClass, createBlock, createCommentVNode, Fragment, renderList, toDisplayString, withCtx } from "vue";
|
|
2
2
|
import { useRouter } from "vue-router";
|
|
3
3
|
import { Input, Image, Popover, Button, Upload, message } from "ant-design-vue";
|
|
4
|
-
import { A as AitPersonPopover } from "./index-
|
|
5
|
-
import { L as LoadingOutlined, _ as _sfc_main$2 } from "./index.vue_vue_type_style_index_0_lang-
|
|
6
|
-
import { _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-
|
|
7
|
-
import { a as useServerStore, g as getServerMembersByAccids,
|
|
4
|
+
import { A as AitPersonPopover } from "./index-Dwglj7_M.mjs";
|
|
5
|
+
import { L as LoadingOutlined, _ as _sfc_main$2, a as _sfc_main$3 } from "./index.vue_vue_type_style_index_0_lang-CsNgkPt9.mjs";
|
|
6
|
+
import { _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-BxXBf_VA.mjs";
|
|
7
|
+
import { a as useServerStore, g as getServerMembersByAccids, u as useChannelStore, e as getImageMsgDisplaySize, f as filterStr, i as isLt } from "./index.vue_vue_type_style_index_0_lang-BaKNB-4q.mjs";
|
|
8
8
|
import { useEventListener, useDebounceFn } from "@vueuse/core";
|
|
9
9
|
import { C as CloseOutlined } from "./CloseOutlined-BEcmJaCc.mjs";
|
|
10
|
+
import { I as Icon } from "./AntdIcon-DdvEPKFJ.mjs";
|
|
11
|
+
var DeleteOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, "name": "delete", "theme": "outlined" };
|
|
12
|
+
function _objectSpread(target) {
|
|
13
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
14
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
15
|
+
var ownKeys = Object.keys(source);
|
|
16
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
17
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
ownKeys.forEach(function(key) {
|
|
22
|
+
_defineProperty(target, key, source[key]);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return target;
|
|
26
|
+
}
|
|
27
|
+
function _defineProperty(obj, key, value) {
|
|
28
|
+
if (key in obj) {
|
|
29
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
30
|
+
} else {
|
|
31
|
+
obj[key] = value;
|
|
32
|
+
}
|
|
33
|
+
return obj;
|
|
34
|
+
}
|
|
35
|
+
var DeleteOutlined = function DeleteOutlined2(props, context) {
|
|
36
|
+
var p = _objectSpread({}, props, context.attrs);
|
|
37
|
+
return createVNode(Icon, _objectSpread({}, p, {
|
|
38
|
+
"icon": DeleteOutlined$1
|
|
39
|
+
}), null);
|
|
40
|
+
};
|
|
41
|
+
DeleteOutlined.displayName = "DeleteOutlined";
|
|
42
|
+
DeleteOutlined.inheritAttrs = false;
|
|
10
43
|
const MENTION_TAG_REG = /@[^@]+\s/g;
|
|
11
44
|
function getMentionSpans(text) {
|
|
12
45
|
const spans = [];
|
|
@@ -419,19 +452,32 @@ const _hoisted_8 = {
|
|
|
419
452
|
key: 0,
|
|
420
453
|
class: "chatroomInputQuoteWrapper"
|
|
421
454
|
};
|
|
422
|
-
const _hoisted_9 = {
|
|
423
|
-
const _hoisted_10 = { class: "chatroomInputQuoteTextName" };
|
|
424
|
-
const _hoisted_11 = ["innerHTML"];
|
|
425
|
-
const _hoisted_12 = {
|
|
455
|
+
const _hoisted_9 = {
|
|
426
456
|
key: 0,
|
|
457
|
+
class: "chatroomInputQuoteAttachBox"
|
|
458
|
+
};
|
|
459
|
+
const _hoisted_10 = { class: "chatroomInputQuoteText" };
|
|
460
|
+
const _hoisted_11 = { class: "chatroomInputQuoteTextName" };
|
|
461
|
+
const _hoisted_12 = ["innerHTML"];
|
|
462
|
+
const _hoisted_13 = {
|
|
463
|
+
key: 1,
|
|
427
464
|
class: "chatroomInputQuoteWrapperImg"
|
|
428
465
|
};
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
466
|
+
const _hoisted_14 = {
|
|
467
|
+
key: 1,
|
|
468
|
+
class: "chatroomInputAttachmentWrapper"
|
|
469
|
+
};
|
|
470
|
+
const _hoisted_15 = {
|
|
471
|
+
key: 0,
|
|
472
|
+
class: "chatroomInputAttachmentWrapperImg"
|
|
473
|
+
};
|
|
474
|
+
const _hoisted_16 = { class: "chatroomInputAttachmentWrapperImgMask" };
|
|
475
|
+
const _hoisted_17 = { class: "chatroomInputWrapper" };
|
|
476
|
+
const _hoisted_18 = { class: "chatroomInputLeft" };
|
|
477
|
+
const _hoisted_19 = { style: { "width": "400px" } };
|
|
478
|
+
const _hoisted_20 = ["onClick"];
|
|
479
|
+
const _hoisted_21 = { class: "chatroomController" };
|
|
480
|
+
const MAX_IMG_SIZE = 10;
|
|
435
481
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
436
482
|
...{
|
|
437
483
|
name: "ChatContent"
|
|
@@ -457,8 +503,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
457
503
|
const props = __props;
|
|
458
504
|
const emit = __emit;
|
|
459
505
|
const quoteMsg = ref();
|
|
506
|
+
const attachment = ref();
|
|
460
507
|
const curText = ref("");
|
|
461
508
|
const cursorIndex = ref(0);
|
|
509
|
+
const attachmentUploading = ref(false);
|
|
462
510
|
const contentRef = ref();
|
|
463
511
|
const contentScrollLocked = ref(false);
|
|
464
512
|
const loadingMore = ref(false);
|
|
@@ -554,6 +602,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
554
602
|
};
|
|
555
603
|
const handleDeleteQuoteMsg = () => {
|
|
556
604
|
quoteMsg.value = void 0;
|
|
605
|
+
console.log("handleDeleteQuoteMsg", quoteMsg.value);
|
|
606
|
+
};
|
|
607
|
+
const handleDeleteAttachment = () => {
|
|
608
|
+
attachment.value = void 0;
|
|
557
609
|
};
|
|
558
610
|
watch(
|
|
559
611
|
() => props.msgs,
|
|
@@ -591,15 +643,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
591
643
|
() => channelStore.currentChannel,
|
|
592
644
|
(value, oldValue) => {
|
|
593
645
|
if (oldValue == null ? void 0 : oldValue.channelId) {
|
|
594
|
-
inputMap.set(oldValue == null ? void 0 : oldValue.channelId, {
|
|
646
|
+
inputMap.set(oldValue == null ? void 0 : oldValue.channelId, {
|
|
647
|
+
input: curText.value,
|
|
648
|
+
quoteMsg: quoteMsg.value,
|
|
649
|
+
attachment: attachment.value
|
|
650
|
+
});
|
|
595
651
|
}
|
|
596
652
|
if ((value == null ? void 0 : value.channelId) && inputMap.has((value == null ? void 0 : value.channelId) || "")) {
|
|
597
653
|
const mapValue = inputMap.get((value == null ? void 0 : value.channelId) || "");
|
|
598
654
|
curText.value = (mapValue == null ? void 0 : mapValue.input) || "";
|
|
599
655
|
quoteMsg.value = mapValue == null ? void 0 : mapValue.quoteMsg;
|
|
656
|
+
attachment.value = mapValue == null ? void 0 : mapValue.attachment;
|
|
600
657
|
} else {
|
|
601
658
|
curText.value = "";
|
|
602
659
|
quoteMsg.value = void 0;
|
|
660
|
+
attachment.value = void 0;
|
|
603
661
|
}
|
|
604
662
|
}
|
|
605
663
|
);
|
|
@@ -636,10 +694,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
636
694
|
ext: {
|
|
637
695
|
quoteMsg: quoteMsg.value
|
|
638
696
|
},
|
|
639
|
-
mentionAccids: mentionAccids.value
|
|
697
|
+
mentionAccids: mentionAccids.value,
|
|
698
|
+
attach: attachment.value
|
|
699
|
+
// 传递附件
|
|
640
700
|
});
|
|
641
701
|
curText.value = "";
|
|
642
702
|
quoteMsg.value = void 0;
|
|
703
|
+
attachment.value = void 0;
|
|
643
704
|
scrollToBottomAfterSend();
|
|
644
705
|
}
|
|
645
706
|
}
|
|
@@ -651,10 +712,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
651
712
|
ext: {
|
|
652
713
|
quoteMsg: quoteMsg.value
|
|
653
714
|
},
|
|
654
|
-
mentionAccids: mentionAccids.value
|
|
715
|
+
mentionAccids: mentionAccids.value,
|
|
716
|
+
attach: attachment.value
|
|
717
|
+
// 传递附件
|
|
655
718
|
});
|
|
656
719
|
curText.value = "";
|
|
657
720
|
quoteMsg.value = void 0;
|
|
721
|
+
attachment.value = void 0;
|
|
658
722
|
scrollToBottomAfterSend();
|
|
659
723
|
}
|
|
660
724
|
};
|
|
@@ -676,8 +740,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
676
740
|
});
|
|
677
741
|
}
|
|
678
742
|
};
|
|
679
|
-
const handlePaste = (e) => {
|
|
680
|
-
if (props.sendDisabled) return;
|
|
743
|
+
const handlePaste = async (e) => {
|
|
744
|
+
if (props.sendDisabled || attachmentUploading.value) return;
|
|
681
745
|
const clipboardData = e.clipboardData;
|
|
682
746
|
if (!clipboardData) return;
|
|
683
747
|
const items = clipboardData.items;
|
|
@@ -691,20 +755,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
691
755
|
message.error("图片大小最大支持20M");
|
|
692
756
|
return;
|
|
693
757
|
}
|
|
694
|
-
|
|
695
|
-
|
|
758
|
+
attachmentUploading.value = true;
|
|
759
|
+
try {
|
|
760
|
+
const uploadResult = await channelStore.uploadImage({
|
|
761
|
+
file,
|
|
762
|
+
onUploadStart: () => {
|
|
763
|
+
attachmentUploading.value = true;
|
|
764
|
+
},
|
|
765
|
+
onUploadDone: () => {
|
|
766
|
+
attachmentUploading.value = false;
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
attachment.value = uploadResult;
|
|
770
|
+
} catch (error) {
|
|
771
|
+
console.error("上传图片失败:", error);
|
|
772
|
+
message.error("上传图片失败");
|
|
773
|
+
attachmentUploading.value = false;
|
|
774
|
+
}
|
|
696
775
|
}
|
|
697
776
|
return;
|
|
698
777
|
}
|
|
699
778
|
}
|
|
700
779
|
};
|
|
701
|
-
const uploadImgHandler = (file) => {
|
|
780
|
+
const uploadImgHandler = async (file) => {
|
|
702
781
|
if (!isLt(file.size, MAX_IMG_SIZE)) {
|
|
703
782
|
message.error(`图片大小最大支持${MAX_IMG_SIZE}M`);
|
|
704
|
-
return;
|
|
783
|
+
return false;
|
|
705
784
|
}
|
|
706
|
-
|
|
707
|
-
|
|
785
|
+
attachmentUploading.value = true;
|
|
786
|
+
try {
|
|
787
|
+
const uploadResult = await channelStore.uploadImage({
|
|
788
|
+
file,
|
|
789
|
+
onUploadStart: () => {
|
|
790
|
+
attachmentUploading.value = true;
|
|
791
|
+
},
|
|
792
|
+
onUploadDone: () => {
|
|
793
|
+
attachmentUploading.value = false;
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
attachment.value = uploadResult;
|
|
797
|
+
} catch (error) {
|
|
798
|
+
console.error("上传图片失败:", error);
|
|
799
|
+
message.error("上传图片失败");
|
|
800
|
+
attachmentUploading.value = false;
|
|
801
|
+
}
|
|
802
|
+
return false;
|
|
708
803
|
};
|
|
709
804
|
const emjjData = [
|
|
710
805
|
"😀",
|
|
@@ -919,15 +1014,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
919
1014
|
size: "12px",
|
|
920
1015
|
onClick: handleDeleteQuoteMsg
|
|
921
1016
|
}),
|
|
922
|
-
|
|
923
|
-
|
|
1017
|
+
quoteMsg.value.type === "text" && quoteMsg.value.attach ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
1018
|
+
createVNode(_sfc_main$3, {
|
|
1019
|
+
attach: quoteMsg.value.attach
|
|
1020
|
+
}, null, 8, ["attach"])
|
|
1021
|
+
])) : createCommentVNode("", true),
|
|
1022
|
+
createElementVNode("div", _hoisted_10, [
|
|
1023
|
+
createElementVNode("div", _hoisted_11, toDisplayString(quoteMsg.value.fromNick) + ":", 1),
|
|
924
1024
|
((_d = quoteMsg.value) == null ? void 0 : _d.body) ? (openBlock(), createElementBlock("div", {
|
|
925
1025
|
key: 0,
|
|
926
1026
|
class: "chatroomInputQuoteTextBody",
|
|
927
1027
|
innerHTML: (_e = quoteMsg.value) == null ? void 0 : _e.body
|
|
928
|
-
}, null, 8,
|
|
1028
|
+
}, null, 8, _hoisted_12)) : createCommentVNode("", true)
|
|
929
1029
|
]),
|
|
930
|
-
quoteMsg.value.type === "image" ? (openBlock(), createElementBlock("div",
|
|
1030
|
+
quoteMsg.value.type === "image" ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
931
1031
|
createVNode(unref(Image), {
|
|
932
1032
|
preview: false,
|
|
933
1033
|
class: "imgMsg quoteImg",
|
|
@@ -937,17 +1037,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
937
1037
|
}, null, 8, ["src", "width", "height"])
|
|
938
1038
|
])) : createCommentVNode("", true)
|
|
939
1039
|
])) : createCommentVNode("", true),
|
|
940
|
-
|
|
941
|
-
|
|
1040
|
+
attachment.value ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
1041
|
+
["jpg", "jpeg", "png", "gif"].includes(attachment.value.ext || "") && attachment.value.url ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
1042
|
+
createElementVNode("div", _hoisted_16, [
|
|
1043
|
+
createVNode(unref(DeleteOutlined), {
|
|
1044
|
+
class: "chatroomInputAttachmentDeleteBtn",
|
|
1045
|
+
onClick: handleDeleteAttachment
|
|
1046
|
+
})
|
|
1047
|
+
]),
|
|
1048
|
+
createVNode(unref(Image), {
|
|
1049
|
+
preview: false,
|
|
1050
|
+
class: "imgMsg quoteImg",
|
|
1051
|
+
src: attachment.value.url,
|
|
1052
|
+
width: 60,
|
|
1053
|
+
height: 60
|
|
1054
|
+
}, null, 8, ["src"])
|
|
1055
|
+
])) : createCommentVNode("", true)
|
|
1056
|
+
])) : createCommentVNode("", true),
|
|
1057
|
+
createElementVNode("div", _hoisted_17, [
|
|
1058
|
+
createElementVNode("div", _hoisted_18, [
|
|
942
1059
|
createVNode(unref(Popover), { placement: "topLeft" }, {
|
|
943
1060
|
content: withCtx(() => [
|
|
944
|
-
createElementVNode("div",
|
|
1061
|
+
createElementVNode("div", _hoisted_19, [
|
|
945
1062
|
(openBlock(), createElementBlock(Fragment, null, renderList(emjjData, (value, i) => {
|
|
946
1063
|
return createElementVNode("span", {
|
|
947
1064
|
key: i,
|
|
948
1065
|
style: { "font-size": "16px", "cursor": "pointer" },
|
|
949
1066
|
onClick: ($event) => insertEmj(i)
|
|
950
|
-
}, toDisplayString(value), 9,
|
|
1067
|
+
}, toDisplayString(value), 9, _hoisted_20);
|
|
951
1068
|
}), 64))
|
|
952
1069
|
])
|
|
953
1070
|
]),
|
|
@@ -992,19 +1109,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
992
1109
|
onBlur: handleInputBlur,
|
|
993
1110
|
onPaste: handlePaste
|
|
994
1111
|
}, null, 8, ["value", "placeholder", "disabled", "onKeydown", "onClick"]),
|
|
995
|
-
createElementVNode("div",
|
|
1112
|
+
createElementVNode("div", _hoisted_21, [
|
|
996
1113
|
createVNode(unref(Upload), {
|
|
997
1114
|
"before-upload": uploadImgHandler,
|
|
998
1115
|
"show-upload-list": false,
|
|
999
1116
|
accept: ".jpg,.png,.jpeg",
|
|
1000
|
-
disabled: __props.sendDisabled
|
|
1117
|
+
disabled: __props.sendDisabled || attachmentUploading.value,
|
|
1118
|
+
class: "chatroomInputUpload"
|
|
1001
1119
|
}, {
|
|
1002
1120
|
default: withCtx(() => [
|
|
1003
1121
|
createVNode(unref(Button), {
|
|
1004
1122
|
class: "chatroomButton",
|
|
1005
1123
|
type: "text",
|
|
1006
|
-
loading:
|
|
1007
|
-
disabled: __props.sendDisabled
|
|
1124
|
+
loading: attachmentUploading.value,
|
|
1125
|
+
disabled: __props.sendDisabled || attachmentUploading.value
|
|
1008
1126
|
}, {
|
|
1009
1127
|
icon: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
1010
1128
|
createElementVNode("svg", {
|
package/dist/notice-box/index.js
CHANGED
package/dist/stores/channel.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUploadFileOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/CloudStorageServiceInterface";
|
|
1
|
+
import { IUploadFileOptions, UploadFileResult } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/CloudStorageServiceInterface";
|
|
2
2
|
import { ChannelInfo, CreateChannelOptions, GetChannelsByPageOptions, GetChannelsByPageResult, GetWhiteBlackMembersPageOptions, UpdateChannelOptions, UpdateWhiteBlackMembersOptions, QChatChannelUnreadInfo } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatChannelServiceInterface";
|
|
3
3
|
import { QChatMessage, QChatMessageRefer, RovokeMessageOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatMsgServiceInterface";
|
|
4
4
|
import { AddMemberRoleOptions, QChatChannelRole, GetMemberRolesOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface";
|
|
@@ -11,6 +11,8 @@ interface ServerUnReadCountAgg {
|
|
|
11
11
|
unreadCount: number;
|
|
12
12
|
}
|
|
13
13
|
export interface SendMsgOption {
|
|
14
|
+
/** 附件信息(如上传的图片信息),如果有则塞到attach字段 */
|
|
15
|
+
attach?: UploadFileResult;
|
|
14
16
|
ext?: {
|
|
15
17
|
/** 引用消息 */
|
|
16
18
|
quoteMsg?: QChatMessage;
|
|
@@ -100,7 +102,7 @@ export declare const useChannelStore: import("pinia").StoreDefinition<"channel",
|
|
|
100
102
|
updateCurChannelMsgs(msg: QChatMessage): void;
|
|
101
103
|
setCurChannelMsgs(payload: QChatMessage[]): void;
|
|
102
104
|
clearCurChannelMsgs(): void;
|
|
103
|
-
getChannelsByPage: (this: any, options: GetChannelsByPageOptions) => Promise<
|
|
105
|
+
getChannelsByPage: (this: any, options: GetChannelsByPageOptions) => Promise<void>;
|
|
104
106
|
createChannel(options: CreateChannelOptions): Promise<ChannelInfo>;
|
|
105
107
|
updateChannel(options: UpdateChannelOptions): Promise<void>;
|
|
106
108
|
deleteChannel(): Promise<void>;
|
|
@@ -108,6 +110,20 @@ export declare const useChannelStore: import("pinia").StoreDefinition<"channel",
|
|
|
108
110
|
limit: number;
|
|
109
111
|
}): Promise<QChatMessage[]>;
|
|
110
112
|
loadMoreHistoryMsgs(options: LoadMoreHistoryMsgsOptions): Promise<QChatMessage[]>;
|
|
113
|
+
/**
|
|
114
|
+
* 上传图片
|
|
115
|
+
* @param options - 上传选项,包含图片文件和回调函数
|
|
116
|
+
* @returns Promise<UploadFileResult> 返回上传结果,包含图片URL、宽高等信息
|
|
117
|
+
*/
|
|
118
|
+
uploadImage(options: {
|
|
119
|
+
file: IUploadFileOptions["file"];
|
|
120
|
+
onUploadStart?: IUploadFileOptions["onUploadStart"];
|
|
121
|
+
onUploadDone?: IUploadFileOptions["onUploadDone"];
|
|
122
|
+
}): Promise<UploadFileResult>;
|
|
123
|
+
/**
|
|
124
|
+
* 发送文本消息
|
|
125
|
+
* @param options - 发送选项,包含消息内容和可选附件
|
|
126
|
+
*/
|
|
111
127
|
sendTextMsg(options: {
|
|
112
128
|
body: string;
|
|
113
129
|
} & SendMsgOption): Promise<void>;
|