@infogata/socialgata-plugin-typings

中文文档
0.20.0发布于 2026/11/01MITTypeScript零依赖构建来源已验证

SocialGata插件API的类型

中文使用文档
文档目录10 节
  1. 安装
  2. 使用
  3. 插件的方法
  4. 饲料的方法
  5. 注释的方法
  6. 用户的方法
  7. 实例方法(联邦平台)
  8. 趋势的方法
  9. 身份验证方法
  10. 用户界面的方法

socialgata-plugin-typings

npm (scoped)

类型 socialgata 插件。

安装

npm i --save-dev @infogata/socialgata-plugin-typings

使用

配置 tsconfig.json

{
  "compilerOptions": {
    "types": ["@infogata/socialgata-plugin-typings"]
  }
}

或者

脚本导入

import "@infogata/socialgata-plugin-typings";

插件的方法

SocialGata插件可以实现以下回调方法:

饲料的方法

  • onGetFeed(request?: GetFeedRequest) -获取主feed/时间轴
  • onGetCommunity(request: GetCommunityRequest) -从特定社区获取帖子
  • onGetCommunities(request: GetCommunitiesRequest) -获取社区列表
  • onSearch(request: SearchRequest) -搜寻职位
  • onSearchCommunity(request: SearchCommunityRequest) -搜索帖子在一个单一的社区

注释的方法

  • onGetComments(request: GetCommentsRequest) -获得帖子的评论
  • onGetCommentReplies(request: GetCommentRepliesRequest) -获取评论的回复

用户的方法

  • onGetUser(request: GetUserRequest) -获取用户的个人资料和帖子

实例方法(联邦平台)

  • onGetInstances(request?: GetInstancesRequest) -获取可用的实例
  • onGetTrendingTopics(request?: GetTrendingTopicsRequest) -获取热门话题/标签
  • onGetTrendingTopicFeed(request: GetTrendingTopicFeedRequest) -获取热门话题的帖子

身份验证方法

  • onLogin(request: LoginRequest) -处理登入
  • onLogout() -处理注销
  • onIsLoggedIn() -检查登录状态
  • onPostLogin() —登录成功后调用
  • onPostLogout() -登出后调用

用户界面的方法

  • onUiMessage(message: any) -接收来自UI帧的消息
  • onChangeTheme(theme: Theme) -当主题改变时调用
  • onGetPlatformType() -返回平台类型(论坛、微博、图板)

版本与发布记录

@infogata/socialgata-plugin-typings 共发布 20 个版本,首次发布于 2025/11/25;过去 12 个月发布了 20 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.20.0latest2026/11/012 天前
0.19.02026/11/012 天前
0.18.02026/10/277 天前
0.17.02026/09/071 个月前
0.16.02026/09/071 个月前
0.15.02026/08/252 个月前

关于 @infogata/socialgata-plugin-typings 的常见问题

@infogata/socialgata-plugin-typings 是什么?

SocialGata插件API的类型

如何安装 @infogata/socialgata-plugin-typings?

在项目目录运行 npm install @infogata/socialgata-plugin-typings,或使用 pnpm add / yarn add / bun add。

@infogata/socialgata-plugin-typings 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@infogata/socialgata-plugin-typings 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=12。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@infogata/socialgata-plugin-typings 可以商用吗?

@infogata/socialgata-plugin-typings 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@infogata/socialgata-plugin-typings 还在维护吗?

最新版本 0.20.0 发布于 2026/11/01(2 天前);至今共发布 20 个版本,其中过去 12 个月发布了 20 个;首次发布于 2025/11/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。