@mantine-vue/code-highlight 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/cjs/index.cjs +511 -576
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +511 -576
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/CodeHighlight/CodeHighlight.d.ts +46 -496
  6. package/lib/CodeHighlight/CodeHighlight.types.d.ts +80 -0
  7. package/lib/CodeHighlight/CodeHighlight.vue.d.ts +17 -0
  8. package/lib/CodeHighlight/CodeHighlightControl/CodeHighlightControl.d.ts +2 -68
  9. package/lib/CodeHighlight/CodeHighlightControl/CodeHighlightControl.types.d.ts +20 -0
  10. package/lib/CodeHighlight/CodeHighlightControl/CodeHighlightControl.vue.d.ts +15 -0
  11. package/lib/CodeHighlight/CopyCodeButton/CopyCodeButton.d.ts +1 -32
  12. package/lib/CodeHighlight/CopyCodeButton/CopyCodeButton.vue.d.ts +8 -0
  13. package/lib/CodeHighlight/CopyCodeButton/CopyIcon.d.ts +1 -13
  14. package/lib/CodeHighlight/CopyCodeButton/CopyIcon.vue.d.ts +6 -0
  15. package/lib/CodeHighlight/ExpandCodeButton/ExpandCodeButton.d.ts +1 -41
  16. package/lib/CodeHighlight/ExpandCodeButton/ExpandCodeButton.vue.d.ts +15 -0
  17. package/lib/CodeHighlight/ExpandCodeButton/ExpandIcon.d.ts +1 -13
  18. package/lib/CodeHighlight/ExpandCodeButton/ExpandIcon.vue.d.ts +6 -0
  19. package/lib/CodeHighlight/InlineCodeHighlight.d.ts +16 -107
  20. package/lib/CodeHighlight/InlineCodeHighlight.types.d.ts +30 -0
  21. package/lib/CodeHighlight/InlineCodeHighlight.vue.d.ts +5 -0
  22. package/lib/CodeHighlightProvider/CodeHighlightAdapterProvider.vue.d.ts +14 -0
  23. package/lib/CodeHighlightProvider/CodeHighlightProvider.d.ts +19 -32
  24. package/lib/CodeHighlightProvider/CodeHighlightProvider.types.d.ts +25 -0
  25. package/lib/CodeHighlightTabs/CodeHighlightTabs.d.ts +43 -262
  26. package/lib/CodeHighlightTabs/CodeHighlightTabs.types.d.ts +47 -0
  27. package/lib/CodeHighlightTabs/CodeHighlightTabs.vue.d.ts +21 -0
  28. package/lib/CodeHighlightTabs/FileIcon.d.ts +1 -40
  29. package/lib/CodeHighlightTabs/FileIcon.vue.d.ts +21 -0
  30. package/lib/index.d.mts +3 -3
  31. package/lib/index.d.ts +3 -3
  32. package/package.json +3 -3
