npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tcchatsdk

v0.0.4

Published

tcchatsdk

Downloads

4

Readme

chat-tool

chat-tool bridge

usage

import { sdk } from 'tcchatsdk'
sdk.getWorkInfo() // Promise<WorkInfo>

getWorkInfo(): Promise<WorkInfo>;
/**
 * 获取客户信息
 * @returns {Promise<CustomerInfo>}
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.getCustomerInfo().then(res => {
 *   console.log(res)
 * })
 * ```
 */
getCustomerInfo(): Promise<CustomerInfo>;
/**
 * 获取会话信息
 * @returns {Promise<ChatInfo>}
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.getChatInfo().then(res => {
 *   console.log(res)
 * })
 * ```
 */
getChatInfo(): Promise<ChatInfo>;
/**
 * 获取账号信息
 * @returns {Promise<AccountInfo>}
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.getAccountInfo().then(res => {
 *   console.log(res)
 * })
 * ```
 */
getAccountInfo(): Promise<AccountInfo>;
/**
 * 获取会话工具状态
 * @returns {Promise<{ isOnline: boolean }>}
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.getChatToolStatus().then(res => {
 *   console.log(res)
 * })
 * ```
 */
getChatToolStatus(): Promise<{
    isOnline: boolean;
}>;
/**
 * 发送文本消息
 * @param text 文本
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.sendText('hello world')
 * ```
 */
sendText(text: string): Promise<Record<string, unknown>>;
/**
 * 发送图片消息
 * @param options 图片信息
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.sendImage({
 *   fileName: '图片名称',
 *   picUrl: '图片地址'
 * })
 * ```
 */
sendImage(options: {
    fileName: string;
    picUrl: string;
}): Promise<Record<string, unknown>>;
/**
 * 发送链接消息
 * @param options 链接信息
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.sendLink({
 *   title: '链接标题',
 *   description: '链接描述',
 *   link: '链接地址',
 *   imageUrl: '链接图片地址'
 * })
 * ```
 */
sendLink(options: {
    title: string;
    description: string;
    link: string;
    imageUrl: string;
}): Promise<Record<string, unknown>>;
/**
 * 发送小程序消息
 * @param options 小程序数据
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.sendMiniProgram({
 *   title: '小程序标题',
 *   appId: '小程序appId',
 *   appName: '小程序名称',
 *   wxUsername: '小程序原始id',
 *   pagePath: '小程序页面路径',
 *   imageUrl: '小程序图片地址'
 * })
 * ```
 */
sendMiniProgram(options: {
    title: string;
    appId: string;
    appName: string;
    wxUsername: string;
    pagePath: string;
    imageUrl: string;
}): Promise<Record<string, unknown>>;
/**
 * 发送视频消息
 * @param options 视频数据
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.sendVideo({
 *   videoName: '视频名称',
 *   videoThumbImageUrl: '视频缩略图地址',
 *   videoUrl: '视频地址'
 * })
 * ```
 */
sendVideo(options: {
    videoName: string;
    videoThumbImageUrl: string;
    videoUrl: string;
}): Promise<Record<string, unknown>>;
/**
 * 插入图片
 * @param url 图片地址
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.insertImg('图片地址')
 * ```
 */
insertImg(url: string): Promise<Record<string, unknown>>;
/**
 * 插入视频
 * @param options 视频数据
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.insertVideo({
 *   url: '视频地址',
 *   videoUrl: '视频缩略图地址'
 * })
 * ```
 */
insertVideo(options: {
    url: string;
    videoUrl: string;
}): Promise<Record<string, unknown>>;
/**
 * 插入艾特消息
 * @param options 艾特消息数据
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.insertAt({
 *   label: '艾特消息',
 *   id: 123
 * })
 * ```
 */
insertAt(options: {
    label: string;
    id: number;
}): Promise<Record<string, unknown>>;
/**
 * 插入小程序
 * @param options 小程序数据
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.insertProgram({
 *   title: '小程序标题',
 *   appId: '小程序appId',
 *   appName: '小程序名称',
 *   wxUsername: '小程序原始id',
 *   pagePath: '小程序页面路径',
 *   imageUrl: '小程序图片地址'
 * })
 * ```
 */
insertProgram(options: {
    title: string;
    appId: string;
    appName: string;
    wxUsername: string;
    pagePath: string;
    imageUrl: string;
}): Promise<Record<string, unknown>>;
/**
 * 插入链接
 * @param options 链接数据
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.insertLink({
 *   title: '链接标题',
 *   description: '链接描述',
 *   link: '链接地址',
 *   imageUrl: '链接图片地址'
 * })
 * ```
 */
insertLink(options: {
    title: string;
    description: string;
    link: string;
    imageUrl: string;
}): Promise<Record<string, unknown>>;
/**
 * 插入文件链接
 * @param options 文件链接数据
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.insertFileLink({
 *   title: '文件链接标题',
 *   description: '文件链接描述',
 *   link: '文件链接地址'
 * })
 * ```
 */
insertFileLink(options: {
    title: string;
    description: string;
    link: string;
}): Promise<Record<string, unknown>>;
/**
 * 插入文本
 * @param text 文本
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.insertText('文本')
 * ```
 */
insertText(text: string): Promise<Record<string, unknown>>;
/**
 * 显示商品卡片
 * @param target 目标元素,用于定位商品卡片
 * @param speechId 商品id
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.showProductCard(123)
 * ```
 */
showProductSpeech(target: HTMLElement, speechId: string | number): void | Promise<Record<string, unknown>>;
/**
 * 打开新窗口
 * @param url 地址
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.openWindow('https://www.baidu.com')
 * ```
 */
openWindow(url: string): Promise<Record<string, unknown>>;
/**
 * 打开webview弹窗
 * @param url 地址
 * @returns
 * @memberof SDK
 * @example
 * ```ts
 * chatSdk.openWebView('https://www.baidu.com')
 * ```
 */
openWebView(url: string): Promise<Record<string, unknown>>;