@callstack/rspress-theme
Version:
Callstack theme for Rspress docs
212 lines (179 loc) • 5.25 kB
TypeScript
import { JSX } from 'react';
export declare function Announcement({ href, message, localStorageKey, display, }: AnnouncementProps): JSX.Element;
declare interface AnnouncementProps {
href: string;
message: string;
localStorageKey: string;
display?: boolean;
}
export declare function Badge({ children, type, text, outline, }: BadgeProps): JSX.Element;
declare interface BadgeProps {
/**
* The content to display inside the badge. Can be a string or React nodes.
*/
children?: React.ReactNode;
/**
* The type of badge, which determines its color and style.
* @default 'tip'
*/
type?: 'tip' | 'info' | 'warning' | 'danger' | 'note';
/**
* The text content to display inside the badge (for backwards compatibility).
*/
text?: string;
/**
* Whether to display the badge with an outline style.
* @default false
*/
outline?: boolean;
}
export declare function Button(props: ButtonProps): React_2.ReactNode;
declare interface ButtonProps {
type?: string;
theme?: 'brand' | 'alt';
href?: string;
external?: boolean;
className?: string;
children?: React_2.ReactNode;
dark?: boolean;
}
export declare function Card(props: CardProps): React_2.JSX.Element;
declare interface CardProps {
/**
* The title of the card.
*/
title: React_2.ReactNode;
/**
* The content to display inside the card.
*/
content?: React_2.ReactNode;
/**
* The style of the card.
*/
style?: React_2.CSSProperties;
}
declare interface Feature {
icon: string;
title: string;
details: string;
span?: number;
link?: string;
}
declare interface FrontMatterMeta {
title?: string;
description?: string;
overview?: boolean;
pageType?: PageType;
features?: Feature[];
hero?: Hero;
sidebar?: boolean;
outline?: boolean;
lineNumbers?: boolean;
overviewHeaders?: number[];
titleSuffix?: string;
head?: [string, Record<string, string>][];
context?: string;
footer?: boolean;
[key: string]: unknown;
}
declare interface Hero {
name: string;
text: string;
tagline: string;
image?: {
src: string | {
dark: string;
light: string;
};
alt: string;
/**
* `srcset` and `sizes` are attributes of `<img>` tag. Please refer to https://mdn.io/srcset for the usage.
* When the value is an array, rspress will join array members with commas.
**/
sizes?: string | string[];
srcset?: string | string[];
};
actions: {
text: string;
link: string;
theme: 'brand' | 'alt';
}[];
}
export declare function HomeBanner({ buttonText, description, headline, href, }: HomeBannerProps): JSX.Element;
declare interface HomeBannerProps {
buttonText?: string;
description?: string;
headline?: string;
href?: string;
}
export declare function HomeFeature({ frontmatter, }: {
frontmatter: FrontMatterMeta;
routePath: string;
}): JSX.Element;
export declare function HomeFooter(props: HomeFooterProps): JSX.Element;
declare interface HomeFooterProps {
LinkComponent?: React.ComponentType<{
href?: string;
children: React.ReactNode;
}>;
SocialLinksComponent?: React.ComponentType<{
socialLinks: SocialLink[];
}>;
}
export declare function HomeHero({ beforeHeroActions, afterHeroActions, frontmatter, }: HomeHeroProps): JSX.Element;
declare interface HomeHeroProps {
frontmatter: FrontMatterMeta;
routePath: string;
beforeHeroActions?: React.ReactNode;
afterHeroActions?: React.ReactNode;
}
export declare function LinkCard(props: LinkCardProps): React_2.JSX.Element;
declare interface LinkCardProps {
/**
* The URL of the link.
*/
href: string;
/**
* The title of the link.
*/
title: string;
/**
* The description of the link.
*/
description?: React_2.ReactNode;
/**
* The style of the link card.
*/
style?: React_2.CSSProperties;
}
export declare function OutlineCTA({ buttonText, description, headline, href, }: OutlineCTAProps): JSX.Element;
declare interface OutlineCTAProps {
buttonText?: string;
description?: string;
headline?: string;
href?: string;
}
declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
export declare function PrevNextPage(props: PrevNextPageProps): JSX.Element;
declare interface PrevNextPageProps {
type: 'prev' | 'next';
text: string;
href: string;
}
declare namespace React_2 {
export {
}
}
declare interface SocialLink {
href: string;
icon: React.ReactNode;
label: string;
}
export declare function SwitchAppearance({ onClick }: {
onClick?: () => void;
}): JSX.Element;
export declare function VersionBadge({ version }: VersionBadgeProps): JSX.Element | null;
declare interface VersionBadgeProps {
version?: string;
}
export { }