types (EN) - bhsd-harry/wikiparser-node GitHub Wiki
✅ Available in the Mini and Browser versions.
🌐 Available in the Browser version.
Expand
AST in JSON format.
property: range start and end indices
type: [number, number]
property: type token type, unavailable for text nodes
type: string | undefined
property: name token name if available
type: string | undefined
property: childNodes array of child nodes, unavailable for text nodes
type: this[] | undefined
property: data data of text nodes
type: string | undefined
🌐 展开
Navigable AST. Inherits all properties from AST.
property: parentNode parent node
type: this | undefined
property: nextSibling next sibling node
type: this | undefined
property: previousSibling previous sibling node
type: this | undefined
property: firstChild first child node
type: this | undefined
property: lastChild last child node
type: this | undefined
property: length number of child nodes or length of text for text nodes
type: number
method: getRootNode get the root node
returns: this
method: is check if the node is of a certain type
param: string node type
returns: boolean
method: closest search for the closest ancestor node that matches a selector
param: string selector
returns: this | undefined
method: querySelector search for the first descendant node that matches a selector
param: string selector
returns: this | undefined
method: querySelectorAll search for all descendant nodes that match a selector
param: string selector
returns: this[]
✅ Expand
Parser configuration.
property: ext extension tags
type: string[]
property: html HTML tags
type: [string[], string[], string[]]
property: namespaces namespaces
type: Record<string, string>
property: nsid namespace IDs
type: Record<string, number>
property: variable variables
type: string[]
property: functionHook parser functions
type: string[]
property: parserFunction variables or parser functions
type: [Record<string, string>, Record<string, string>, string[], string[]]
property: doubleUnderscore behavior switches
type: [string[], string[], Record<string, string>?, Record<string, string>?]
property: protocol external link protocol
type: string
property: interwiki interwiki prefixes
type: string[]
property: img image parameters
type: Record<string, string>
property: redirection magic words for redirection
type: string[]
property: variants language variants
type: string[]
property: articlePath $wgArticlePath, optional
type: string
property: server $wgServer, optional
type: string
property: conversionTable unidirectional conversion table, optional
type: [string, string][]
property: redirects redirects, optional
type: [string, string][]
Expand
version added: 1.22.0
A basic JSON frame object for the #invoke parser function.
property: args arguments passed to the frame
type: Record<string, string>
property: parent the parent frame, if any
type: Frame | undefined
property: title the title of the module
type: string
Expand
version added: 1.25.1
A JSON object for configuring the linter.
property: rules rule configuration
type: Record<LintError.Rule, unknown>
property: computeEditInfo whether to compute quick fixes or suggestions for individual issues, default to true
type: boolean
property: fix whether to compute fix-all suggestions for the entire document, default to true
type: boolean
property: ignoreDisables whether to ignore inline configuration comments, default to false
type: boolean
✅ Expand
Grammar error.
property: rule rule name
type: LintError.Rule
property: message error type
type: string
property: severity error severity
type: 'error' | 'warning'
property: startIndex start position
type: number
property: endIndex end position
type: number
property: startLine start line
type: number
property: endLine end line
type: number
property: startCol start column
type: number
property: endCol end column
type: number
property: fix auto-fix, optional
type: LintError.Fix
property: suggestions suggestions, optional
type: LintError.Fix[]
✅ Expand
Fix suggestion for grammar error.
property: range start and end positions
type: [number, number]
property: text replacement text
type: string
property: desc description
type: string