PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.26.8
Code Block Pro – Beautiful Syntax Highlighting v1.26.8
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / src / types.ts

types.ts in Code Block Pro – Beautiful Syntax Highlighting 1.26.8, at src/types.ts

98 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { Lang as LangShiki, Theme } from 'shiki';
2
3 export type Lang = LangShiki | 'ansi' | 'plaintext';
4
5 export type Attributes = {
6 code: string;
7 codeHTML: string;
8 language: Lang;
9 theme: Theme;
10 align: 'wide' | 'full';
11 bgColor: string;
12 textColor: string;
13 fontSize: string;
14 fontFamily: string;
15 lineHeight: string;
16 lineNumbers: boolean;
17 clampFonts: boolean;
18 editorHeight: string;
19 headerType: string;
20 headerString?: string;
21 footerType?: string;
22 footerString?: string;
23 footerLink?: string;
24 enableMaxHeight?: boolean;
25 seeMoreType?: string;
26 seeMoreString?: string;
27 seeMoreAfterLine?: string;
28 seeMoreTransition?: boolean;
29 footerLinkTarget?: boolean;
30 disablePadding: boolean;
31 startingLineNumber: string;
32 // Defunct - Removing it would require n attribute migration
33 // so it's easier to just leave it unused for new blocks.
34 lineNumbersWidth: number;
35 highestLineNumber: number;
36 enableHighlighting: boolean;
37 highlightingHover: boolean;
38 lineHighlights: string;
39 lineHighlightColor: string;
40 enableBlurring: boolean;
41 lineBlurs: string;
42 removeBlurOnHover: boolean;
43 frame: boolean;
44 renderType: string;
45 label: string;
46 copyButton: boolean;
47 copyButtonType: string;
48 copyButtonString: string;
49 copyButtonStringCopied: string;
50 useDecodeURI: boolean;
51 useEscapeShortCodes: boolean;
52 tabSize: number;
53 useTabs: boolean;
54 };
55 export interface AttributesPropsAndSetter {
56 attributes: Attributes;
57 setAttributes: (attrs: Partial<Attributes>) => void;
58 }
59
60 declare global {
61 interface Window {
62 codeBlockPro: {
63 pluginUrl: string;
64 };
65 }
66 }
67
68 export type CustomStyles = {
69 'color-text'?: string; // --shiki-color-text
70 'color-background'?: string; // --shiki-color-background
71 'token-constant'?: string; // --shiki-token-constant
72 'token-string'?: string; // --shiki-token-string
73 'token-comment'?: string; // --shiki-token-comment
74 'token-keyword'?: string; // --shiki-token-keyword
75 'token-parameter'?: string; // --shiki-token-parameter
76 'token-function'?: string; // --shiki-token-function
77 'token-string-expression'?: string; // --shiki-token-string-expression
78 'token-punctuation'?: string; // --shiki-token-punctuation
79 'token-link'?: string; // --shiki-token-link
80 'line-background'?: string; // custom for this app
81 'line-number-color'?: string; // custom for this app
82 };
83 export type HelpUrl = {
84 text: string;
85 url: string;
86 };
87
88 export type ThemeOption = Record<
89 string,
90 {
91 name: string;
92 priority?: boolean;
93 custom?: boolean;
94 styles?: CustomStyles;
95 helpUrl?: HelpUrl;
96 }
97 >;
98