@infogata/socialgata-plugin-typings
v0.3.0
Published
Typings for the SocialGata Plugin API
Downloads
11
Readme
socialgata-plugin-typings
Types for socialgata plugins.
Installation
npm i --save-dev @infogata/socialgata-plugin-typingsUsage
Configure tsconfig.json
{
"compilerOptions": {
"typeRoots": [
"./node_modules/@types",
"./node_modules/@infogata"
]
}
}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/timelineonGetCommunity(request: GetCommunityRequest)- Get posts from a specific communityonGetCommunities(request: GetCommunitiesRequest)- Get list of communitiesonSearch(request: SearchRequest)- Search for posts
Comment Methods
onGetComments(request: GetCommentsRequest)- Get comments for a postonGetCommentReplies(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
Trending Methods
onGetTrendingTopics(request?: GetTrendingTopicsRequest)- Get trending topics/hashtagsonGetTrendingTopicFeed(request: GetTrendingTopicFeedRequest)- Get posts for a trending topic
Authentication Methods
onLogin(request: LoginRequest)- Handle loginonLogout()- Handle logoutonIsLoggedIn()- Check login statusonPostLogin()- Called after successful loginonPostLogout()- Called after logout
UI Methods
onUiMessage(message: any)- Receive messages from UI framesonChangeTheme(theme: Theme)- Called when theme changesonGetPlatformType()- Return the platform type (forum, microblog, imageboard)
