This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

79
node_modules/mdast-util-from-markdown/dev/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,79 @@
export type {
CompileContext,
Encoding,
Extension,
Handle,
OnEnterError,
OnExitError,
Options,
Token,
Transform,
Value
} from './lib/index.js'
export {fromMarkdown} from './lib/index.js'
/**
* Interface of tracked data.
*
* When working on extensions that use more data, extend the corresponding
* interface to register their types:
*
* ```ts
* declare module 'mdast-util-from-markdown' {
* interface CompileData {
* // Register a new field.
* mathFlowInside?: boolean | undefined
* }
* }
* ```
*/
export interface CompileData {
/**
* Whether were inside a hard break.
*/
atHardBreak?: boolean | undefined
/**
* Current character reference type.
*/
characterReferenceType?:
| 'characterReferenceMarkerHexadecimal'
| 'characterReferenceMarkerNumeric'
| undefined
/**
* Whether a first list item value (`1` in `1. a`) is expected.
*/
expectingFirstListItemValue?: boolean | undefined
/**
* Whether were in flow code.
*/
flowCodeInside?: boolean | undefined
/**
* Whether were in a reference.
*/
inReference?: boolean | undefined
/**
* Whether were expecting a line ending from a setext heading, which can be slurped.
*/
setextHeadingSlurpLineEnding?: boolean | undefined
/**
* Current reference.
*/
referenceType?: 'collapsed' | 'full' | undefined
}
declare module 'micromark-util-types' {
interface TokenTypeMap {
listItem: 'listItem'
}
interface Token {
_spread?: boolean
}
}

2
node_modules/mdast-util-from-markdown/dev/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
// Note: types exported from `index.d.ts`.
export {fromMarkdown} from './lib/index.js'

View File

@@ -0,0 +1,163 @@
export function fromMarkdown(
value: Value,
encoding?: Encoding | null | undefined,
options?: Options | null | undefined
): Root
export function fromMarkdown(
value: Value,
options?: Options | null | undefined
): Root
export type Break = import('mdast').Break
export type Blockquote = import('mdast').Blockquote
export type Code = import('mdast').Code
export type Definition = import('mdast').Definition
export type Emphasis = import('mdast').Emphasis
export type Heading = import('mdast').Heading
export type Html = import('mdast').Html
export type Image = import('mdast').Image
export type InlineCode = import('mdast').InlineCode
export type Link = import('mdast').Link
export type List = import('mdast').List
export type ListItem = import('mdast').ListItem
export type Nodes = import('mdast').Nodes
export type Paragraph = import('mdast').Paragraph
export type Parent = import('mdast').Parent
export type PhrasingContent = import('mdast').PhrasingContent
export type ReferenceType = import('mdast').ReferenceType
export type Root = import('mdast').Root
export type Strong = import('mdast').Strong
export type Text = import('mdast').Text
export type ThematicBreak = import('mdast').ThematicBreak
export type Encoding = import('micromark-util-types').Encoding
export type Event = import('micromark-util-types').Event
export type ParseOptions = import('micromark-util-types').ParseOptions
export type Token = import('micromark-util-types').Token
export type TokenizeContext = import('micromark-util-types').TokenizeContext
export type Value = import('micromark-util-types').Value
export type Point = import('unist').Point
export type CompileData = import('../index.js').CompileData
export type Fragment = Omit<Parent, 'children' | 'type'> & {
type: 'fragment'
children: Array<PhrasingContent>
}
/**
* Extra transform, to change the AST afterwards.
*/
export type Transform = (tree: Root) => Root | null | undefined | void
/**
* Handle a token.
*/
export type Handle = (this: CompileContext, token: Token) => undefined | void
/**
* Token types mapping to handles
*/
export type Handles = Record<string, Handle>
/**
* Handle the case where the `right` token is open, but it is closed (by the
* `left` token) or because we reached the end of the document.
*/
export type OnEnterError = (
this: Omit<CompileContext, 'sliceSerialize'>,
left: Token | undefined,
right: Token
) => undefined
/**
* Handle the case where the `right` token is open but it is closed by
* exiting the `left` token.
*/
export type OnExitError = (
this: Omit<CompileContext, 'sliceSerialize'>,
left: Token,
right: Token
) => undefined
/**
* Open token on the stack, with an optional error handler for when
* that token isnt closed properly.
*/
export type TokenTuple = [Token, OnEnterError | undefined]
/**
* Configuration.
*
* We have our defaults, but extensions will add more.
*/
export type Config = {
/**
* Token types where line endings are used.
*/
canContainEols: Array<string>
/**
* Opening handles.
*/
enter: Handles
/**
* Closing handles.
*/
exit: Handles
/**
* Tree transforms.
*/
transforms: Array<Transform>
}
/**
* Change how markdown tokens from micromark are turned into mdast.
*/
export type Extension = Partial<Config>
/**
* mdast compiler context.
*/
export type CompileContext = {
/**
* Stack of nodes.
*/
stack: Array<Fragment | Nodes>
/**
* Stack of tokens.
*/
tokenStack: Array<TokenTuple>
/**
* Capture some of the output data.
*/
buffer: (this: CompileContext) => undefined
/**
* Stop capturing and access the output data.
*/
resume: (this: CompileContext) => string
/**
* Enter a node.
*/
enter: (
this: CompileContext,
node: Nodes,
token: Token,
onError?: OnEnterError
) => undefined
/**
* Exit a node.
*/
exit: (this: CompileContext, token: Token, onError?: OnExitError) => undefined
/**
* Get the string value of a token.
*/
sliceSerialize: TokenizeContext['sliceSerialize']
/**
* Configuration.
*/
config: Config
/**
* Info passed around; key/value store.
*/
data: CompileData
}
/**
* Configuration for how to build mdast.
*/
export type FromMarkdownOptions = {
/**
* Extensions for this utility to change how tokens are turned into a tree.
*/
mdastExtensions?: Array<Extension | Array<Extension>> | null | undefined
}
/**
* Configuration.
*/
export type Options = ParseOptions & FromMarkdownOptions

1448
node_modules/mdast-util-from-markdown/dev/lib/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff