repo_name
string
dataset
string
owner
string
lang
string
func_name
string
code
string
docstring
string
url
string
sha
string
openstreetmap-ng
github_2023
openstreetmap-ng
typescript
onContainerClick
const onContainerClick = (e: MouseEvent) => { const container = e.currentTarget as HTMLElement const layerId = container.dataset.layerId as LayerId const config = layersConfig.get(layerId) if (config.isBaseLayer) { // Skip updates if the container is alre...
/** On layer click, update the active (base) layer */
https://github.com/openstreetmap-ng/openstreetmap-ng/blob/42f2654614f20520271f46b3ddd389732dde6545/app/static/ts/leaflet/_sidebar-layers.ts#L174-L194
42f2654614f20520271f46b3ddd389732dde6545
openstreetmap-ng
github_2023
openstreetmap-ng
typescript
onOverlayCheckboxChange
const onOverlayCheckboxChange = (e: Event) => { const checkbox = e.currentTarget as HTMLInputElement const layerId = checkbox.value as LayerId const checked = checkbox.checked // Skip updates if the layer is already in the correct state if (checked === hasMap...
/** On overlay checkbox change, add or remove the overlay layer */
https://github.com/openstreetmap-ng/openstreetmap-ng/blob/42f2654614f20520271f46b3ddd389732dde6545/app/static/ts/leaflet/_sidebar-layers.ts#L200-L216
42f2654614f20520271f46b3ddd389732dde6545
openstreetmap-ng
github_2023
openstreetmap-ng
typescript
updateSidebar
const updateSidebar = (): void => { // Skip updates if the sidebar is hidden if (!button.classList.contains("active")) return const activeLayerId = getMapBaseLayerId(map) const currentZoomFloor = map.getZoom() | 0 for (const layerContainer of layerContainers...
/** Update the sidebar content to show only relevant elements */
https://github.com/openstreetmap-ng/openstreetmap-ng/blob/42f2654614f20520271f46b3ddd389732dde6545/app/static/ts/leaflet/_sidebar-legend.ts#L74-L98
42f2654614f20520271f46b3ddd389732dde6545
openstreetmap-ng
github_2023
openstreetmap-ng
typescript
openMessagePreview
const openMessagePreview = (target: HTMLElement) => { const newMessageId = target.dataset.id if (openMessageId === newMessageId) return if (openTarget) closeMessagePreview() openTarget = target openMessageId = newMessageId console.debug("openMessagePreview", openMessageI...
/** Open a message in the sidebar preview panel */
https://github.com/openstreetmap-ng/openstreetmap-ng/blob/42f2654614f20520271f46b3ddd389732dde6545/app/static/ts/messages/_index.ts#L25-L90
42f2654614f20520271f46b3ddd389732dde6545
openstreetmap-ng
github_2023
openstreetmap-ng
typescript
closeMessagePreview
const closeMessagePreview = () => { console.debug("closeMessagePreview", openMessageId) messagePreviewContainer.classList.add("d-none") abortController?.abort() abortController = null openTarget.classList.remove("active") openTarget = null openMessageId = null ...
/** Close the message sidebar preview panel */
https://github.com/openstreetmap-ng/openstreetmap-ng/blob/42f2654614f20520271f46b3ddd389732dde6545/app/static/ts/messages/_index.ts#L93-L104
42f2654614f20520271f46b3ddd389732dde6545
openstreetmap-ng
github_2023
openstreetmap-ng
typescript
updatePageUrl
const updatePageUrl = (message: HTMLElement | undefined) => { if (message) { const messageLink = message.querySelector("a.stretched-link") window.history.replaceState(null, "", messageLink.href) } else { const url = new URL(window.location.href) url.search...
/** Update the URL with the given message, without reloading the page */
https://github.com/openstreetmap-ng/openstreetmap-ng/blob/42f2654614f20520271f46b3ddd389732dde6545/app/static/ts/messages/_index.ts#L107-L116
42f2654614f20520271f46b3ddd389732dde6545
vscode-container-wasm
github_2023
ktock
typescript
read_ciovs
function read_ciovs (memory: ArrayBuffer, iovs: ptr, iovsLen: u32): Uint8Array[] { const view = new DataView(memory); const buffers: Uint8Array[] = []; let ptr: ptr = iovs; for (let i = 0; i < iovsLen; i++) { const vec = Ciovec.create(view, ptr); // We need to copy the underlying memory since if it...
// Used when writing data
https://github.com/ktock/vscode-container-wasm/blob/bc30c414e2476a51dbb9256ebc4f27a285372ed4/src/vendor/wasm-wasi-core/src/common/service.ts#L1180-L1195
bc30c414e2476a51dbb9256ebc4f27a285372ed4
vscode-container-wasm
github_2023
ktock
typescript
read_iovs
function read_iovs (memory: ArrayBuffer, iovs: ptr, iovsLen: u32): Uint8Array[] { const view = new DataView(memory); const buffers: Uint8Array[] = []; let ptr: ptr = iovs; for (let i = 0; i < iovsLen; i++) { const vec = Iovec.create(view, ptr); // We need a view onto the memory since we write the r...
// Used when reading data
https://github.com/ktock/vscode-container-wasm/blob/bc30c414e2476a51dbb9256ebc4f27a285372ed4/src/vendor/wasm-wasi-core/src/common/service.ts#L1198-L1210
bc30c414e2476a51dbb9256ebc4f27a285372ed4
vscode-container-wasm
github_2023
ktock
typescript
normalizeString
function normalizeString(path: string, allowAboveRoot: boolean, separator: string, isPathSeparator: (code?: number) => boolean) { let res = ''; let lastSegmentLength = 0; let lastSlash = -1; let dots = 0; let code = 0; for (let i = 0; i <= path.length; ++i) { if (i < path.length) { code = path.charCodeAt(i);...
// Resolves . and .. elements in a path with directory names
https://github.com/ktock/vscode-container-wasm/blob/bc30c414e2476a51dbb9256ebc4f27a285372ed4/src/vendor/wasm-wasi-core/src/web/path.ts#L68-L134
bc30c414e2476a51dbb9256ebc4f27a285372ed4
vscode-container-wasm
github_2023
ktock
typescript
importAll
const importAll = (r: __WebpackModuleApi.RequireContext) => r.keys().forEach(r);
// Bundles all files in the current directory matching `*.test`
https://github.com/ktock/vscode-container-wasm/blob/bc30c414e2476a51dbb9256ebc4f27a285372ed4/src/web/test/suite/index.ts#L13-L13
bc30c414e2476a51dbb9256ebc4f27a285372ed4
dev-plugins
github_2023
expo
typescript
handleCacheEvent
const handleCacheEvent = (event: QueryCacheNotifyEvent) => { const { query } = event; client?.sendMessage('queryCacheEvent', { cacheEvent: stringify({ ...event, query: serializeQuery(query) }, bigintReplacer), }); };
/** * handles QueryCacheNotifyEvent * @param event - QueryCacheNotifyEvent, but RQ doesn't have it exported */
https://github.com/expo/dev-plugins/blob/fe3724f8e06f1534fb25d127f84270b953f63af9/packages/react-query/src/useReactQueryDevTools.ts#L57-L62
fe3724f8e06f1534fb25d127f84270b953f63af9
workbench
github_2023
yhtt2020
typescript
mainWorldScript
function mainWorldScript() { const DEFAULT_PARTITION = '_self' class BrowserActionElement extends HTMLButtonElement { private updateId?: number private badge?: HTMLDivElement private pendingIcon?: HTMLImageElement get id(): string { return this.getAttribute('id') || '' } ...
// Function body to run in the main world.
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser-action.ts#L72-L399
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ElectronChromeExtensions.fromSession
static fromSession(session: Electron.Session) { return sessionMap.get(session) }
/** Retrieve an instance of this class associated with the given session. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/index.ts#L39-L41
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ElectronChromeExtensions.addTab
addTab(tab: Electron.WebContents, window: Electron.BrowserWindow) { this.ctx.store.addTab(tab, window) }
/** Add webContents to be tracked as a tab. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/index.ts#L131-L133
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ElectronChromeExtensions.selectTab
selectTab(tab: Electron.WebContents) { if (this.ctx.store.tabs.has(tab)) { this.api.tabs.onActivated(tab.id) } }
/** Notify extension system that the active tab has changed. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/index.ts#L136-L140
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ElectronChromeExtensions.addExtensionHost
addExtensionHost(host: Electron.WebContents) { console.warn('ElectronChromeExtensions.addExtensionHost() is deprecated') }
/** * Add webContents to be tracked as an extension host which will receive * extension events when a chrome-extension:// resource is loaded. * * This is usually reserved for extension background pages and popups, but * can also be used in other special cases. * * @deprecated Extension hosts are no...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/index.ts#L152-L154
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ElectronChromeExtensions.getContextMenuItems
getContextMenuItems(webContents: Electron.WebContents, params: Electron.ContextMenuParams) { return this.api.contextMenus.buildMenuItemsForParams(webContents, params) }
/** * Get collection of menu items managed by the `chrome.contextMenus` API. * @see https://developer.chrome.com/extensions/contextMenus */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/index.ts#L160-L162
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ElectronChromeExtensions.addExtension
addExtension(extension: Electron.Extension) { console.warn('ElectronChromeExtensions.addExtension() is deprecated') this.api.browserAction.processExtension(extension) }
/** * Add extensions to be visible as an extension action button. * * @deprecated Not needed in Electron >=12. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/index.ts#L169-L172
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ElectronChromeExtensions.removeExtension
removeExtension(extension: Electron.Extension) { console.warn('ElectronChromeExtensions.removeExtension() is deprecated') this.api.browserAction.removeActions(extension.id) }
/** * Remove extensions from the list of visible extension action buttons. * * @deprecated Not needed in Electron >=12. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/index.ts#L179-L182
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
PopupView.whenReady
whenReady() { return this.readyPromise }
/** Resolves when the popup finishes loading. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/popup.ts#L153-L155
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
PopupView.queryPreferredSize
private async queryPreferredSize() { if (this.usingPreferredSize || this.destroyed) return const rect = await this.browserWindow!.webContents.executeJavaScript( `((${() => { const rect = document.body.getBoundingClientRect() return { width: rect.width, height: rect.height } }})())` ...
/** Backwards compat for Electron <12 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/popup.ts#L219-L233
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
shortenValues
const shortenValues = (k: string, v: any) => typeof v === 'string' && v.length > 128 ? v.substr(0, 128) + '...' : v
// Shorten base64 encoded icons
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/router.ts#L6-L7
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ExtensionRouter.apiHandler
apiHandler() { return (name: string, callback: HandlerCallback, opts?: HandlerOptions) => { this.handle(name, callback, opts) } }
/** Returns a callback to register API handlers for the given context. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/router.ts#L286-L290
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ExtensionRouter.sendEvent
sendEvent(extensionId: string | undefined, eventName: string, ...args: any[]) { const { listeners } = this let eventListeners = listeners.get(eventName) if (extensionId) { // TODO: extension permissions check eventListeners = eventListeners?.filter((el) => el.extensionId === extensionId) ...
/** * Sends extension event to the host for the given extension ID if it * registered a listener for it. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/router.ts#L296-L322
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
ExtensionRouter.broadcastEvent
broadcastEvent(eventName: string, ...args: any[]) { this.sendEvent(undefined, eventName, ...args) }
/** Broadcasts extension event to all extension hosts listening for it. */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/router.ts#L325-L327
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
BrowserActionAPI.setupProtocol
public setupProtocol(session:Electron.Session){ const result=session.protocol.registerBufferProtocol('crx', this.handleCrxRequest) return result }
//注册协议
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/api/browser-action.ts#L198-L201
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
BrowserActionAPI.removeActions
removeActions(extensionId: string) { if (this.actionMap.has(extensionId)) { this.actionMap.delete(extensionId) } this.onUpdate() }
// TODO: Make private for v4 major release.
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/api/browser-action.ts#L290-L296
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
BrowserActionAPI.processExtension
processExtension(extension: Electron.Extension) { const defaultAction = getBrowserActionDefaults(extension) if (defaultAction) { const action = this.getAction(extension.id) Object.assign(action, defaultAction) } }
// TODO: Make private for v4 major release.
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/api/browser-action.ts#L320-L326
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
getFrame
const getFrame = (frameProcessId: number, frameRoutingId: number) => { return ( ('webFrameMain' in electron && (electron as any).webFrameMain.fromId(frameProcessId, frameRoutingId)) || null ) }
// https://github.com/electron/electron/pull/25464
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/browser/api/web-navigation.ts#L8-L14
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
mainWorldScript
function mainWorldScript() { // Use context bridge API or closure variable when context isolation is disabled. const electron = ((window as any).electron as typeof electronContext) || electronContext const chrome = window.chrome || {} const extensionId = chrome.runtime?.id // NOTE: This uses a syn...
// Function body to run in the main world.
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/packages/electron-chrome-extensions/src/renderer/index.ts#L61-L459
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
AppStorageModel.getItem
async getItem(key,sign=null){ let found=await this.db.knex('storage').where({key,sign}).first() if(found){ return found['value'] }else{ return null } }
/** * 注意,取出的所有值均为string,需要自行反序列化 * @param key * @param sign * @returns {Promise<*>} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/src/model/appStorageModel.ts#L34-L42
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
AppStorageModel.setItem
async setItem(key,value,sign){ if(typeof value==='object'){ value=JSON.stringify(value) } let found= await this.db.knex('storage').where({key,sign}).first() if(found){ return this.db.knex('storage').where({key,sign}).update({value}) }else{ return this.db.knex('storage').insert({val...
/** * 支持自动序列化对象值value * @param key * @param value * @param domain 跨站的值可留空 * @returns {*} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/src/model/appStorageModel.ts#L51-L62
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TableModel.getItem
async getItem(key,sign=null){ let found=await this.db.knex('storage').where({key,sign}).first() if(found){ return found['value'] }else{ return null } }
/** * 注意,取出的所有值均为string,需要自行反序列化 * @param key * @param sign * @returns {Promise<*>} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/src/model/tableModel.ts#L33-L41
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TableModel.setItem
async setItem(key,value,sign){ if(typeof value==='object'){ value=JSON.stringify(value) } let found= await this.db.knex('storage').where({key,sign}).first() if(found){ return this.db.knex('storage').where({key,sign}).update({value}) }else{ return this.db.knex('storage').insert({val...
/** * 支持自动序列化对象值value * @param key * @param value * @param domain 跨站的值可留空 * @returns {*} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/src/model/tableModel.ts#L50-L61
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
sUrl
function sUrl(url:string) { return Server.baseUrl+url }
/** * 生成服务端url,斜杠开头 * @param url 接口地址,斜杠开头 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/consts.ts#L11-L13
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
initStores
function initStores(){ aiStore() appsStore() frameStore() browserStore() captureStore() cardStore() chatStore() codeStore() comStore() countDownStore() deskStore() filmStore() epicStore() fishStore() gameStrategyStore() homeStore() inspectorStore() marketStore() myIcons() navStor...
/*加载其他状态end*/
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/initStores.ts#L36-L69
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
install
const install = (app: any) => { list.forEach((component:any) => { component.install(app); }); };
/** * 组件挂载 * * @param {app} app 挂载到主体 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/index.ts#L23-L27
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
plugin
const plugin = (TUICore: any) => { list.forEach((component:any) => { component.plugin(TUICore); }); };
/** * 组件注册到TUICore * * @param {TUICore} TUICore 主体TUICore */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/index.ts#L34-L38
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
IComponentServer.destroyed
public destroyed() {}
/** * 组件销毁 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/IComponentServer.ts#L11-L11
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
IComponentServer.updateStore
protected updateStore(oldValue:any, newValue:any) {}
/** * 数据监听回调 * * @param {any} oldValue 旧数据 * @param {any} newValue 新数据 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/IComponentServer.ts#L19-L19
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.destroyed
public destroyed() { this.unbindTIMEvent(); }
/** * 组件销毁 * destroy */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L26-L28
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.updateStore
updateStore(newValue: any, oldValue: any) { Object.assign(this.currentStore, newValue); if (!newValue.conversation.conversationID) { this.currentStore.messageList = []; return; } if ( newValue.conversation.conversationID && newValue.conversation.conversationID !== oldValue.conver...
/** * 数据监听回调 * data listener callback * * @param {any} newValue 新数据 * @param {any} oldValue 旧数据 * */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L38-L50
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.bindTIMEvent
private bindTIMEvent() { this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_RECEIVED, this.handleMessageReceived, this); this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_MODIFIED, this.handleMessageModified, this); this.TUICore.tim.on(this.TUICore.TIM.EVENT.MESSAGE_REVOKED, this.handleMessageRevoked, this...
/** * ///////////////////////////////////////////////////////////////////////////////// * // * // TIM 事件监听注册接口 * // TIM Event listener registration interface * // * ///////////////////////////////////////////////////////////////////////////////...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L94-L105
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.handleMessageOptions
public handleMessageOptions(content: any, type: string, callback?: any, to?: any) { const options: any = { to: '', conversationType: to?.type || this.store.conversation.type, payload: content, needReadReceipt: this.currentStore.needReadReceipt, }; if (this.currentStore.needTyping) { ...
/** * 创建消息生成参数 * Create message generation parameters * * @param {Object} content 消息体 * @param {String} type 消息类型 text: 文本类型 file: 文件类型 face: 表情 location: 地址 custom: 自定义 merger: 合并 forward: 转发 * @param {Callback} callback 回调函数 * @param {any} to 发送的对象 * @returns {options} 消息参数 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L177-L207
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.handlePromiseCallback
public handlePromiseCallback(callback: any) { return new Promise<void>((resolve, reject) => { const config = { TUIName: 'TUIChat', callback: () => { callback && callback(resolve, reject); }, }; this.TUICore.setAwaitFunc(config.TUIName, config.callback); }); ...
/** * 处理异步函数 * Handling asynchronous functions * * @param {callback} callback 回调函数 * @returns {Promise} 返回异步函数 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L216-L226
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.handlePromiseCallbackRetry
public handlePromiseCallbackRetry(callback: any, intervalList: Array<number> = [], retryBreakFn: any = function () { return false; }): Promise<any> { return new Promise<void>((resolve, reject) => { let times = 0; function tryFn() { times++; callback() .then(resolve) ....
/** * 重试异步函数 * Retry asynchronous functions * 默认执行一次,之后按时间间隔列表重复执行直到成功,重复次数完毕后仍失败则失败 * Execute once by default, and then repeat it according to the time interval list until it succeeds. * If it still fails after the number of repetitions is complete, it will reject. * * @param {callback} callback...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L240-L257
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.handleUploadProgress
public handleUploadProgress(progress: number, message: any) { this.currentStore.messageList.map((item: any) => { if (item.ID === message.ID) { item.progress = progress; } return item; }); }
/** * 文件上传进度函数处理 * File upload progress function processing * * @param {number} progress 文件上传进度 1表示完成 * @param {message} message 文件消息 */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L267-L274
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendFaceMessage
public sendFaceMessage(data: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions(data, 'face'); const message = this.TUICore.tim.createFaceMessage(options); this.currentStore.messageList.push(mess...
/** * 发送表情消息 * Send face messages * * @param {Object} data 消息内容/message content * @param {Number} data.index 表情索引/face index * @param {String} data.data 额外数据/extra data * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L294-L315
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendImageMessage
public sendImageMessage(image: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions({ file: image }, 'file', (progress: number) => { this.handleUploadProgress(progress, message); }); cons...
/** * 发送图片消息 * Send image message * * @param {Image} image 图片文件/image * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L324-L348
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendVideoMessage
public sendVideoMessage(video: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions({ file: video }, 'file', (progress: number) => { this.handleUploadProgress(progress, message); }); cons...
/** * 发送视频消息 * Send video message * * @param {Video} video 视频文件/video * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L357-L382
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendFileMessage
public sendFileMessage(file: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions({ file }, 'file', (progress: number) => { this.handleUploadProgress(progress, message); }); const message...
/** * 发送文件消息 * Send file message * * @param {File} file 文件/file * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L391-L415
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendCustomMessage
public sendCustomMessage(data: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { data.data = JSON.stringify(data.data); const options = this.handleMessageOptions(data, 'custom'); const message = this.TUICore.tim.createCustomMessage(opti...
/** * 发送自定义消息 * Send Custom message * * @param {Object} data 消息内容/message content * @param {String} data.data 自定义消息的数据字段/custom message data fields * @param {String} data.description 自定义消息的说明字段/custom message description fields * @param {String} data.extension 自定义消息的扩展字段/custom message extension fi...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L427-L449
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendLocationMessage
public sendLocationMessage(data: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions(data, 'location'); const message = this.TUICore.tim.createLocationMessage(options); this.currentStore.messageLi...
/** * 发送地理位置消息 * Send location message * * @param {Object} data 消息内容/message content * @param {String} data.description 地理位置描述信息/geographic descriptive information * @param {Number} data.longitude 经度/longitude * @param {Number} data.latitude 纬度/latitude * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L461-L476
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.forwardMessage
public forwardMessage(message: any, to: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions(message, 'forward', {}, to); const imMessage = this.TUICore.tim.createForwardMessage(options); const imR...
/** * 转发消息 * forward message * * @param {message} message 消息实例/message * @param {any} to 转发的对象/forward to * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L486-L503
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendMessageReadReceipt
public async sendMessageReadReceipt(messageList: Array<any>) { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse: any = await this.TUICore.tim.sendMessageReadReceipt(messageList); resolve(imResponse); } catch (error) { reject(error); ...
/** * 发送消息已读回执 * Send message read receipt * * @param {Array} messageList 同一个 C2C 或 GROUP 会话的消息列表,最大长度为30/A list of messages for the same C2C or GROUP conversation, with a maximum length of 30 * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L512-L521
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getMessageReadReceiptList
public async getMessageReadReceiptList(messageList: Array<any>) { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse: any = await this.TUICore.tim.getMessageReadReceiptList(messageList); resolve(imResponse); } catch (error) { reject(er...
/** * 拉取已读回执列表 * Pull read receipt list * * @param {Array} messageList 同一群会话的消息列表/The message list of the same group of the conversation * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L530-L539
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getMessageList
public async getMessageList(options: any, history?: boolean) { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getMessageList(options); if (imResponse.data.messageList.length) { await this.getMessageReadReceiptL...
/** * 获取 messageList * get messagelist * * @param {any} options 获取 messageList 参数/messageList options * @param {Boolean} history 是否获取历史消息/Whether to get historical information * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L557-L577
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getHistoryMessageList
public async getHistoryMessageList() { const options = { conversationID: this.currentStore.conversation.conversationID, nextReqMessageID: this.currentStore.nextReqMessageID, count: 15, }; if (!this.currentStore.isCompleted) { this.getMessageList(options, true); } }
/** * 获取历史消息 * get history messagelist * * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L585-L594
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendTextMessage
public sendTextMessage(text: any, data: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions({ text }, 'text'); let cloudCustomDataObj = {}; if (options.cloudCustomData) { try { ...
/** * 发送文本消息 * send text message * * @param {any} text 发送的消息/text message * @param {object} data 被引用消息的内容/The content of the quoted message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L604-L635
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendTypingMessage
public sendTypingMessage(data: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { data.data = JSON.stringify(data.data); const options = this.handleMessageOptions(data, 'custom'); const message = this.TUICore.tim.createCustomMessage(opti...
/** * 发送【对方正在输入中】在线自定义消息 * send typing online custom message * * @param {Object} data 消息内容/message content * @param {String} data.data 自定义消息的数据字段/custom message data field * @param {String} data.description 自定义消息的说明字段/custom message description field * @param {String} data.extension 自定义消息的扩展字段/cust...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L647-L662
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendTextAtMessage
public sendTextAtMessage(data: any) { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions(data, 'text'); const message = this.TUICore.tim.createTextAtMessage(options); this.currentStore.messageList.push(message); ...
/** * 发送@ 提醒功能的文本消息 * Send @ Reminder text message * * @param {any} data 消息内容/message content * @param {String} data.text 文本消息/text message * @param {Array} data.atUserList 需要 @ 的用户列表,如果需要 @ALL,请传入 TIM.TYPES.MSG_AT_ALL / List of users who need @, if you need @ALL, please pass in TIM.TYPES.MSG_AT_ALL ...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L675-L696
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.sendMergerMessage
public sendMergerMessage(data: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const options = this.handleMessageOptions(data, 'merger'); const message = this.TUICore.tim.createMergerMessage(options); this.currentStore.messageList.pus...
/** * 发送合并消息 * send merger message * * @param {Object} data 消息内容/message content * @param {Array.<Message>} data.messageList 合并的消息列表/merger message list * @param {String} data.title 合并的标题/merger title * @param {String} data.abstractList 摘要列表,不同的消息类型可以设置不同的摘要信息/Summary list, different message types ...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L709-L730
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.revokeMessage
public revokeMessage(message: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.revokeMessage(message); const cloudCustomData = JSONToObject(message?.cloudCustomData); if (cloudCustomData?.messa...
/** * 消息撤回 * revoke message * * @param {message} message 消息实例/message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L739-L755
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.resendMessage
public resendMessage(message: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.resendMessage(message); this.currentStore.messageList = this.currentStore.messageList.filter((item: any) => item.ID !== me...
/** * 重发消息 * resend message * * @param {message} message 消息实例/message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L764-L775
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.deleteMessage
public deleteMessage(messages: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.deleteMessage(messages); resolve(imResponse); const middleData = this.currentStore.messageList; this.curr...
/** * 删除消息 * delete message * * @param {Array.<message>} messages 消息实例/message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L784-L796
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.modifyMessage
public modifyMessage(message: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.modifyMessage(message); resolve(imResponse); } catch (error) { // 修改消息失败 // Modify message error ...
/** * 变更消息 * modify message * * @param {Array.<message>} message 消息实例/message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L805-L825
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.replyMessage
public replyMessage(message: any, messageRoot?: any): Promise<any> { const replyFunction = () => { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const repliesObject = { messageAbstract: message?.payload?.text, messageSender: message?.f...
/** * 回复消息 * reply message * @param {Array.<message>} message 消息实例/message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L832-L869
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.revokeReplyMessage
public revokeReplyMessage(message: any, messageRoot?: any): Promise<any> { const revokeReplyFunction = () => { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { if (!messageRoot) { const cloudCustomData = JSONToObject(message?.cloudCustomData); ...
/** * 撤回回复消息 * revoke reply message * @param {Array.<message>} message 消息实例/message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L877-L904
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.emojiReact
public emojiReact(message: any, emojiID: any): Promise<any> { const emojiReactFunction = () => { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { if (!message || !message?.ID || !emojiID) reject(); const userID = this.TUICore?.TUIServer?.TUIProfile?.st...
/** * 表情回应 * emoji react * @param {Array.<message>} message 消息实例/message * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L912-L954
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.findMessage
public findMessage(messageID: string): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.findMessage(messageID); resolve(imResponse); } catch (error) { reject(error); } }) }
/** * 查询消息 * find message * @param {String} messageID 消息实例ID/messageID * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L963-L972
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getGroupProfile
public getGroupProfile(options: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getGroupProfile(options); this.currentStore.conversation.groupProfile = imResponse.data.group; resolve(imRespons...
/** * 获取群组属性 * get group profile * * @param {any} options 参数 * @param {String} options.groupID 群组ID * @param {Array.<String>} options.groupProfileFilter 群资料过滤器 * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L983-L993
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getGroupMemberProfile
public getGroupMemberProfile(options: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getGroupMemberProfile(options); resolve(imResponse); } catch (error) { reject(error); } })...
/** * 获取群成员资料 * get group member profile * * @param {any} options 参数 * @param {String} options.groupID 群组ID * @param {Array.<String>} options.userIDList 要查询的群成员用户 ID 列表 * @param { Array.<String>} options.memberCustomFieldFilter 群成员自定义字段筛选 * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1005-L1014
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.handleGroupApplication
public handleGroupApplication(options: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.handleGroupApplication(options); resolve(imResponse); } catch (error) { reject(error); } ...
/** * 处理申请加群 * handling group application * - 管理员 * administrator * * @param {any} options 参数 * @param {String} options.handleAction 处理结果 Agree(同意) / Reject(拒绝) * @param {String} options.handleMessage 附言 * @param {Message} options.message 对应【群系统通知】的消息实例 * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1028-L1037
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getUserProfile
public async getUserProfile(userIDList: Array<string>) { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getUserProfile({ userIDList }); resolve(imResponse); } catch (error) { reject(error); } }); ...
/** * 获取其他用户资料 * get user profile * * @param {Array<string>} userIDList 用户的账号列表/userID list * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1046-L1055
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getFriendList
public async getFriendList(): Promise<void> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getFriendList(); resolve(imResponse); } catch (error) { reject(error); } }); }
/** * 获取 SDK 缓存的好友列表 * Get the friend list cached by the SDK * * @param {Array<string>} userIDList 用户的账号列表 * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1064-L1073
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.checkFriend
public async checkFriend(userID: string, type: string): Promise<void> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.checkFriend({ userIDList: [userID], type }); const isFriendShip = imResponse?.data?.successUserIDList...
/** * 校验好友关系 * check friend * * @param {string} userID 用户账号 * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1082-L1092
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getGroupReadMemberList
public async getGroupReadMemberList(message: any, cursor = '', count = 15): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getGroupMessageReadMemberList({ message, filter: 0, cursor, ...
/** * 获取群消息已读成员列表 * Get the list of memebers who have read the group message. * * @param {message} message 消息实例/message * @param {string} cursor 分页拉取的游标,第一次拉取传''/Paging pull the cursor,first pull pass '' * @param {number} count 分页拉取的个数/The number of page pulls * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1103-L1117
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.getGroupUnreadMemberList
public async getGroupUnreadMemberList(message: any, cursor = '', count = 15): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getGroupMessageReadMemberList({ message, filter: 1, cursor...
/** * 获取群消息未读成员列表 * Get the list of memebers who have not read the group message. * * @param {message} message 消息实例/message * @param {string} cursor 分页拉取的游标,第一次拉取传''/Paging pull the cursor,first pull pass '' * @param {number} count 分页拉取的个数/The number of page pulls * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1128-L1142
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.handleMessageSentByMeToView
public async handleMessageSentByMeToView(message: any) { if (message?.conversationID === this?.store?.conversation?.conversationID) { this.currentStore.messageList.push(message); } return; }
/** * 自己发送消息上屏显示 * * @param {message} message 消息实例/message */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1149-L1154
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIChatServer.bind
public bind(params: any) { return (this.currentStore = params); }
/** * 赋值 * bind * * @param {Object} params 使用的数据/params * @returns {Object} 数据/data */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIChat/server.ts#L1172-L1174
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.destroyed
public destroyed() { this.unbindTIMEvent(); }
/** * 组件销毁 * destroy */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L27-L29
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.updateStore
updateStore(newValue: any, oldValue: any) { this.currentStore.groupList = newValue.groupList; this.currentStore.searchGroup = newValue.searchGroup; this.currentStore.systemConversation = newValue.systemConversation; this.currentStore.systemMessageList = newValue.systemMessageList; }
/** * 数据监听回调 * data listener callback * * @param {any} newValue 新数据/new value * @param {any} oldValue 旧数据/old value */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L38-L43
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.bindTIMEvent
private bindTIMEvent() { this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_LIST_UPDATED, this.handleGroupListUpdated, this); this.TUICore.tim.on(this.TUICore.TIM.EVENT.GROUP_ATTRIBUTES_UPDATED, this.handleGroupAttributesUpdated, this); this.TUICore.tim.on(this.TUICore.TIM.EVENT.CONVERSATION_LIST_UPDATED, thi...
/** * ///////////////////////////////////////////////////////////////////////////////// * // * // TIM 事件监听注册接口 * // TIM Event listener registration interface * // * ///////////////////////////////////////////////////////////////////////////////...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L54-L60
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.handlePromiseCallback
public handlePromiseCallback(callback: any) { return new Promise<void>((resolve, reject) => { const config = { TUIName: 'TUIContact', callback: () => { callback && callback(resolve, reject); }, }; this.TUICore.setAwaitFunc(config.TUIName, config.callback); });...
/** * 处理异步函数 * Handling asynchronous functions * * @param {callback} callback 回调函数/callback * @returns {Promise} 返回异步函数/return callback */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L115-L125
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.handleFilterSystem
private handleFilterSystem(list: any) { const options = { allConversationList: list, systemConversationList: [], }; options.systemConversationList = list.filter((item: any) => item.type === this.TUICore.TIM.TYPES.CONV_SYSTEM); this.store.allConversationList = options.allConversationList; ...
/** * 处理conversationList * Handle conversation list * * @param {Array} list conversationList * @returns {Object} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L134-L145
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.getConversationList
public async getConversationList() { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getConversationList(); this.handleFilterSystem(imResponse.data.conversationList); resolve(imResponse); } catch (error) { ...
/* * 获取 conversationList * Get conversation list * * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L162-L172
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.getSystemMessageList
public async getSystemMessageList() { // console.log('是否进入::>>',); if(this.store.systemConversation !== undefined){ const options = { conversationID: this.store.systemConversation.conversationID, count: 15, }; return this.handlePromiseCallback(async (resolve: any, reject: any) ...
/** * 获取系统通知 messageList * Get system messages * * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L180-L200
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.setMessageRead
public async setMessageRead() { if(this.store.systemConversation !== undefined){ return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse: any = await this.TUICore.tim.setMessageRead({ conversationID: this.store.systemConversation.conversati...
/** * 设置已读 * Set message read * * @param {string} conversationID 会话ID/ conversation's ID * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L209-L225
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.getGroupList
public async getGroupList(options?: any) { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { let imResponse: any = {}; if (!options) { imResponse = await this.TUICore.tim.getGroupList(); } else { imResponse = await this.TUICore.tim.getGr...
/** * 获取群组列表 * Get group list * * @param {any} options 参数/options * @param {Array.<String>} options.groupProfileFilter 群资料过滤器/group profile filter * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L235-L250
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.getGroupProfile
public getGroupProfile(options: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getGroupProfile(options); this.store.groupList = imResponse.data.groupList; resolve(imResponse); } catch (...
/** * 获取群组属性 * Get group profile * * @param {any} options 参数/options * @param {String} options.groupID 群组ID/group's ID * @param {Array.<String>} options.groupProfileFilter 群资料过滤器/group profile filter * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L261-L271
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.dismissGroup
public dismissGroup(groupID: string): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.dismissGroup(groupID); this.store.groupProfile = imResponse.data.group; resolve(imResponse); } catch (erro...
/** * 删除群组 * Dismiss group * * @param {String} groupID 群组ID/group's ID * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L280-L290
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.updateGroupProfile
public updateGroupProfile(options: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.updateGroupProfile(options); this.store.groupProfile = imResponse.data.group; resolve(imResponse); } ca...
/** * 修改群组资料 * Update group profile * * @param {any} options 参数/params options * @param {String} options.groupID 群组ID/group's ID * @param {String} options.name 群组名称/group's name * @param {String} options.introduction 群简介/group's introduction * @param {String} options.notification 群公告/group's not...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L307-L317
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.joinGroup
public joinGroup(options: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.joinGroup(options); resolve(imResponse); } catch (error) { reject(error); } }); }
/** * 申请加群 * Join group * * @param {any} options 参数/options * @param {String} options.groupID 群组ID/group's ID * @param {String} options.applyMessage 附言/apply message * @param {String} options.type 群组类型/group's type * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L329-L338
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.quitGroup
public quitGroup(groupID: string): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.quitGroup(groupID); resolve(imResponse); } catch (error) { reject(error); } }); }
/** * 退出群组 * Quit group * * @param {String} groupID 群组ID/group's ID * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L347-L356
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.searchGroupByID
public searchGroupByID(groupID: string): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.searchGroupByID(groupID); this.store.searchGroup = imResponse.data.group; resolve(imResponse); } catch ...
/** * 通过 groupID 搜索群组 * Search group by group's ID * * @param {String} groupID 群组ID/group's ID * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L365-L376
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.handleGroupApplication
public handleGroupApplication(options: any): Promise<any> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.handleGroupApplication(options); resolve(imResponse); } catch (error) { reject(error); } ...
/** * 处理申请加群 * Handle group application * - 管理员/administrator * * @param {any} options 参数/options * @param {String} options.handleAction 处理结果 Agree(同意) / Reject(拒绝) * @param {String} options.handleMessage 附言/apply message * @param {Message} options.message 对应【群系统通知】的消息实例/the message correspondin...
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L389-L398
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.getFriendList
public async getFriendList(): Promise<void> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { const imResponse = await this.TUICore.tim.getFriendList(); this.currentStore.friendList = imResponse.data; this.currentStore.userIDList = this.currentStore.frien...
/** * 获取 SDK 缓存的好友列表 * Get friend list from SDK * * @param {Array<string>} userIDList 用户的账号列表/userID list * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L407-L418
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.getUserStatus
public async getUserStatus(userIDList: Array<string>): Promise<void> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { if (!userIDList.length) return; const imResponse = await this.TUICore.tim.getUserStatus({ userIDList }); imResponse?.data?.successUserLi...
/** * 获取 用户状态 * Get users’ status * * @param {Array<string>} userIDList 用户 userID 列表 / userID list * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L427-L449
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.subscribeUserStatus
public async subscribeUserStatus(userIDList: Array<string>): Promise<void> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { if (!userIDList.length) return; const imResponse = await this.TUICore.tim.subscribeUserStatus({ userIDList }); resolve(imResponse)...
/** * 订阅 用户状态 * Subscribe users' status * * @param {Array<string>} userIDList 用户 userID 列表 / userID list * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L458-L468
3d30910f185bdd2f72c14bff51d39fb2e774dd0a
workbench
github_2023
yhtt2020
typescript
TUIContactServer.unsubscribeUserStatus
public async unsubscribeUserStatus(userIDList?: Array<string>): Promise<void> { return this.handlePromiseCallback(async (resolve: any, reject: any) => { try { if (userIDList && !userIDList.length) return; const imResponse = await this.TUICore.tim.unsubscribeUserStatus({ userIDList }); ...
/** * 取消订阅 用户状态 * Unscribe users' status * * @param {Array<string>} userIDList 用户 userID 列表 / userID list * @returns {Promise} */
https://github.com/yhtt2020/workbench/blob/3d30910f185bdd2f72c14bff51d39fb2e774dd0a/vite/packages/table/TUIKit/TUIComponents/container/TUIContact/server.ts#L477-L488
3d30910f185bdd2f72c14bff51d39fb2e774dd0a