import { OptgroupProps } from './block-kit/composition/Optgroup'; import { OptionProps } from './block-kit/composition/Option'; import { ButtonProps } from './block-kit/elements/Button'; import { SelectProps } from './block-kit/elements/Select'; import { AutoFocusibleIntrinsicProps } from './block-kit/elements/utils'; import { TextareaProps } from './block-kit/input/Textarea'; import { DividerProps } from './block-kit/layout/Divider'; import { HeaderProps } from './block-kit/layout/Header'; import { ImageProps } from './block-kit/layout/Image'; import { InputProps } from './block-kit/layout/Input'; import { SectionProps } from './block-kit/layout/Section'; import { VideoProps } from './block-kit/layout/Video'; /** * The helper function to cast the output type from JSX element to `any`. Just * returns the passed value with no operations. * * This function is provided for TypeScript user and migrated user from * jsx-slack v1. * * @param element - JSX element * @return The passed JSX element with no-ops */ export declare function JSXSlack(element: JSXSlack.JSX.Element): any; export declare namespace JSXSlack { interface StringLike { toString: () => string; } /** A element allowed as a child. */ export type ChildElement = Node | string | StringLike | ChildElement[] | boolean | null | undefined; /** Elements allowed as children. */ export type ChildElements = ChildElement | ChildElement[]; /** Similar to `ChildElement`, but excluded string and string-like object. */ export type ChildNode = Node | ChildNode[] | boolean | null | undefined; /** Similar to `ChildElements`, but excluded string and string-like object. */ export type ChildNodes = ChildNode | ChildNode[]; type FilteredChild = Node | string | StringLike; type MapCallbackFn = (this: FilteredChild | null, child: FilteredChild | null, index: number) => T; export type PropsWithChildren

= { children?: ChildElements; } & P; export type FunctionComponent

= (props: P) => Node

| null; export type FC

= FunctionComponent

; export interface Node

{ /** * @internal * **⚠️ This is an internal member of jsx-slack. ⚠️** Not recommend to use. */ readonly $$jsxslack: { type: FC

| string; props: P; children: ChildElement[]; }; } /** * Verify the passed object is a jsx-slack element. * * @param element - An object to verify * @return `true` if the passed object was a jsx-slack element, otherwise * `false` */ export const isValidElement: (obj: unknown) => obj is JSX.Element; /** * Create and return a new jsx-slack element of the given type. * * The `type` argument can be either a component function, a tag name string * such as `'strong'` or `'em'`, and a fragment (`JSXSlack.Fragment`). * * **NOTE**: _You won't typically invoke this directly if you are using JSX._ * * @param type - A component function, fragment, or intrinsic HTML tag name * @param props - Property values to pass into the element for creation * @param children - Children elements of a new jsx-slack element * @return A new jsx-slack element */ export const createElement:

(type: FC

| keyof JSX.IntrinsicElements, props?: P | null, ...children: ChildElement[]) => JSX.Element | null; /** An alias into `JSXSlack.createElement`. */ export const h:

(type: FC

| keyof JSX.IntrinsicElements, props?: P | null, ...children: ChildElement[]) => JSX.Element | null; /** * Group a list of JSX elements. * * Typically the component for jsx-slack should return a single JSX element. * Wrapping multiple elements in `JSXSlack.Fragment` lets you return a list of * children. */ export const Fragment: import("./jsx-internals").BuiltInComponent<{ children: ChildElements; }>; /** * Provide utilities for dealing with the `props.children` opaque data * structure. */ export const Children: Readonly<{ /** * Return the total number of elements in `children`. * * It would be same as the number of times `JSXSlack.Children.map()` would * invoke the callback. * * @param children - The target element(s) to count * @return The total number of elements in the passed children */ count: (children: ChildElements) => number; /** * Like `JSXSlack.Children.map()`, but no return value. * * @param children - The target element(s) to traverse * @param callbackFn - Callback function */ forEach: (children: ChildElements, callbackFn: MapCallbackFn) => void; /** * Invoke callback function on every immediate child in `children`. * * The callback function allows up to 2 arguments compatible with * `Array.prototype.map()`, and `this` will be a traversed child. The * callback can return any value for transforming, or the nullish value for * to skip mapping. * * @remarks * When the passed `children` is `null` or `undefined`, this function * returns the passed value instead of an array as it is. * * If `JSXSlack.Fragment` was passed as `children`, it will be treated as _a * single child_. The callback won't invoke with every child of the * fragment. * * @param children - The target element(s) to traverse * @param callbackFn - Callback function * @return An array of the value returned by callback function, or nullish * value when passed `null` or `undefined`. */ map: (children: ChildElements, callbackFn: MapCallbackFn) => Exclude[] | null | undefined; /** * Verify whether `children` has an only one child of jsx-slack element and * return it. Otherwise, throw an error. * * @remarks * Even if passed a single jsx-slack element, this method may throw an error * when the component returned `null` or any primitive value such as string, * number, etc. * * @param children - The target element(s) * @return A single jsx-slack element if verified * @throws Will throw an error if `children` is not a single JSX element */ only: (children: ChildElements) => JSX.Element; /** * Return an array made flatten the `children` opaque data structure. * * Useful for manipulating or re-ordering collection of children passed to * the component. * * @remarks * If an array in the children could be a subset of JSON payload, such as a * returned array from the built-in component, it would not be flatten. * * @param children - The target element(s) * @return A flatten array consisted of JSX elements */ toArray: (children: ChildElements) => FilteredChild[]; }>; /** * Set the state of the exact mode, to enable or disable forcible styling in * rendered Slack mrkdwn. * * Some special characters to style text will work only in the break of words. * By turning the exact mode on, jsx-slack will insert zero-width space around * special chars generated by HTML-like elements (``, ``, ``, etc), * to enable styling forcibly. * * @remarks * __Exact mode is the last resort__, because zero-width space included text * may confuse a reader when editing the copied message. _You should consider * to deal with inserting whitespaces around the styled text manually instead * of turning on exact mode._ * * @param mode - A boolean value to indicate whether turning on exact mode * @return The current state of exact mode */ export const exactMode: (mode?: boolean) => boolean; export namespace JSX { export interface Element extends Node { } export interface IntrinsicElements { /** An HTML-compatible alias into `

` layout block. */ header: HeaderProps; /** An HTML-compatible alias into `` layout block. */ hr: DividerProps; /** * A HTML-compatible alias into `` layout block and block element. */ img: ImageProps; /** A HTML-compatible alias into `
` layout block. */ section: SectionProps; /** A HTML-compatible alias into `