dh_demo

DreamHanks demo project
git clone git://git.lair.cx/dh_demo
Log | Files | Refs | README

token.ts (737B)


      1 export type ListType = 'unordered' | 'ordered'
      2 
      3 export type InlineToken = {
      4   key: 'text'
      5   text: string
      6 } | {
      7   key: 'linebreak'
      8 } | {
      9   key: 'bold'
     10   text: string
     11 } | {
     12   key: 'italic'
     13   text: string
     14 } | {
     15   key: 'strikethrough'
     16   text: string
     17 } | {
     18   key: 'underline'
     19   text: string
     20 } | {
     21   key: 'code'
     22   text: string
     23 } | {
     24   key: 'link'
     25   path: string
     26   text: string
     27 }
     28 
     29 export type Token = {
     30   key: 'heading'
     31   level: number
     32   children: InlineToken[]
     33 } | {
     34   key: 'horizontal-rule'
     35 } | {
     36   key: 'list'
     37   listType: ListType
     38   children: Token[]
     39 } | {
     40   key: 'list-item'
     41   children: Token[]
     42 } | {
     43   key: 'blockquote'
     44   children: Token[]
     45 } | {
     46   key: 'paragraph'
     47   children: InlineToken[]
     48 } | {
     49   key: 'text'
     50   children: InlineToken[]
     51 }