myst-common
Advanced tools
Comparing version 1.1.9 to 1.1.10
@@ -7,3 +7,3 @@ export { admonitionKindToTitle, toText, fileError, fileWarn, fileInfo, createId, normalizeLabel, createHtmlId, liftChildren, setTextAsChild, copyNode, mergeTextNodes, writeTexLabelledComment, } from './utils.js'; | ||
export type { MessageInfo } from './utils.js'; | ||
export type { GenericNode, GenericParent, Citations, References, ArgDefinition, BodyDefinition, OptionDefinition, DirectiveData, RoleData, DirectiveSpec, RoleSpec, ParseTypes, MystPlugin, } from './types.js'; | ||
export type { GenericNode, GenericParent, Citations, References, ArgDefinition, BodyDefinition, OptionDefinition, DirectiveData, RoleData, DirectiveSpec, RoleSpec, ParseTypes, MystPlugin, PluginOptions, PluginUtils, TransformSpec, } from './types.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,1 +1,2 @@ | ||
import type { Plugin } from 'unified'; | ||
import type { Node } from 'myst-spec'; | ||
@@ -74,8 +75,29 @@ import type { VFile } from 'vfile'; | ||
}; | ||
type Select = (selector: string, tree?: GenericParent) => GenericNode | null; | ||
type SelectAll = (selector: string, tree?: GenericParent) => GenericNode[] | null; | ||
export type PluginUtils = { | ||
select: Select; | ||
selectAll: SelectAll; | ||
}; | ||
export type PluginOptions = Record<string, any>; | ||
export type TransformSpec = { | ||
name: string; | ||
doc?: string; | ||
stage: 'document' | 'project'; | ||
plugin: Plugin<[ | ||
PluginOptions | undefined, | ||
PluginUtils | ||
], GenericParent, GenericParent | Promise<GenericParent>>; | ||
}; | ||
/** | ||
* Create MyST plugins that export this from a file, | ||
* or combine multiple plugins to a single object. */ | ||
* or combine multiple plugins to a single object. | ||
*/ | ||
export type MystPlugin = { | ||
name?: string; | ||
author?: string; | ||
license?: string; | ||
directives: DirectiveSpec[]; | ||
roles: RoleSpec[]; | ||
transforms: TransformSpec[]; | ||
}; | ||
@@ -102,2 +124,3 @@ export declare enum TargetKind { | ||
} | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "myst-common", | ||
"sideEffects": false, | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"type": "module", | ||
@@ -25,2 +25,3 @@ "exports": "./dist/index.js", | ||
"nanoid": "^4.0.0", | ||
"unified": "^10.1.2", | ||
"unist-util-map": "^3.0.0", | ||
@@ -27,0 +28,0 @@ "unist-util-remove": "^3.1.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
36303
648
9
+ Addedunified@^10.1.2
+ Addedbail@2.0.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedis-plain-obj@4.1.0(transitive)
+ Addedtrough@2.2.0(transitive)
+ Addedunified@10.1.2(transitive)