types - bhsd-harry/wikiparser-node GitHub Wiki
展开
JSON 格式的 AST。
property: range 起始和结束位置
type: [number, number]
property: type 节点类型,文本节点无此属性
type: string | undefined
property: name 节点名,如果存在
type: string | undefined
property: childNodes 子节点数组,文本节点无此属性
type: AST[] | undefined
property: data 文本节点内容
type: string | undefined
✅ 展开
解析设置。
property: ext 扩展标签名
type: string[]
property: html HTML 标签名
type: [string[], string[], string[]]
property: namespaces 命名空间名
type: Record<string, string>
property: nsid 命名空间编号
type: Record<string, number>
property: variable 变量名
type: string[]
property: functionHook 解析器函数名
type: string[]
property: parserFunction 变量或解析器函数
type: [Record<string, string>, Record<string, string>, string[], string[]]
property: doubleUnderscore 状态开关
type: [string[], string[], Record<string, string>?, Record<string, string>?]
property: protocol 外部链接协议
type: string
property: interwiki 跨维基前缀
type: string[]
property: img 图片参数
type: Record<string, string>
property: redirection 重定向魔术字
type: string[]
property: variants 语言变体
type: string[]
property: articlePath $wgArticlePath,可选
type: string
property: conversionTable 单向转换表,可选
type: [string, string][]
property: redirects 重定向,可选
type: [string, string][]
展开
加入的版本:1.22.0
一个用于 #invoke 解析器函数的基本的 JSON frame 对象。
property: args 传递给模块的参数
type: Record<string, string>
property: parent 父 frame,如果有的话
type: Frame | undefined
property: title 模块名
type: string
展开
加入的版本:1.25.1
用于语法检查设置的 JSON 对象。
property: rules 规则设置
type: Record<LintError.Rule, unknown>
property: computeEditInfo 是否计算各语法错误的快速修复建议,默认为 true
type: boolean
property: fix 是否计算修复全文所有错误的建议,默认为 true
type: boolean
property: ignoreDisables 是否忽略内联配置注释,默认为 false
type: boolean
✅ 展开
语法错误。
property: rule 规则名
type: LintError.Rule
property: message 错误类型
type: string
property: severity 错误等级
type: 'error' | 'warning'
property: startIndex 起始位置
type: number
property: endIndex 结束位置
type: number
property: startLine 起始行
type: number
property: endLine 结束行
type: number
property: startCol 起始列
type: number
property: endCol 结束列
type: number
property: fix 自动修复,可选
type: LintError.Fix
property: suggestions 修复建议,可选
type: LintError.Fix[]
✅ 展开
语法错误的修复建议。
property: range 起始和结束位置
type: [number, number]
property: text 替换文本
type: string
property: desc 描述
type: string