myst-spec-ext
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -244,3 +244,43 @@ import type { Block as SpecBlock, Parent, StaticPhrasingContent, FlowContent, ListContent, PhrasingContent, TableCell as SpecTableCell, FootnoteReference as FNR, FootnoteDefinition as FND, Heading as SpecHeading, Image as SpecImage, Admonition as SpecAdmonition, Code as SpecCode, ListItem as SpecListItem, Container as SpecContainer, InlineMath as SpecInlineMath, Math as SpecMath, Node, CrossReference as SpecCrossReference, Link as SpecLink } from 'myst-spec'; | ||
}; | ||
/** | ||
* Hierarchy of headers in a document | ||
*/ | ||
export type DocumentHierarchy = { | ||
lvl1?: string; | ||
lvl2?: string; | ||
lvl3?: string; | ||
lvl4?: string; | ||
lvl5?: string; | ||
lvl6?: string; | ||
}; | ||
/** | ||
* Base type for search records | ||
*/ | ||
export type SearchRecordBase = { | ||
hierarchy: DocumentHierarchy; | ||
url: string; | ||
position: number; | ||
}; | ||
/** | ||
* Record pertaining to section headings | ||
*/ | ||
export type HeadingRecord = SearchRecordBase & { | ||
type: keyof DocumentHierarchy; | ||
}; | ||
/** | ||
* Record pertaining to section content | ||
*/ | ||
export type ContentRecord = SearchRecordBase & { | ||
type: 'content'; | ||
content: string; | ||
}; | ||
/** | ||
* Indexed search record type | ||
*/ | ||
export type SearchRecord = HeadingRecord | ContentRecord; | ||
export type MystSearchIndex = { | ||
version: '1'; | ||
records: SearchRecord[]; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "myst-spec-ext", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"description": "Extensions for myst-spec that are used in mystmd", | ||
@@ -5,0 +5,0 @@ "author": "Rowan Cockett <rowan@curvenote.com>", |
Sorry, the diff of this file is not supported yet
16946
292