import { ResponsiveImageType } from '../general';
import { CustomIconType } from '../text';
import { MemberProps } from '../user';
export type CardContentType = 'customCard' | 'event' | 'learningHub' | 'listPage' | 'microcourse' | 'people' | 'qaQuestion' | 'solutionArticle' | 'communityPage';
export interface CardCTAType {
    /** The text to show on the CTA button - different content types have different fallbacks */
    text?: string;
    /** A callback to run when the user clicks on the CTA button */
    onClick?: (card: CardType) => Promise<string>;
}
export interface CardType {
    /** The `sys` set-up from Contentful */
    sys?: {
        /** The ID of the card */
        id?: string;
    };
    /** The Contentful content model type */
    contentType?: CardContentType;
    /** The URL the card should point to */
    slug?: string | null;
    /** Whether the card should open in a new tab */
    openInNewTab?: boolean;
    /** The image to use */
    banner?: ResponsiveImageType;
    /** Details of contributors, such as speakers or authors */
    contributors?: MemberProps[];
    /** Details of partners - this is similar to `contributors`, but won't show profile pictures */
    partner?: string[];
    /** The title of the card */
    title?: string;
    /** The primary text */
    text?: string;
    /** The secondary text */
    secondaryText?: string;
    /** The date the card was created */
    createdAt?: string;
    /** Article cards */
    /** The date the article was published */
    publishedDate?: string;
    /** The estimated reading time */
    readingTime?: string;
    /** Custom cards */
    /** The icon to use */
    customIcon?: CustomIconType;
    /** The label to use */
    customLabel?: string;
    /** The link text to use */
    customLinkText?: string;
    /** Event cards */
    /** The date the event starts */
    startDate?: string;
    /** Whether the event is ongoing */
    isOngoingEvent?: boolean;
    /** Whether the event has passed */
    dateHasPassed?: boolean;
    /** The pill text to show */
    pill?: 'premium' | 'free';
    /** Whether the user has registered for the event/course */
    registered?: boolean;
    /** People cards */
    /** The user's profile picture */
    profile?: string;
    /** The number of answers */
    answers?: number;
    /** Community cards */
    members?: {
        memberType: string;
        isMember: boolean;
        count: number;
    };
    /** Is the content private  */
    isPrivate?: boolean;
}
export interface MockCardType extends CardType {
    cardType?: string;
}
export type BuildCardDataType = (card: CardType | MockCardType, isLoggedIn?: boolean) => Promise<any>;
export type BuildMemberDataType = (communitySlug: string, isLoggedIn?: boolean) => Promise<unknown>;
export interface CardProps {
    /** A unique key for the card, used as a dependency in `useEffect` */
    id?: string;
    /** The card data, from Contentful */
    card: CardType;
    /** A function to parse and build the card data - this is especially needed in carousels to hydrate the cards */
    buildCardData: BuildCardDataType;
    /** A function to parse and build the member data */
    buildMemberData?: BuildMemberDataType;
    /** An optional call to action to show on the card - this can behave differently to clicking elsewhere on the card */
    cta?: CardCTAType;
    /** Context for the Google Tag Manager event */
    gtmContext?: string;
    /** Additional classes */
    className?: string;
    /** A callback to run when the user clicks on the card CTA */
    handleCardClick?: (card: CardType) => Promise<string>;
    /** Metadata about the card */
    meta?: {
        /** If the browser should be able to reach the card, e.g. for out of view cards in carousels */
        isTabbable?: boolean;
        /** If the browser should focus on this card */
        setFocus?: boolean;
    };
}
export interface CarouselTitleProps {
    /** The title text */
    text?: string;
    /** The element for the title */
    element?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
    /** The styling of the title */
    variant?: 'default' | 'highlighted';
    /** The size of the title */
    size?: 'medium' | 'large';
    /** The `href` to point the 'view all' link to; it won't show unless this is defined */
    link?: string;
    /** Whether the title should be hidden */
    hidden?: boolean;
}
export interface BaseCarouselProps {
    /** A function to parse and build the card data - this is especially needed in carousels to hydrate the cards */
    buildCardData: BuildCardDataType;
    /** An optional title to show above the carousels */
    title?: CarouselTitleProps;
    /** Context for the Google Tag Manager event */
    gtmContext?: string;
    /** Additional classes to add to the card block */
    className?: string;
}
export interface CarouselDataProps {
    /** The title for the carousel */
    title?: string;
    /** The `href` to point the 'view all' link to; it won't show unless this is defined */
    viewAllUrl?: string;
    /** A non-user-facing description of the carousel */
    internalDescription?: string;
    /** The card data, from Contentful */
    cards: CardType[];
    /** The types for each card, from Contentful */
    cardsTypes: CardContentType[];
    /** The type of data */
    contentType?: 'carousel';
}
export interface CarouselProps extends BaseCarouselProps {
    /** The data for each carousel to display in the section */
    carousels?: CarouselDataProps[];
    /** If the content is still loading - this is controlled externally */
    isLoading?: boolean;
}
export interface IndividualCarouselProps extends BaseCarouselProps {
    /** The unique identifier for the carousel */
    id?: string;
    /** The card data, from Contentful */
    cards: CardType[];
    /** The types for each card, from Contentful */
    cardTypes: CardContentType[];
}
export interface NarrowCardType {
    /** The image to use */
    banner?: ResponsiveImageType;
    /** The title of the narrow card */
    title?: string;
    /** The primary text */
    text?: string;
    /** The URL the card should point to */
    slug?: string | null;
    /** Is the content private  */
    isPrivate?: boolean;
}
export interface NarrowCardProps {
    /** The element that will render around the content */
    element?: 'li' | 'div';
    /** The card data, from Contentful */
    card: NarrowCardType;
    /** Additional classes */
    className?: string;
    /** Context for the Google Tag Manager event */
    gtmContext?: string;
}
