import { SvelteComponent } from "svelte"; /** * A button to subscribe or unsubscribe a user to your Slack channel. * * Registers or removes the user’s Slack token using the provided Slack App ID. * Supports custom labels, styling, and redirect flow. */ type Props = { /** * The Slack App ID used to initiate the installation flow. */ appId: string; /** * Optional URL to redirect the user to after completing the Slack OAuth flow. * Defaults to the current origin. * @default location.href */ redirectUrl?: string; /** * Called when the button is clicked. Return `false` to prevent the install flow. * @type {(event: Event) => void | false} */ onClick?: (event: any) => void | false; /** * Custom render function for the button label. Receives the current install status * and any error message. * * @default * ({ status }) => status === 'success' ? 'discard' : 'enable' * @example * ({ status, error }) => status === 'error' ? 'Retry' : 'Connect to Slack' */ renderLabel?: (props: { status: Status; error: string | null; }) => any; /** * Label to show when the button is idle. * Optional alternative to renderLabel. * @internal */ idleLabel?: string; /** * Label to show while the current status is being fetched. * Optional alternative to renderLabel. * @internal */ loadingLabel?: string; /** * Label to show when the user is subscribed to this channel. * Optional alternative to renderLabel. * @internal */ successLabel?: string; /** * Static label to show when an error occurred. * Optional alternative to renderLabel. * @internal */ errorLabel?: string; /** * Additional class names to apply to the button. */ className?: string; /** * When true, omit the default base class to fully control styling. */ unstyled?: boolean; /** * Ref to the underlying button element. * @internal */ buttonRef?: any; }; import type { Status } from "./internal/components/internal/map-state"; declare const __propDef: { props: { unstyled?: Props["unstyled"]; className?: Props["className"]; appId: Props["appId"]; redirectUrl?: Props["redirectUrl"]; renderLabel?: Props["renderLabel"]; idleLabel?: Props["idleLabel"]; loadingLabel?: Props["loadingLabel"]; successLabel?: Props["successLabel"]; errorLabel?: Props["errorLabel"]; buttonRef?: Props["buttonRef"]; }; events: { [evt: string]: CustomEvent; }; slots: {}; exports?: {} | undefined; bindings?: string | undefined; }; export type SlackButtonProps = typeof __propDef.props; export type SlackButtonEvents = typeof __propDef.events; export type SlackButtonSlots = typeof __propDef.slots; export default class SlackButton extends SvelteComponent { } export {};