/* ============================================================================ * Copyright (c) Palo Alto Networks * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * ========================================================================== */ /// declare module "@docusaurus/theme-common/internal" { import { CSSProperties, ReactNode, RefObject } from "react"; import type { PropDocContent } from "@docusaurus/plugin-content-docs"; import { MagicCommentConfig } from "@docusaurus/theme-common/lib/utils/codeBlockUtils"; import { TabsProps as ITabsProps, TabValue, } from "@docusaurus/theme-common/lib/utils/tabsUtils"; import { Props as ICodeBlockProps } from "@theme/CodeBlock"; import { Props as ICopyButtonProps } from "@theme/CodeBlock/CopyButton"; import { Props as ILineProps } from "@theme/CodeBlock/Line"; import { PrismTheme } from "prism-react-renderer"; export interface TabItemProps { readonly children: ReactNode; readonly value: string; readonly default?: boolean; readonly label?: string; readonly className?: string; readonly attributes?: { [key: string]: unknown }; } export interface TabProps extends ITabsProps { length?: number; } export interface CopyButtonProps extends ICopyButtonProps {} export interface LineProps extends ILineProps {} export interface CodeBlockProps extends ICodeBlockProps {} export function usePrismTheme(): PrismTheme; export function sanitizeTabsChildren(children: TabProps["children"]); export function getPrismCssVariables(prismTheme: PrismTheme): CSSProperties; export function parseCodeBlockTitle(metastring?: string): string; export function parseLanguage(className: string): string | undefined; export function containsLineNumbers(metastring?: string): boolean; export function useScrollPositionBlocker(): { blockElementScrollPositionUntilNextRender: (el: HTMLElement) => void; }; export function DocProvider({ children, content, }: { children: ReactNode; content: PropDocContent; }); export function useTabsContextValue(props: TabProps): { selectedValue: string; selectValue: (value: string) => void; tabValues: readonly TabValue[]; lazy: boolean; block: boolean; }; export function useTabs(): { selectedValue: string; selectValue: (value: string) => void; tabValues: readonly TabValue[]; lazy: boolean; block: boolean; }; export function TabsProvider(props: { children: ReactNode; value: ReturnType; }): ReactNode; export function parseLines( content: string, options: { metastring: string | undefined; language: string | undefined; magicComments: MagicCommentConfig[]; } ): { lineClassNames: { [lineIndex: number]: string[] }; code: string; }; export function useCodeWordWrap(): { readonly codeBlockRef: RefObject; readonly isEnabled: boolean; readonly isCodeScrollable: boolean; readonly toggle: () => void; }; }