@@ -1,68 +1,2 @@
1
- import { type PropType } from 'vue';
2
- export interface CodeHighlightControlProps {
3
- tooltipLabel?: string;
4
- classNames?: any;
5
- styles?: any;
6
- vars?: any;
7
- [key: string]: any;
8
- }
9
- export declare const CodeHighlightControl: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
- tooltipLabel: {
11
- type: StringConstructor;
12
- default: undefined;
13
- };
14
- classNames: {
15
- type: (ObjectConstructor | FunctionConstructor)[];
16
- default: undefined;
17
- };
18
- styles: {
19
- type: (ObjectConstructor | FunctionConstructor)[];
20
- default: undefined;
21
- };
22
- vars: {
23
- type: (ObjectConstructor | FunctionConstructor)[];
24
- default: undefined;
25
- };
26
- component: {
27
- type: StringConstructor;
28
- default: string;
29
- };
30
- onClick: {
31
- type: PropType<(event: MouseEvent) => void>;
32
- default: undefined;
33
- };
34
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
35
- [key: string]: any;
36
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
37
- tooltipLabel: {
38
- type: StringConstructor;
39
- default: undefined;
40
- };
41
- classNames: {
42
- type: (ObjectConstructor | FunctionConstructor)[];
43
- default: undefined;
44
- };
45
- styles: {
46
- type: (ObjectConstructor | FunctionConstructor)[];
47
- default: undefined;
48
- };
49
- vars: {
50
- type: (ObjectConstructor | FunctionConstructor)[];
51
- default: undefined;
52
- };
53
- component: {
54
- type: StringConstructor;
55
- default: string;
56
- };
57
- onClick: {
58
- type: PropType<(event: MouseEvent) => void>;
59
- default: undefined;
60
- };
61
- }>> & Readonly<{}>, {
62
- onClick: (event: MouseEvent) => void;
63
- classNames: Function | Record<string, any>;
64
- styles: Function | Record<string, any>;
65
- component: string;
66
- vars: Function | Record<string, any>;
67
- tooltipLabel: string;
68
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export { default as CodeHighlightControl } from './CodeHighlightControl.vue';
2
+ export type * from './CodeHighlightControl.types';
@@ -0,0 +1,20 @@
1
+ import type { VNodeChild } from 'vue';
2
+ export interface CodeHighlightControlProps {
3
+ /** Tooltip label. If omitted, the tooltip is not rendered. */
4
+ tooltipLabel?: string;
5
+ /** Root element or component. @default 'button' */
6
+ component?: MantineElementType;
7
+ classNames?: any;
8
+ styles?: any;
9
+ vars?: any;
10
+ [key: string]: any;
11
+ }
12
+ /** Events emitted by `CodeHighlightControl`. */
13
+ export interface CodeHighlightControlEmits {
14
+ /** Emitted when the control is clicked. */
15
+ click: [event: MouseEvent];
16
+ }
17
+ export interface CodeHighlightControlSlots {
18
+ default?: () => VNodeChild;
19
+ }
20
+ import type { MantineElementType } from '@mantine-vue/core';
@@ -0,0 +1,15 @@
1
+ import type { CodeHighlightControlSlots } from './CodeHighlightControl.types';
2
+ type __VLS_Slots = CodeHighlightControlSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ click: (event: MouseEvent) => any;
5
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
6
+ onClick?: ((event: MouseEvent) => any) | undefined;
7
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -1,32 +1 @@
1
- export declare const CopyCodeButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- code: {
3
- type: StringConstructor;
4
- required: true;
5
- };
6
- copiedLabel: {
7
- type: StringConstructor;
8
- default: string;
9
- };
10
- copyLabel: {
11
- type: StringConstructor;
12
- default: string;
13
- };
14
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
15
- [key: string]: any;
16
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
- code: {
18
- type: StringConstructor;
19
- required: true;
20
- };
21
- copiedLabel: {
22
- type: StringConstructor;
23
- default: string;
24
- };
25
- copyLabel: {
26
- type: StringConstructor;
27
- default: string;
28
- };
29
- }>> & Readonly<{}>, {
30
- copiedLabel: string;
31
- copyLabel: string;
32
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export { default as CopyCodeButton } from './CopyCodeButton.vue';
@@ -0,0 +1,8 @@
1
+ export interface CopyCodeButtonProps {
2
+ code: string;
3
+ copiedLabel?: string;
4
+ copyLabel?: string;
5
+ }
6
+ declare const __VLS_export: import("vue").DefineComponent<CopyCodeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CopyCodeButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -1,13 +1 @@
1
- export declare const CopyIcon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- copied: {
3
- type: BooleanConstructor;
4
- required: true;
5
- };
6
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
7
- [key: string]: any;
8
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
- copied: {
10
- type: BooleanConstructor;
11
- required: true;
12
- };
13
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export { default as CopyIcon } from './CopyIcon.vue';
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ copied: boolean;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -1,41 +1 @@
1
- import { type PropType } from 'vue';
2
- export declare const ExpandCodeButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
- expanded: {
4
- type: BooleanConstructor;
5
- required: true;
6
- };
7
- onExpand: {
8
- type: PropType<(value: boolean) => void>;
9
- required: true;
10
- };
11
- collapseCodeLabel: {
12
- type: StringConstructor;
13
- default: string;
14
- };
15
- expandCodeLabel: {
16
- type: StringConstructor;
17
- default: string;
18
- };
19
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
20
- [key: string]: any;
21
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
22
- expanded: {
23
- type: BooleanConstructor;
24
- required: true;
25
- };
26
- onExpand: {
27
- type: PropType<(value: boolean) => void>;
28
- required: true;
29
- };
30
- collapseCodeLabel: {
31
- type: StringConstructor;
32
- default: string;
33
- };
34
- expandCodeLabel: {
35
- type: StringConstructor;
36
- default: string;
37
- };
38
- }>> & Readonly<{}>, {
39
- collapseCodeLabel: string;
40
- expandCodeLabel: string;
41
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export { default as ExpandCodeButton } from './ExpandCodeButton.vue';
@@ -0,0 +1,15 @@
1
+ export interface ExpandCodeButtonProps {
2
+ expanded: boolean;
3
+ collapseCodeLabel?: string;
4
+ expandCodeLabel?: string;
5
+ }
6
+ export interface ExpandCodeButtonEmits {
7
+ expand: [value: boolean];
8
+ }
9
+ declare const __VLS_export: import("vue").DefineComponent<ExpandCodeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ expand: (value: boolean) => any;
11
+ }, string, import("vue").PublicProps, Readonly<ExpandCodeButtonProps> & Readonly<{
12
+ onExpand?: ((value: boolean) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -1,13 +1 @@
1
- export declare const ExpandIcon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- expanded: {
3
- type: BooleanConstructor;
4
- required: true;
5
- };
6
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
7
- [key: string]: any;
8
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
- expanded: {
10
- type: BooleanConstructor;
11
- required: true;
12
- };
13
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ export { default as ExpandIcon } from './ExpandIcon.vue';
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ expanded: boolean;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -1,108 +1,17 @@
1
- import { type PropType } from 'vue';
2
- export type InlineCodeHighlightStylesNames = 'inlineCodeHighlight';
3
- export type InlineCodeHighlightCssVariables = {
4
- inlineCodeHighlight: '--ch-background' | '--ch-radius';
1
+ export declare const InlineCodeHighlight: {
2
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
3
+ P: {};
4
+ B: {};
5
+ D: {};
6
+ C: {};
7
+ M: {};
8
+ Defaults: {};
9
+ }, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
10
+ __isFragment?: never;
11
+ __isTeleport?: never;
12
+ __isSuspense?: never;
13
+ } & import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
14
+ classes: Record<string, string>;
15
+ varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
5
16
  };
6
- export interface InlineCodeHighlightProps {
7
- code: string;
8
- language?: string;
9
- background?: string;
10
- radius?: string | number;
11
- withBorder?: boolean;
12
- classNames?: any;
13
- styles?: any;
14
- vars?: any;
15
- unstyled?: boolean;
16
- [key: string]: any;
17
- }
18
- export interface InlineCodeHighlightFactory {
19
- props: InlineCodeHighlightProps;
20
- stylesNames: InlineCodeHighlightStylesNames;
21
- vars: InlineCodeHighlightCssVariables;
22
- }
23
- export declare const InlineCodeHighlight: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
24
- code: {
25
- type: StringConstructor;
26
- required: true;
27
- };
28
- language: {
29
- type: StringConstructor;
30
- default: undefined;
31
- };
32
- background: {
33
- type: StringConstructor;
34
- default: undefined;
35
- };
36
- radius: {
37
- type: PropType<string | number>;
38
- default: undefined;
39
- };
40
- withBorder: {
41
- type: BooleanConstructor;
42
- default: boolean;
43
- };
44
- classNames: {
45
- type: (ObjectConstructor | FunctionConstructor)[];
46
- default: undefined;
47
- };
48
- styles: {
49
- type: (ObjectConstructor | FunctionConstructor)[];
50
- default: undefined;
51
- };
52
- vars: {
53
- type: (ObjectConstructor | FunctionConstructor)[];
54
- default: undefined;
55
- };
56
- unstyled: {
57
- type: BooleanConstructor;
58
- default: boolean;
59
- };
60
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
61
- [key: string]: any;
62
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
63
- code: {
64
- type: StringConstructor;
65
- required: true;
66
- };
67
- language: {
68
- type: StringConstructor;
69
- default: undefined;
70
- };
71
- background: {
72
- type: StringConstructor;
73
- default: undefined;
74
- };
75
- radius: {
76
- type: PropType<string | number>;
77
- default: undefined;
78
- };
79
- withBorder: {
80
- type: BooleanConstructor;
81
- default: boolean;
82
- };
83
- classNames: {
84
- type: (ObjectConstructor | FunctionConstructor)[];
85
- default: undefined;
86
- };
87
- styles: {
88
- type: (ObjectConstructor | FunctionConstructor)[];
89
- default: undefined;
90
- };
91
- vars: {
92
- type: (ObjectConstructor | FunctionConstructor)[];
93
- default: undefined;
94
- };
95
- unstyled: {
96
- type: BooleanConstructor;
97
- default: boolean;
98
- };
99
- }>> & Readonly<{}>, {
100
- radius: string | number;
101
- classNames: Function | Record<string, any>;
102
- styles: Function | Record<string, any>;
103
- background: string;
104
- vars: Function | Record<string, any>;
105
- unstyled: boolean;
106
- withBorder: boolean;
107
- language: string;
108
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
+ export type * from './InlineCodeHighlight.types';
@@ -0,0 +1,30 @@
1
+ export type InlineCodeHighlightStylesNames = 'inlineCodeHighlight';
2
+ export type InlineCodeHighlightCssVariables = {
3
+ inlineCodeHighlight: '--ch-background' | '--ch-radius';
4
+ };
5
+ export interface InlineCodeHighlightProps {
6
+ /** Code to highlight. */
7
+ code: string;
8
+ /** Language of the code, used to determine syntax highlighting. */
9
+ language?: string;
10
+ /** Controls background color of the code. By default, the value depends on color scheme. */
11
+ background?: string;
12
+ /** Key of `theme.radius` or any valid CSS value to set border-radius. @default 'sm' */
13
+ radius?: string | number;
14
+ /** Adds border to the root element. @default false */
15
+ withBorder?: boolean;
16
+ /** CSS classes applied to component elements. */
17
+ classNames?: any;
18
+ /** Inline styles applied to component elements. */
19
+ styles?: any;
20
+ /** CSS variables applied to component elements. */
21
+ vars?: any;
22
+ /** If set, all Mantine classes are removed from component elements. @default false */
23
+ unstyled?: boolean;
24
+ [key: string]: any;
25
+ }
26
+ export interface InlineCodeHighlightFactory {
27
+ props: InlineCodeHighlightProps;
28
+ stylesNames: InlineCodeHighlightStylesNames;
29
+ vars: InlineCodeHighlightCssVariables;
30
+ }
@@ -0,0 +1,5 @@
1
+ declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
2
+ export { varsResolver };
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,14 @@
1
+ import type { CodeHighlightAdapterProviderProps } from './CodeHighlightProvider.types';
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<CodeHighlightAdapterProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CodeHighlightAdapterProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
@@ -1,34 +1,21 @@
1
- import { type PropType } from 'vue';
2
- export interface HighlighterInput {
3
- colorScheme: 'light' | 'dark' | (string & {});
4
- code: string;
5
- language?: string;
6
- }
7
- export type Highlighter = (input: HighlighterInput) => {
8
- highlightedCode: string;
9
- isHighlighted: boolean;
10
- codeElementProps?: Record<string, any>;
11
- };
12
- export interface CodeHighlightAdapter {
13
- loadContext?: () => Promise<any>;
14
- getHighlighter: (ctx: any) => Highlighter;
15
- }
16
- export interface CodeHighlightProviderContext {
17
- adapter: CodeHighlightAdapter;
18
- highlight: Highlighter;
19
- }
1
+ import type { CodeHighlightProviderContext } from './CodeHighlightProvider.types';
20
2
  export declare function provideCodeHighlightAdapterContext(value: CodeHighlightProviderContext): void;
21
- export declare function useHighlight(): Highlighter;
22
- export declare const CodeHighlightAdapterProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
23
- adapter: {
24
- type: PropType<CodeHighlightAdapter>;
25
- required: true;
3
+ export declare function useHighlight(): import("./CodeHighlightProvider.types").Highlighter;
4
+ export declare const CodeHighlightAdapterProvider: {
5
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./CodeHighlightProvider.types").CodeHighlightAdapterProviderProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
6
+ P: {};
7
+ B: {};
8
+ D: {};
9
+ C: {};
10
+ M: {};
11
+ Defaults: {};
12
+ }, Readonly<import("./CodeHighlightProvider.types").CodeHighlightAdapterProviderProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
13
+ __isFragment?: never;
14
+ __isTeleport?: never;
15
+ __isSuspense?: never;
16
+ } & import("vue").ComponentOptionsBase<Readonly<import("./CodeHighlightProvider.types").CodeHighlightAdapterProviderProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
17
+ $slots: {
18
+ default?: (props: {}) => any;
26
19
  };
27
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
28
- [key: string]: any;
29
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
- adapter: {
31
- type: PropType<CodeHighlightAdapter>;
32
- required: true;
33
- };
34
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
20
+ });
21
+ export type * from './CodeHighlightProvider.types';
@@ -0,0 +1,25 @@
1
+ export interface HighlighterInput {
2
+ colorScheme: 'light' | 'dark' | (string & {});
3
+ code: string;
4
+ language?: string;
5
+ }
6
+ export type Highlighter = (input: HighlighterInput) => {
7
+ /** Highlighted code (HTML markup). */
8
+ highlightedCode: string;
9
+ /** `true` if the code is represented with an HTML string, `false` for a plain text string. */
10
+ isHighlighted: boolean;
11
+ /** Props passed down to the `<code>` element. */
12
+ codeElementProps?: Record<string, any>;
13
+ };
14
+ export interface CodeHighlightAdapter {
15
+ loadContext?: () => Promise<any>;
16
+ getHighlighter: (ctx: any) => Highlighter;
17
+ }
18
+ export interface CodeHighlightProviderContext {
19
+ adapter: CodeHighlightAdapter;
20
+ highlight: Highlighter;
21
+ }
22
+ export interface CodeHighlightAdapterProviderProps {
23
+ /** Highlighting adapter used by descendant components. */
24
+ adapter: CodeHighlightAdapter;
25
+ }