This commit is contained in:
2026-04-25 16:36:34 +08:00
commit db90e7579b
1876 changed files with 189777 additions and 0 deletions

63
client/web/types/global.d.ts vendored Normal file
View File

@@ -0,0 +1,63 @@
/**
* Copy from `tailchat/client/shared/model/plugin.ts`
*/
interface PluginManifest {
/**
* 插件用于显示的名称
* @example 网页面板插件
*/
label: string;
/**
* 插件名, 插件唯一标识
* @example com.msgbyte.webview
*/
name: string;
/**
* 插件地址
*/
url: string;
/**
* 插件图标
* 推荐大小: 128x128
*/
icon?: string;
/**
* 插件版本号
* 遵循 semver 规则
*
* major.minor.patch
* @example 1.0.0
*/
version: string;
/**
* 插件维护者
*/
author: string;
/**
* 插件描述
*/
description: string;
/**
* 是否需要重启才能应用插件
*/
requireRestart: boolean;
/**
* 文档的链接
* 如果是markdown则解析, 如果是html则使用iframe
*/
documentUrl?: string;
}
declare interface Window {
tailchat?: {
installPlugin?: (manifest: PluginManifest) => Promise<void>;
};
}

5
client/web/types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
declare module '*.jpg';
declare module '*.svg';
declare module '*.png';
declare module '*.module.less';
declare module '@bbob/parser'; // Work around for com.msgbyte.bbcode. ts-jest looks like cannot load plugins-self typedefinition