1
- import type { Literal } from 'hast'
1
+ import type { Data , Literal } from 'hast'
2
2
import type { State } from './lib/state.js'
3
3
4
4
// Expose types.
5
- export type { State , Handler , Handlers , Options } from './lib/state.js'
5
+ export type { Handler , Handlers , Options , State } from './lib/state.js'
6
6
7
7
// To do: next major: remove.
8
8
/**
@@ -13,33 +13,39 @@ export type H = State
13
13
// Expose JS API.
14
14
export { handlers as defaultHandlers } from './lib/handlers/index.js'
15
15
// To do: next major: remove.
16
- export { one , all } from './lib/state.js'
16
+ export { all , one } from './lib/state.js'
17
17
export { toHast } from './lib/index.js'
18
18
19
- // Expose node type.
20
19
/**
21
20
* Raw string of HTML embedded into HTML AST.
22
21
*/
23
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
24
22
export interface Raw extends Literal {
25
23
/**
26
- * Node type.
24
+ * Node type of raw .
27
25
*/
28
26
type : 'raw'
27
+
28
+ /**
29
+ * Data associated with the hast raw.
30
+ */
31
+ data ?: RawData | undefined
29
32
}
30
33
34
+ /**
35
+ * Info associated with hast raw nodes by the ecosystem.
36
+ */
37
+ export interface RawData extends Data { }
38
+
31
39
// Register nodes in content.
32
40
declare module 'hast' {
33
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
34
- interface RootContentMap {
41
+ interface ElementContentMap {
35
42
/**
36
43
* Raw string of HTML embedded into HTML AST.
37
44
*/
38
45
raw : Raw
39
46
}
40
47
41
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
42
- interface ElementContentMap {
48
+ interface RootContentMap {
43
49
/**
44
50
* Raw string of HTML embedded into HTML AST.
45
51
*/
0 commit comments