-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.d.ts
55 lines (52 loc) · 1.41 KB
/
index.d.ts
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
declare module '@thebeyondgroup/shopify-rich-text-renderer' {
/** Shopify rich text schema */
export interface Schema {
type: string
children?: Schema[]
level?: number
listType?: 'ordered' | 'unordered'
url?: string
title?: string
target?: string
bold?: boolean
italic?: boolean
value?: string
}
/** Optional options for rendering Shopify rich text to HTML */
export interface Options {
/** allows for the rich text HTML to be easily styled */
scoped?: boolean | string
/** convert new line character to <br/> */
newLineToBreak?: boolean
classes?: {
/** paragraph classes */
p?: string
/** heading1 classes */
h1?: string
/** heading2 classes */
h2?: string
/** heading3 classes */
h3?: string
/** heading4 classes */
h4?: string
/** heading5 classes */
h5?: string
/** heading6 classes */
h6?: string
/** order list classes */
ol?: string
/** unordered list classes */
ul?: string
/** list item classes */
li?: string
/** anchor/link classes */
a?: string
/** bold/strong classes */
strong?: string
/** italic/em classes */
em?: string
}
}
/** Converts Shopify rich text to HTML */
export function convertSchemaToHtml(schema: string | Schema | Schema[], options?: Options | string | boolean): string
}