@infogata/socialgata-plugin-typings

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

Typings for the SocialGata Plugin API

原始使用文档
文档目录10 节
  1. Installation
  2. Usage
  3. Plugin Methods
  4. Feed Methods
  5. Comment Methods
  6. User Methods
  7. Instance Methods (Federated Platforms)
  8. Trending Methods
  9. Authentication Methods
  10. UI Methods

socialgata-plugin-typings

npm (scoped)

Types for socialgata plugins.

Installation

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

Usage

Configure tsconfig.json

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

or

Import in script

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

Plugin Methods

SocialGata plugins can implement the following callback methods:

Feed Methods

  • onGetFeed(request?: GetFeedRequest) - Get the main feed/timeline
  • onGetCommunity(request: GetCommunityRequest) - Get posts from a specific community
  • onGetCommunities(request: GetCommunitiesRequest) - Get list of communities
  • onSearch(request: SearchRequest) - Search for posts
  • onSearchCommunity(request: SearchCommunityRequest) - Search for posts within a single community

Comment Methods

  • onGetComments(request: GetCommentsRequest) - Get comments for a post
  • onGetCommentReplies(request: GetCommentRepliesRequest) - Get replies to a comment

User Methods

  • onGetUser(request: GetUserRequest) - Get a user's profile and posts

Instance Methods (Federated Platforms)

  • onGetInstances(request?: GetInstancesRequest) - Get available instances
  • onGetTrendingTopics(request?: GetTrendingTopicsRequest) - Get trending topics/hashtags
  • onGetTrendingTopicFeed(request: GetTrendingTopicFeedRequest) - Get posts for a trending topic

Authentication Methods

  • onLogin(request: LoginRequest) - Handle login
  • onLogout() - Handle logout
  • onIsLoggedIn() - Check login status
  • onPostLogin() - Called after successful login
  • onPostLogout() - Called after logout

UI Methods

  • onUiMessage(message: any) - Receive messages from UI frames
  • onChangeTheme(theme: Theme) - Called when theme changes
  • onGetPlatformType() - Return the platform type (forum, microblog, imageboard)

版本与发布记录

@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 和提交记录判断。