import { type ReactNode } from 'react'; import type { CardProviderRenderers } from '@atlaskit/link-provider/types'; import type { CardState } from '@atlaskit/linking-common/store'; import { type InvokeHandler } from '../../model/invoke-handler'; import type { InternalCardActionOptions as CardActionOptions, CardPlatform, EmbedIframeUrlType, OnResolveCallback } from '../Card/types'; import { type OnErrorCallback } from '../types'; export type EmbedCardProps = { actionOptions?: CardActionOptions; cardState: CardState; CompetitorPrompt?: React.ComponentType<{ linkType?: string; sourceUrl: string; }>; frameStyle?: FrameStyle; handleAuthorize: (() => void) | undefined; handleErrorRetry: () => void; /** Optional middle-click handler. */ handleFrameAuxClick?: React.EventHandler; handleFrameClick: React.EventHandler; /** Optional right-click handler. */ handleFrameContextMenu?: React.EventHandler; handleInvoke: InvokeHandler; hideIconLoadingSkeleton?: boolean; id?: string; iframeUrlType?: EmbedIframeUrlType; inheritDimensions?: boolean; isSelected?: boolean; onError?: OnErrorCallback; onIframeDwell?: (dwellTime: number, dwellPercentVisible: number) => void; onIframeFocus?: () => void; onIframeMouseEnter?: () => void; onIframeMouseLeave?: () => void; onResolve?: OnResolveCallback; platform?: CardPlatform; renderers?: CardProviderRenderers; testId?: string; url: string; }; export interface WithShowControlMethodProp { showControls?: () => void; } export interface ContextViewModel { /** Entity-type icon for the resource (e.g. a Google Doc, Google Sheets). */ icon?: ReactNode; iconLabel?: string; /** Provider/generator icon (e.g. Google Drive). */ providerIcon?: ReactNode; providerIconLabel?: string; image?: string; text: string; } export type AccessTypes = 'REQUEST_ACCESS' | 'PENDING_REQUEST_EXISTS' | 'FORBIDDEN' | 'DIRECT_ACCESS' | 'DENIED_REQUEST_EXISTS' | 'APPROVED_REQUEST_EXISTS' | 'ACCESS_EXISTS'; export interface AccessContext { accessType?: AccessTypes; cloudId?: string; smartLinksAccessMetadataExperimentCohort?: 'experiment' | 'control' | 'not-enrolled'; url?: string; } export type InlinePreloaderStyle = 'on-left-with-skeleton' | 'on-right-without-skeleton'; export type FrameStyle = 'show' | 'hide' | 'showOnHover';