import { type ReactNode, type Ref } from 'react';
import { type LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
import { type ActionName, type CardDisplay, type ElementName, type SmartLinkDirection, type SmartLinkSize } from '../../../../constants';
import { type ActionProps } from '../actions/action/types';
import type { AssignedToGroupElementProps } from '../elements/assigned-to-group-element';
import type { BaseAvatarGroupElementProps } from '../elements/common/base-avatar-group-element';
import type { CreatedOnProps } from '../elements/created-on-element';
import type { ModifiedOnProps } from '../elements/modified-on-element';
import type { OwnedByElementProps } from '../elements/owned-by-element';
import type { OwnedByGroupElementProps } from '../elements/owned-by-group-element';
import type { ProviderElementProps } from '../elements/provider-element';
export type BlockProps = {
    /**
     * Ref to block wrapper div.
     */
    blockRef?: Ref<HTMLDivElement>;
    /**
     * React children
     */
    children?: ReactNode | undefined;
    /**
     * For compiled css
     */
    className?: string;
    /**
     * The direction that the block should arrange its elements. Can be vertical
     * or horizontal. Default is horizontal.
     * @internal
     */
    direction?: SmartLinkDirection;
    /**
     * For image icons in the title, whether to hide the loading skeleton while the image is loading.
     */
    hideIconLoadingSkeleton?: boolean;
    /**
     * Function to be called on render of block.
     * @internal
     */
    onRender?: () => void;
    /**
     * Function to be called on transition end of block.
     * @internal
     */
    onTransitionEnd?: () => void;
    /**
     * A unique identifier for the placeholder loading state, which is constant across all loading states of the same item.
     */
    placeholderId?: string;
    /**
     * The size of the block and the size that the underlying elements should
     * default to.
     */
    size?: SmartLinkSize;
    /**
     * For dynamic styles
     */
    style?: React.CSSProperties;
    /**
     * A `testId` prop is provided for specified elements, which is a unique
     * string that appears as a data attribute `data-testid` in the rendered code,
     * serving as a hook for automated tests
     */
    testId?: string;
};
/**
 * Used to represent a metadata element to be rendered.
 */
export type ElementItem = {
    /**
     * The size of the element to display.
     */
    size?: SmartLinkSize;
    /**
     * A `testId` prop is provided for specified elements, which is a unique
     * string that appears as a data attribute `data-testid` in the rendered code,
     * serving as a hook for automated tests
     */
    testId?: string;
} & ElementItemProps;
/**
 * Used to represent an Action when passing props into Flexible UI.
 */
export type BaseActionItem = {
    /**
     * Determines the text content of the Action.
     */
    content?: React.ReactNode;
    /**
     * Determines whether the action should hide the text content of the button.
     */
    hideContent?: boolean;
    /**
     * Determines whether the action should hide the icon inside the button.
     */
    hideIcon?: boolean;
    /**
     * Determines where the icon should be rendered if text is provided.
     */
    iconPosition?: 'before' | 'after';
    /**
     * Determines whether the button displays as disabled.
     */
    isDisabled?: boolean;
    /**
     * Determines the text and icon representation of the action, with exception
     * to CustomAction.
     */
    name: ActionName;
    /**
     * Determines the onClick behaviour of the action.
     */
    onClick: () => any;
    /**
     * Determines the size of the Action. Corresponds to an Action appearance.
     */
    size?: SmartLinkSize;
    /**
     * A `testId` prop is provided for specified elements, which is a unique
     * string that appears as a data attribute `data-testid` in the rendered code,
     * serving as a hook for automated tests
     */
    testId?: string;
};
/**
 * Used to represent an Action which self-hydrates with data when passing props into Flexible UI.
 */
export type BaseDataActionItem = {
    /**
     * Used to show different icons for Rovo actions
     */
    cardAppearance?: CardDisplay;
    /**
     * Determines whether the action should hide the text content of the button.
     */
    hideContent?: boolean;
    /**
     * Determines whether the action should hide the icon inside the button.
     */
    hideIcon?: boolean;
    /**
     * Determines whether the button displays as disabled.
     */
    isDisabled?: boolean;
    /**
     * Determines the text and icon representation of the action, with exception
     * to CustomAction.
     */
    name: ActionName;
    /**
     * Determines the onClick behaviour of the action. This is optional because
     * the onClick functionality will be hydrated by the action by default.
     */
    onClick?: () => any;
    /**
     * Determines the size of the Action. Corresponds to an Action appearance.
     */
    size?: SmartLinkSize;
    /**
     * A `testId` prop is provided for specified elements, which is a unique
     * string that appears as a data attribute `data-testid` in the rendered code,
     * serving as a hook for automated tests
     */
    testId?: string;
};
/**
 * This represents an action that will render based on the data provided from the Smart Link.
 * Icon and Content are also provided implicitly.
 * @example PreviewAction - by default will contain a fullscreen icon with the 'Preview'
 * content if content and icon are not provided. This also will add a button that
 * renders a preview modal when clicked.
 */
export type NamedDataActionItem = BaseDataActionItem & {
    name: ActionName.FollowAction | ActionName.PreviewAction | ActionName.DownloadAction | ActionName.AutomationAction | ActionName.CopyLinkAction | ActionName.RovoChatAction;
} & Pick<ActionProps, 'iconSize'>;
/**
 * This represents an action that does not fetch data where Icon and Content are provided implicitly.
 * @example DeleteAction - by default will contain a cross icon with the
 * 'delete' content if content and icon are not provided.
 */
export type NamedActionItem = BaseActionItem & {
    name: ActionName.DeleteAction | ActionName.EditAction;
};
/**
 * This represents an action where either Icon or label must be provided.
 */
export type CustomActionItem = BaseActionItem & {
    ariaLabel?: string;
    href?: string;
    name: ActionName.CustomAction;
} & ((Required<Pick<ActionProps, 'icon' | 'iconPosition'>> & Pick<ActionProps, 'content'>) | ((Required<Pick<ActionProps, 'content'>> & Pick<ActionProps, 'icon' | 'iconPosition'>) & Pick<ActionProps, 'tooltipMessage'>));
export type ActionItem = (NamedActionItem | NamedDataActionItem | CustomActionItem) & {
    entryPointWrapper?: React.FC<{
        children: React.ReactNode;
    }>;
};
export type OnActionMenuOpenChangeOptions = {
    isOpen: boolean;
};
/**
 * A type that contains all the possible combinations of elements with their corresponding props.
 */
export type ElementItemProps = AssignedTo | AssignedToGroup | AttachmentCount | AuthorGroup | AppliedToComponentsCount | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | Location | ModifiedBy | ModifiedOn | OwnedBy | OwnedByGroup | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | ReadTime | SentOn | Snippet | SourceBranch | State | SubscriberCount | SubTasksProgress | StoryPoints | TargetBranch | Title | TeamMemberCount | ViewCount | VoteCount | UserAttributes | HostName;
/**
 * Represents the props available for an AttachmentCount element.
 * @see AttachmentCount
 */
export type AttachmentCount = {
    name: ElementName.AttachmentCount;
};
/**
 * Represents the props available for an AppliedToComponentsCount element.
 * @see AppliedToComponentsCount
 */
export type AppliedToComponentsCount = {
    name: ElementName.AppliedToComponentsCount;
};
/**
 * Represents the props available for an AuthorGroup element.
 * @see AuthorGroup
 */
export type AuthorGroup = {
    name: ElementName.AuthorGroup;
} & Pick<BaseAvatarGroupElementProps, 'showNamePrefix'>;
/**
 * Represents the props available for an OwnedByGroup element.
 * @see AuthorGroup
 */
export type OwnedByGroup = {
    name: ElementName.OwnedByGroup;
} & Pick<OwnedByGroupElementProps, 'showNamePrefix'>;
/**
 * Represents the props available for an AssignedToGroup element.
 * @see AuthorGroup
 */
export type AssignedToGroup = {
    name: ElementName.AssignedToGroup;
} & Pick<AssignedToGroupElementProps, 'showFallbackAvatar' | 'showNamePrefix'>;
/**
 * Represents the props available for an ChecklistProgress element.
 * @see ChecklistProgress
 */
export type ChecklistProgress = {
    name: ElementName.ChecklistProgress;
};
/**
 * Represents the props available for an CollaboratorGroup element.
 * @see CollaboratorGroup
 */
export type CollaboratorGroup = {
    name: ElementName.CollaboratorGroup;
};
/**
 * Represents the props available for an CommentCount element.
 * @see CommentCount
 */
export type CommentCount = {
    name: ElementName.CommentCount;
};
/**
 * Represents the props available for an AssignedTo element.
 * @see AssignedTo
 */
export type AssignedTo = {
    name: ElementName.AssignedTo;
};
/**
 * Represents the props available for an CreatedBy element.
 * @see CreatedBy
 */
export type CreatedBy = {
    name: ElementName.CreatedBy;
};
/**
 * Represents the props available for an OwnedBy element.
 * @see OwnedBy
 */
export type OwnedBy = {
    name: ElementName.OwnedBy;
} & Pick<OwnedByElementProps, 'fontSize' | 'hideFormat' | 'textPrefix'>;
/**
 * Represents the props available for an CreatedOn element.
 * @see CreatedOn
 */
export type CreatedOn = {
    name: ElementName.CreatedOn;
} & Pick<CreatedOnProps, 'text'>;
/**
 * Represents the props available for an DueOn element.
 * @see CreatedOn
 */
export type DueOn = {
    name: ElementName.DueOn;
};
/**
 * Represents the props available for an LastCommit element.
 * @see BadgeProps
 */
export type LatestCommit = {
    name: ElementName.LatestCommit;
};
/**
 * Represents the props available for an LinkIcon element.
 * @see LinkIcon
 */
export type LinkIcon = {
    name: ElementName.LinkIcon;
};
/**
 * Represents the props for the Location element.
 */
export type Location = {
    name: ElementName.Location;
};
/**
 * Represents the props available for an ModifiedBy element.
 * @see ModifiedBy
 */
export type ModifiedBy = {
    name: ElementName.ModifiedBy;
};
/**
 * Represents the props available for an ModifiedOn element.
 * @see ModifiedOn
 */
export type ModifiedOn = {
    name: ElementName.ModifiedOn;
} & Pick<ModifiedOnProps, 'fontSize' | 'text' | 'timeZone'>;
/**
 * Represents the props available for an Preview element.
 * @see Preview
 */
export type Preview = {
    name: ElementName.Preview;
};
/**
 * Represents the props available for an Priority element.
 * @see Priority
 */
export type Priority = {
    name: ElementName.Priority;
};
/**
 * Represents the props available for an ProgrammingLanguage element.
 * @see ProgrammingLanguage
 */
export type ProgrammingLanguage = {
    name: ElementName.ProgrammingLanguage;
};
/**
 * Represents the props available for a Provider element.
 * @see Provider
 */
export type Provider = {
    name: ElementName.Provider;
} & Pick<ProviderElementProps, 'hideIcon'>;
/**
 * Represents the props available for an ReactCount element.
 * @see ReactCount
 */
export type ReactCount = {
    name: ElementName.ReactCount;
};
/**
 * Represents the props available for a ReadTime element.
 */
export type ReadTime = {
    name: ElementName.ReadTime;
};
/**
 * Represents the props available for an SentOn element.
 * @see SentOn
 */
export type SentOn = {
    name: ElementName.SentOn;
};
/**
 * Represents the props available for an Snippet element.
 * @see Snippet
 */
export type Snippet = {
    name: ElementName.Snippet;
};
/**
 * Represents the props available for an SourceBranch element.
 * @see SourceBranch
 */
export type SourceBranch = {
    name: ElementName.SourceBranch;
};
/**
 * Represents the props available for an State element.
 * @see State
 */
export type State = {
    name: ElementName.State;
    onAfterChanged?: () => void;
} & Pick<AtlaskitLozengeProps, 'maxWidth'>;
/**
 * Represents the props available for a SubscriberCount element.
 * @see SubscriberCount
 */
export type SubscriberCount = {
    name: ElementName.SubscriberCount;
};
/**
 * Represents the props available for a TeamMemberCount element.
 * @see TeamMemberCount
 */
export type TeamMemberCount = {
    name: ElementName.TeamMemberCount;
};
/**
 * Represents the props available for a SubtasksProgress element.
 */
export type SubTasksProgress = {
    name: ElementName.SubTasksProgress;
};
/**
 * Represents the props available for a StoryPoints element.
 */
export type StoryPoints = {
    name: ElementName.StoryPoints;
};
/**
 * Represents the props available for an TargetBranch element.
 * @see TargetBranch
 */
export type TargetBranch = {
    name: ElementName.TargetBranch;
};
/**
 * Represents the props available for an Title element.
 * @see Title
 */
export type Title = {
    name: ElementName.Title;
};
/**
 * Represents the props available for an ViewCount element.
 * @see ViewCount
 */
export type ViewCount = {
    name: ElementName.ViewCount;
};
/**
 * Represents the props available for an VoteCount element.
 * @see VoteCount
 */
export type VoteCount = {
    name: ElementName.VoteCount;
};
/**
 * Represents the props available for an UserAttributes element.
 * @see UserAttributes
 */
export type UserAttributes = {
    name: ElementName.UserAttributes;
};
/**
 * Represents the props available for an HostName element.
 * @see HostName
 */
export type HostName = {
    name: ElementName.HostName;
};
