@devvit/public-api - v0.9.0
Table of contents
Namespaces
Enumerations
Classes
- ConfigFormBuilder
- ContextActionsBuilder
- Devvit
- KeyValueStorage
- Log
- NameLookup
- RichTextBuilder
- UserConfig
Type Aliases
- ActionOptions
- BaseContextAction
- BaseContextActionEvent
- CommentContextAction
- CommentContextActionEvent
- ContextAction
- ContextActionEvent
- Header
- MultiContextAction
- PostContextAction
- PostContextActionEvent
- SchedulerEvent
- SchedulerHandler
- SubredditContextAction
- SubredditContextActionEvent
Variables
Functions
Type Aliases
ActionOptions
Ƭ ActionOptions: Omit< ContextActionDescription, "contexts" | "users"> & Partial< ContextActionAllowedContexts> & Partial< ContextActionAllowedUsers>
BaseContextAction
Ƭ BaseContextAction: Object
Type declaration
| Name | Type |
|---|---|
description | string |
name | string |
userContext? | UserContext |
userInput? | ConfigForm |
BaseContextActionEvent
Ƭ BaseContextActionEvent: Object
Type declaration
| Name | Type |
|---|---|
userInput | ConfigForm | undefined |
CommentContextAction
Ƭ CommentContextAction: BaseContextAction & { context: COMMENT ; handler: (event: CommentContextActionEvent, metadata?: Metadata) => Promise< ContextActionResponse> }
CommentContextActionEvent
Ƭ CommentContextActionEvent: BaseContextActionEvent & { comment: RedditObject ; context: COMMENT }
ContextAction
Ƭ ContextAction: PostContextAction | CommentContextAction | SubredditContextAction
ContextActionEvent
Ƭ ContextActionEvent: PostContextActionEvent | CommentContextActionEvent | SubredditContextActionEvent
Header
Ƭ Header: typeof Header[keyof typeof Header]
MultiContextAction
Ƭ MultiContextAction: BaseContextAction & { context: Context[] ; handler: (event: ContextActionEvent, metadata?: Metadata) => Promise< ContextActionResponse> }
PostContextAction
Ƭ PostContextAction: BaseContextAction & { context: POST ; handler: (event: PostContextActionEvent, metadata?: Metadata) => Promise< ContextActionResponse> }
PostContextActionEvent
Ƭ PostContextActionEvent: BaseContextActionEvent & { context: POST ; post: RedditObject }
SchedulerEvent
Ƭ SchedulerEvent: Object
Type declaration
| Name | Type |
|---|---|
context | { subreddit: string ; user: string | undefined } |
context.subreddit | string |
context.user | string | undefined |
data | ScheduledAction["data"] |
SchedulerHandler
Ƭ SchedulerHandler: Object
Type declaration
| Name | Type |
|---|---|
handler | (event: SchedulerEvent, metadata?: Metadata) => Promise< void> |
type | string |
SubredditContextAction
Ƭ SubredditContextAction: BaseContextAction & { context: SUBREDDIT ; handler: (event: SubredditContextActionEvent, metadata?: Metadata) => Promise< ContextActionResponse> }
SubredditContextActionEvent
Ƭ SubredditContextActionEvent: BaseContextActionEvent & { context: SUBREDDIT ; subreddit: SubredditObject }
Variables
Header
• Const Header: Readonly< { Actor: "devvit-actor" ; App: "devvit-app" ; AppUser: "devvit-app-user" ; Caller: "devvit-caller" ; CallerPortID: "devvit-caller-port-id" ; Canary: "devvit-canary" ; Installation: "devvit-installation" ; ModPermissions: "devvit-mod-permissions" ; R2Auth: "devvit-sec-authorization" ; R2Host: "devvit-r2-host" ; RemoteHostname: "devvit-remote-hostname" ; StreamID: "devvit-stream-id" ; Subreddit: "devvit-subreddit" ; TraceID: "devvit-trace-id" ; User: "devvit-user" ; Version: "devvit-version" }>
Metadata header key. Every system header should start with "devvit-".
Synchronize to headers.md.
Functions
getFromMetadata
▸ getFromMetadata(key, metadata): string | undefined
Gets a value from metadata
Parameters
| Name | Type |
|---|---|
key | string |
metadata | undefined | Metadata |
Returns
string | undefined