/** * #context_action.ts * * Code generated by ts-proto. DO NOT EDIT. * @packageDocumentation */ import type { RedditObject, SubredditObject } from "../../plugin/redditapi/common/common_msg.js"; import type { Effect } from "../../ui/effects/v1alpha/effect.js"; import type { ConfigForm } from "../user_configurable/user_configurable.js"; import type { ContextType } from "./context_type.js"; /** Which contexts an action should be applied to */ export type ContextActionAllowedContexts = { post: boolean; comment: boolean; subreddit: boolean; }; /** Restrict access to specific user groups */ export type ContextActionAllowedUsers = { /** Moderator only */ moderator: boolean; /** * Member of the subreddit where the Actor is installed * * @deprecated */ member: boolean; /** Logged out users can perform this action */ loggedOut: boolean; }; /** Filters for post actions */ export type ContextActionPostFilters = { /** If true, only display action for posts created by the app itself, otherwise for all posts */ currentApp?: boolean | undefined; }; /** Describes a single action provided by an Actor */ export type ContextActionDescription = { /** Dev-specified ID for this action to determine which one was called in OnAction */ actionId: string; /** User-facing name for this action (i.e.: text in the overflow menu) */ name: string; /** Short, user-facing secondary text to describe what this action is going to do */ description: string; /** Flags to determine in which contexts this action should be displayed */ contexts?: ContextActionAllowedContexts | undefined; /** Flags to determine what kind of user can see this action */ users?: ContextActionAllowedUsers | undefined; /** Optional field to request user input when the action is clicked */ userInput?: ConfigForm | undefined; /** Filters to apply to actions in post context */ postFilters?: ContextActionPostFilters | undefined; }; export type ContextActionList = { actions: ContextActionDescription[]; }; export type ContextActionRequest = { /** The action ID defined in ContextActionDescription */ actionId: string; /** Which context this request is coming from */ context: ContextType; /** TODO: Replace with Post/Comment/Subreddit types when it's safe */ post?: RedditObject | undefined; comment?: RedditObject | undefined; subreddit?: SubredditObject | undefined; /** If user_input is defined in ContextActionDescription, the result will be provided here */ userInput?: ConfigForm | undefined; }; export type ContextActionResponse = { /** * Whether or not the action was successful. * @deprecated Use effects instead */ success: boolean; /** * If set, display as a popup toast to the user * @deprecated Use effects instead */ message: string; effects: Effect[]; }; //# sourceMappingURL=context_action.d.ts.map