PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.21.0
Code Block Pro – Beautiful Syntax Highlighting v1.21.0
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.21.0, at src/types.ts

92 lines 2.5 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 lineNumbersWidth: number;
33 enableHighlighting: boolean;
34 highlightingHover: boolean;
35 lineHighlights: string;
36 lineHighlightColor: string;
37 enableBlurring: boolean;
38 lineBlurs: string;
39 removeBlurOnHover: boolean;
40 frame: boolean;
41 renderType: string;
42 label: string;
43 copyButton: boolean;
44 copyButtonType: string;
45 useDecodeURI: boolean;
46 tabSize: number;
47 };
48 export interface AttributesPropsAndSetter {
49 attributes: Attributes;
50 setAttributes: (attrs: Partial<Attributes>) => void;
51 }
52
53 declare global {
54 interface Window {
55 codeBlockPro: {
56 pluginUrl: string;
57 canSaveHtml: boolean;
58 };
59 }
60 }
61
62 export type CustomStyles = {
63 'color-text'?: string; // --shiki-color-text
64 'color-background'?: string; // --shiki-color-background
65 'token-constant'?: string; // --shiki-token-constant
66 'token-string'?: string; // --shiki-token-string
67 'token-comment'?: string; // --shiki-token-comment
68 'token-keyword'?: string; // --shiki-token-keyword
69 'token-parameter'?: string; // --shiki-token-parameter
70 'token-function'?: string; // --shiki-token-function
71 'token-string-expression'?: string; // --shiki-token-string-expression
72 'token-punctuation'?: string; // --shiki-token-punctuation
73 'token-link'?: string; // --shiki-token-link
74 'line-background'?: string; // custom for this app
75 'line-number-color'?: string; // custom for this app
76 };
77 export type HelpUrl = {
78 text: string;
79 url: string;
80 };
81
82 export type ThemeOption = Record<
83 string,
84 {
85 name: string;
86 priority?: boolean;
87 custom?: boolean;
88 styles?: CustomStyles;
89 helpUrl?: HelpUrl;
90 }
91 >;
92