quikdown 1.0.2 → 1.0.4

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.
@@ -0,0 +1,80 @@
1
+ /**
2
+ * quikdown_bd - Bidirectional Markdown/HTML Converter
3
+ * TypeScript definitions
4
+ */
5
+
6
+ declare module 'quikdown/bd' {
7
+ /**
8
+ * Options for configuring the quikdown_bd parser
9
+ */
10
+ export interface QuikdownBDOptions {
11
+ /**
12
+ * Custom renderer for fenced code blocks.
13
+ * Return undefined to use default rendering.
14
+ * @param content - The code block content (unescaped)
15
+ * @param language - The language identifier (or empty string)
16
+ * @returns HTML string or undefined for default rendering
17
+ */
18
+ fence_plugin?: (content: string, language: string) => string | undefined;
19
+
20
+ /**
21
+ * If true, uses inline styles instead of CSS classes.
22
+ * Useful for emails or environments without CSS support.
23
+ * @default false
24
+ */
25
+ inline_styles?: boolean;
26
+
27
+ /**
28
+ * If true, allows potentially unsafe URLs (javascript:, data:, etc).
29
+ * Only use with trusted content.
30
+ * @default false
31
+ */
32
+ allow_unsafe_urls?: boolean;
33
+ }
34
+
35
+ /**
36
+ * Parse markdown to HTML with bidirectional support
37
+ * @param markdown - The markdown source text
38
+ * @param options - Optional configuration
39
+ * @returns The rendered HTML string with data-qd attributes for reverse conversion
40
+ */
41
+ function quikdown_bd(markdown: string, options?: QuikdownBDOptions): string;
42
+
43
+ namespace quikdown_bd {
44
+ /**
45
+ * Convert HTML back to Markdown
46
+ * @param htmlOrElement - HTML string or DOM element to convert
47
+ * @returns The reconstructed markdown string
48
+ */
49
+ export function toMarkdown(htmlOrElement: string | HTMLElement): string;
50
+
51
+ /**
52
+ * Generate CSS styles for quikdown classes with theme support
53
+ * @param prefix - CSS class prefix (default: 'quikdown-')
54
+ * @param theme - Theme name: 'light' (default) or 'dark'
55
+ * @returns CSS string with themed .quikdown-* styles
56
+ */
57
+ export function emitStyles(prefix?: string, theme?: 'light' | 'dark'): string;
58
+
59
+ /**
60
+ * Create a configured parser function with preset options
61
+ * @param options - Configuration to apply to all parsing
62
+ * @returns A parser function with the options pre-applied
63
+ */
64
+ export function configure(options: QuikdownBDOptions): (markdown: string) => string;
65
+
66
+ /**
67
+ * The version of quikdown_bd (same as core quikdown)
68
+ */
69
+ export const version: string;
70
+ }
71
+
72
+ export = quikdown_bd;
73
+ }
74
+
75
+ // For direct imports
76
+ declare module 'quikdown_bd' {
77
+ export * from 'quikdown/bd';
78
+ import quikdown_bd from 'quikdown/bd';
79
+ export default quikdown_bd;
80
+ }