Skip to content

Commit e4ba789

Browse files
committed
Refactor types to use ConstructNameMap interface
1 parent e2268ea commit e4ba789

File tree

6 files changed

+549
-470
lines changed

6 files changed

+549
-470
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
coverage/
22
node_modules/
33
.DS_Store
4-
index.d.ts
5-
test.d.ts
4+
*.d.ts
65
*.log
76
yarn.lock
7+
!/index.d.ts

index.d.ts

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
export type {
2+
ContainerDirective,
3+
Directive,
4+
LeafDirective,
5+
TextDirective
6+
} from './lib/index.js'
7+
8+
export {directiveFromMarkdown, directiveToMarkdown} from './lib/index.js'
9+
10+
declare module 'mdast-util-to-markdown' {
11+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
12+
interface ConstructNameMap {
13+
/**
14+
* Whole container directive.
15+
*
16+
* ```markdown
17+
* > | :::a
18+
* ^^^^
19+
* > | :::
20+
* ^^^
21+
* ```
22+
*/
23+
containerDirective: 'containerDirective'
24+
25+
/**
26+
* Label of a container directive.
27+
*
28+
* ```markdown
29+
* > | :::a[b]
30+
* ^^^
31+
* | :::
32+
* ```
33+
*/
34+
containerDirectiveLabel: 'containerDirectiveLabel'
35+
36+
/**
37+
* Whole leaf directive.
38+
*
39+
* ```markdown
40+
* > | ::a
41+
* ^^^
42+
* ```
43+
*/
44+
leafDirective: 'leafDirective'
45+
46+
/**
47+
* Label of a leaf directive.
48+
*
49+
* ```markdown
50+
* > | ::a[b]
51+
* ^^^
52+
* ```
53+
*/
54+
leafDirectiveLabel: 'leafDirectiveLabel'
55+
56+
/**
57+
* Whole text directive.
58+
*
59+
* ```markdown
60+
* > | :a
61+
* ^^
62+
* ```
63+
*/
64+
textDirective: 'textDirective'
65+
66+
/**
67+
* Label of a text directive.
68+
*
69+
* ```markdown
70+
* > | :a[b]
71+
* ^^^
72+
* ```
73+
*/
74+
textDirectiveLabel: 'textDirectiveLabel'
75+
}
76+
}

0 commit comments

Comments
 (0)