import * as React from 'react'; import { MarkdownItPluginCb } from '@diplodoc/transform/lib/plugins/typings'; import { AnalyticsEventsProp, HeaderBlockProps as PageConstructorHeaderBlockProps } from '@gravity-ui/page-constructor'; import { SelectOption, SelectProps } from '@gravity-ui/uikit'; import { IBrowser, IDevice } from 'ua-parser-js'; import { Locale } from "./locale.js"; export declare enum Theme { Light = "light", Dark = "dark" } export interface ClassNameProps { className?: string; } export type Author = { id: number | string; avatar: string | null; createdAt: string; updatedAt: string; firstName: string | null; secondName: string | null; description: string | null; fullDescription: string | null; shortDescription: string | null; } & { [x: string]: string | null; }; export type Query = Record; export interface Menu { title: string; } export interface WithDeviceProps { device: IDevice; browser: IBrowser; isRobot: boolean; } export interface PostsProps { posts: PostData[]; count: number; totalCount: number; pinnedPost?: PostData; } export type Tag = { slug: string; name: string; createdAt?: string; updatedAt?: string; icon?: string; isDeleted?: boolean; locale?: string; blogTagId?: number | string; count?: number; }; export interface PostData { author?: string; authors?: Author[]; blogPostId?: number | string; content?: string; date: string; description?: string; hasUserLike: boolean; htmlTitle: string; id: number; image: string; isPublished?: boolean; sharedImage?: string; likes: number; locale: Locale; metaDescription?: string | null; metaTitle?: string | null; readingTime?: number; shareDescription?: string; shareImage?: string; shareTitle?: string; slug: string; keywords?: string[]; tags: Tag[]; textTitle: string; title: string; url: string; noIndex?: boolean; } export declare enum BlockType { Header = "blog-header-block", YFM = "blog-yfm-block", Layout = "blog-layout-block", Media = "blog-media-block", Banner = "blog-banner-block", CTA = "blog-cta-block", ColoredText = "blog-colored-text-block", Author = "blog-author-block", Suggest = "blog-suggest-block", Meta = "blog-meta-block", Feed = "blog-feed-block", Form = "blog-form-block", CompactMedia = "blog-compact-media-block", Take = "blog-take-block", SideCardList = "blog-side-card-list-block" } export type MetaProps = { metaComponent: JSX.Element; needHelmetWrapper: boolean; }; export type MetaOrganizationType = { url: string; appTitle: string; legalName: string; supportEmail: string; }; export interface PostMetaProps { title: string; date: string; image: string; canonicalUrl: string; content?: string; description?: string; sharing: { shareTitle: string; shareDescription: string; shareImage: string; shareGenImage: string; shareGenTitle: string; }; keywords?: string[]; noIndex?: boolean; authors?: Author[]; tags?: Tag[]; organization: MetaOrganizationType; } export type ToggleLikeCallbackType = ({ postId, hasLike, }: { postId?: number | string; hasLike?: boolean; }) => void; export interface HeaderBlockProps extends PageConstructorHeaderBlockProps { backLink?: { url: string; title: React.ReactNode; }; } export type GetPostsRequest = { page: number; perPage: number; savedOnly: boolean; search: string | undefined; [filterParam: string]: string | number | boolean | undefined; }; export type GetPostsType = (query: GetPostsRequest) => Promise; export type HandleChangeQueryParams = (params: Query) => void; export declare enum DefaultEventNames { ShareButton = "share-button-click", SaveButton = "save-button-click", ShowMore = "show-more-button-click", PaginatorHome = "paginator-home-button-click", PaginatorNext = "paginator-next-button-click", PaginatorPage = "paginator-page-button-click", Tag = "selector-tag-click", Service = "selector-service-click", SaveOnly = "save-only-button-click" } export type FetchArgs = { page?: number; query: Query; }; export interface QAProps { qa?: string; } type FilterConfigBase = { /** The key used in queryParams and passed to handleLoadData query */ queryParamName: string; /** Optional analytics events fired when this control's value changes */ analyticsEvents?: AnalyticsEventsProp; }; export type SelectFilterConfig = FilterConfigBase & Pick & { type?: 'select'; /** The selectable items for this filter */ options: SelectOption[]; /** Label shown when nothing is selected (acts as "All ..." placeholder) */ allLabel: string; /** Optional QA attribute forwarded to the switcher */ qa?: string; }; export type SearchFilterConfig = FilterConfigBase & { type: 'search'; /** Placeholder text for the search input */ placeholder?: string; }; export type SavedOnlyFilterConfig = FilterConfigBase & { type: 'savedOnly'; }; export type FilterConfig = SelectFilterConfig | SearchFilterConfig | SavedOnlyFilterConfig; /** * Filters can be supplied either as a flat array (all filters in one row) * or as an array of rows (each inner array is rendered as a separate row). * * @example Single row (backward-compatible) * filters: [searchFilter, tagsFilter] * * @example Multiple rows * filters: [[searchFilter, savedOnlyFilter], [tagsFilter, serviceFilter]] */ export type FiltersConfig = FilterConfig[] | FilterConfig[][]; export declare function normalizeFiltersToRows(filters: FiltersConfig): FilterConfig[][]; export declare enum PostCardSize { SMALL = "s", MEDIUM = "m" } export declare enum PostCardTitleHeadingLevel { H2 = "h2", H3 = "h3" } export interface TransformPostOptions { plugins?: MarkdownItPluginCb[]; } export {};