Skip to content

Commit 5eddaa3

Browse files
committed
Change to rename Directive -> Directives
This is more in line with the new enums of nodes now in mdast, such as `Nodes` for all node types, and `Parents` for all parents.
1 parent f163eb0 commit 5eddaa3

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface TextDirective extends Parent, DirectiveFields {
6969
/**
7070
* The different directive nodes.
7171
*/
72-
export type Directive = ContainerDirective | LeafDirective | TextDirective
72+
export type Directives = ContainerDirective | LeafDirective | TextDirective
7373

7474
// Add custom data tracked to turn markdown into a tree.
7575
declare module 'mdast-util-from-markdown' {

lib/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
1313
* @typedef {import('mdast-util-to-markdown').State} State
1414
*
15-
* @typedef {import('../index.js').Directive} Directive
15+
* @typedef {import('../index.js').Directives} Directives
1616
* @typedef {import('../index.js').LeafDirective} LeafDirective
1717
* @typedef {import('../index.js').TextDirective} TextDirective
1818
*/
@@ -132,7 +132,7 @@ function enterText(token) {
132132

133133
/**
134134
* @this {CompileContext}
135-
* @param {Directive['type']} type
135+
* @param {Directives['type']} type
136136
* @param {Token} token
137137
*/
138138
function enter(type, token) {
@@ -278,7 +278,7 @@ function exit(token) {
278278

279279
/**
280280
* @type {ToMarkdownHandle}
281-
* @param {Directive} node
281+
* @param {Directives} node
282282
*/
283283
function handleDirective(node, _, state, info) {
284284
const tracker = state.createTracker(info)
@@ -345,7 +345,7 @@ function peekDirective() {
345345
}
346346

347347
/**
348-
* @param {Directive} node
348+
* @param {Directives} node
349349
* @param {State} state
350350
* @returns {string}
351351
*/
@@ -439,7 +439,7 @@ function inlineDirectiveLabel(node) {
439439
}
440440

441441
/**
442-
* @param {Directive} node
442+
* @param {Directives} node
443443
* @returns {string}
444444
*/
445445
function fence(node) {

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ such).
2222
* [`directiveFromMarkdown`](#directivefrommarkdown)
2323
* [`directiveToMarkdown`](#directivetomarkdown)
2424
* [`ContainerDirective`](#containerdirective)
25-
* [`Directive`](#directive)
25+
* [`Directives`](#directives)
2626
* [`LeafDirective`](#leafdirective)
2727
* [`TextDirective`](#textdirective)
2828
* [HTML](#html)
@@ -198,14 +198,14 @@ interface ContainerDirective extends Parent {
198198
}
199199
```
200200

201-
### `Directive`
201+
### `Directives`
202202

203203
The different directive nodes (TypeScript type).
204204

205205
###### Type
206206

207207
```ts
208-
type Directive = ContainerDirective | LeafDirective | TextDirective
208+
type Directives = ContainerDirective | LeafDirective | TextDirective
209209
```
210210
211211
### `LeafDirective`
@@ -410,7 +410,7 @@ or hast).
410410

411411
This package is fully typed with [TypeScript][].
412412
It exports the additional types [`ContainerDirective`][api-container-directive],
413-
[`Directive`][api-directive], [`LeafDirective`][api-leaf-directive], and
413+
[`Directives`][api-directives], [`LeafDirective`][api-leaf-directive], and
414414
[`TextDirective`][api-text-directive].
415415

416416
It also registers the node types with `@types/mdast`.
@@ -552,10 +552,10 @@ abide by its terms.
552552

553553
[api-container-directive]: #containerdirective
554554

555-
[api-directive]: #directive
555+
[api-directives]: #directives
556556

557557
[api-leaf-directive]: #leafdirective
558558

559559
[api-text-directive]: #textdirective
560560

561-
[dfn-mxn-directive]: #directive-1
561+
[dfn-mxn-directive]: #directive

0 commit comments

Comments
 (0)