-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy paththeme-classic.d.ts
More file actions
104 lines (85 loc) · 3.12 KB
/
theme-classic.d.ts
File metadata and controls
104 lines (85 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* ============================================================================
* 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.
* ========================================================================== */
/// <reference types="@docusaurus/theme-classic" />
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<typeof useTabsContextValue>;
}): 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<HTMLPreElement>;
readonly isEnabled: boolean;
readonly isCodeScrollable: boolean;
readonly toggle: () => void;
};
}