@markuplint/ml-ast
Advanced tools
Comparing version 3.0.0-dev.96 to 3.0.0-dev.176
export interface MLToken { | ||
uuid: string; | ||
raw: string; | ||
startOffset: number; | ||
endOffset: number; | ||
startLine: number; | ||
endLine: number; | ||
startCol: number; | ||
endCol: number; | ||
[extendKey: `__${string}`]: string | number | boolean | null; | ||
readonly uuid: string; | ||
raw: string; | ||
startOffset: number; | ||
endOffset: number; | ||
startLine: number; | ||
endLine: number; | ||
startCol: number; | ||
endCol: number; | ||
[extendKey: `__${string}`]: string | number | boolean | null; | ||
} | ||
export type MLASTNodeType = 'doctype' | 'starttag' | 'endtag' | 'comment' | 'text' | 'omittedtag' | 'psblock' | 'html-attr' | 'ps-attr'; | ||
export type MLASTNodeType = | ||
| 'doctype' | ||
| 'starttag' | ||
| 'endtag' | ||
| 'comment' | ||
| 'text' | ||
| 'omittedtag' | ||
| 'psblock' | ||
| 'html-attr' | ||
| 'ps-attr'; | ||
export type MLASTNode = MLASTDoctype | MLASTTag | MLASTComment | MLASTText | MLASTPreprocessorSpecificBlock | MLASTAttr; | ||
export interface MLASTAbstractNode extends MLToken { | ||
type: MLASTNodeType; | ||
nodeName: string; | ||
parentNode: MLASTParentNode | null; | ||
prevNode: MLASTNode | null; | ||
nextNode: MLASTNode | null; | ||
isFragment: boolean; | ||
isGhost: boolean; | ||
readonly type: MLASTNodeType; | ||
nodeName: string; | ||
parentNode: MLASTParentNode | null; | ||
prevNode: MLASTNode | null; | ||
nextNode: MLASTNode | null; | ||
isFragment: boolean; | ||
isGhost: boolean; | ||
} | ||
export interface MLASTDoctype extends MLASTAbstractNode { | ||
type: 'doctype'; | ||
name: string; | ||
publicId: string; | ||
systemId: string; | ||
readonly type: 'doctype'; | ||
name: string; | ||
readonly publicId: string; | ||
readonly systemId: string; | ||
} | ||
export interface MLASTElement extends MLASTAbstractNode { | ||
type: 'starttag'; | ||
namespace: string; | ||
elementType: ElementType; | ||
attributes: MLASTAttr[]; | ||
hasSpreadAttr: boolean; | ||
childNodes?: MLASTNode[]; | ||
pearNode: MLASTElementCloseTag | null; | ||
selfClosingSolidus?: MLToken; | ||
endSpace?: MLToken; | ||
tagOpenChar: string; | ||
tagCloseChar: string; | ||
readonly type: 'starttag'; | ||
namespace: string; | ||
elementType: ElementType; | ||
attributes: MLASTAttr[]; | ||
hasSpreadAttr: boolean; | ||
childNodes?: MLASTNode[]; | ||
pearNode: MLASTElementCloseTag | null; | ||
readonly selfClosingSolidus?: MLToken; | ||
readonly endSpace?: MLToken; | ||
readonly tagOpenChar: string; | ||
readonly tagCloseChar: string; | ||
} | ||
@@ -51,18 +60,18 @@ /** | ||
export interface MLASTElementCloseTag extends MLASTAbstractNode { | ||
type: 'endtag'; | ||
namespace: string; | ||
attributes: MLASTAttr[]; | ||
childNodes?: MLASTNode[]; | ||
pearNode: MLASTTag | null; | ||
tagOpenChar: string; | ||
tagCloseChar: string; | ||
readonly type: 'endtag'; | ||
readonly namespace: string; | ||
attributes: MLASTAttr[]; | ||
childNodes?: MLASTNode[]; | ||
pearNode: MLASTTag | null; | ||
readonly tagOpenChar: string; | ||
readonly tagCloseChar: string; | ||
} | ||
export interface MLASTPreprocessorSpecificBlock extends MLASTAbstractNode { | ||
type: 'psblock'; | ||
nodeName: string; | ||
parentNode: MLASTParentNode | null; | ||
prevNode: MLASTNode | null; | ||
nextNode: MLASTNode | null; | ||
childNodes?: MLASTNode[]; | ||
branchedChildNodes?: MLASTNode[]; | ||
readonly type: 'psblock'; | ||
nodeName: string; | ||
parentNode: MLASTParentNode | null; | ||
prevNode: MLASTNode | null; | ||
nextNode: MLASTNode | null; | ||
childNodes?: MLASTNode[]; | ||
branchedChildNodes?: MLASTNode[]; | ||
} | ||
@@ -72,62 +81,65 @@ export type MLASTTag = MLASTElement | MLASTElementCloseTag; | ||
export interface MLASTComment extends MLASTAbstractNode { | ||
type: 'comment'; | ||
readonly type: 'comment'; | ||
} | ||
export interface MLASTText extends MLASTAbstractNode { | ||
type: 'text'; | ||
readonly type: 'text'; | ||
} | ||
export type MLASTAttr = MLASTHTMLAttr | MLASTPreprocessorSpecificAttr; | ||
export interface MLASTHTMLAttr extends MLASTAbstractNode { | ||
type: 'html-attr'; | ||
spacesBeforeName: MLToken; | ||
name: MLToken; | ||
spacesBeforeEqual: MLToken; | ||
equal: MLToken; | ||
spacesAfterEqual: MLToken; | ||
startQuote: MLToken; | ||
value: MLToken; | ||
endQuote: MLToken; | ||
isDynamicValue?: true; | ||
isDirective?: true; | ||
potentialName?: string; | ||
candidate?: string; | ||
isDuplicatable: boolean; | ||
parentNode: null; | ||
nextNode: null; | ||
prevNode: null; | ||
isFragment: false; | ||
isGhost: false; | ||
readonly type: 'html-attr'; | ||
spacesBeforeName: MLToken; | ||
name: MLToken; | ||
spacesBeforeEqual: MLToken; | ||
equal: MLToken; | ||
spacesAfterEqual: MLToken; | ||
startQuote: MLToken; | ||
value: MLToken; | ||
endQuote: MLToken; | ||
isDynamicValue?: true; | ||
isDirective?: true; | ||
potentialName?: string; | ||
candidate?: string; | ||
isDuplicatable: boolean; | ||
parentNode: null; | ||
nextNode: null; | ||
prevNode: null; | ||
isFragment: false; | ||
isGhost: false; | ||
} | ||
export interface MLASTPreprocessorSpecificAttr extends MLASTAbstractNode { | ||
type: 'ps-attr'; | ||
potentialName: string; | ||
potentialValue: string; | ||
valueType: 'string' | 'number' | 'boolean' | 'code'; | ||
isDuplicatable: boolean; | ||
readonly type: 'ps-attr'; | ||
readonly potentialName: string; | ||
readonly potentialValue: string; | ||
readonly valueType: 'string' | 'number' | 'boolean' | 'code'; | ||
isDuplicatable: boolean; | ||
} | ||
export interface MLASTDocument { | ||
nodeList: MLASTNode[]; | ||
isFragment: boolean; | ||
unknownParseError?: string; | ||
nodeList: MLASTNode[]; | ||
readonly isFragment: boolean; | ||
unknownParseError?: string; | ||
} | ||
export interface MLMarkupLanguageParser { | ||
parse(sourceCode: string, options?: ParserOptions & { | ||
offsetOffset?: number; | ||
offsetLine?: number; | ||
offsetColumn?: number; | ||
}): MLASTDocument; | ||
/** | ||
* @default "omittable" | ||
*/ | ||
endTag?: EndTagType; | ||
/** | ||
* Detect value as a true if its attribute is booleanish value and omitted. | ||
* | ||
* Ex: | ||
* ```jsx | ||
* <Component aria-hidden /> | ||
* ``` | ||
* | ||
* In the above, the `aria-hidden` is `true`. | ||
*/ | ||
booleanish?: boolean; | ||
parse( | ||
sourceCode: string, | ||
options?: ParserOptions & { | ||
readonly offsetOffset?: number; | ||
readonly offsetLine?: number; | ||
readonly offsetColumn?: number; | ||
}, | ||
): MLASTDocument; | ||
/** | ||
* @default "omittable" | ||
*/ | ||
endTag?: EndTagType; | ||
/** | ||
* Detect value as a true if its attribute is booleanish value and omitted. | ||
* | ||
* Ex: | ||
* ```jsx | ||
* <Component aria-hidden /> | ||
* ``` | ||
* | ||
* In the above, the `aria-hidden` is `true`. | ||
*/ | ||
booleanish?: boolean; | ||
} | ||
@@ -143,10 +155,18 @@ /** | ||
export type ParserOptions = { | ||
ignoreFrontMatter?: boolean; | ||
authoredElementName?: ParserAuthoredElementNameDistinguishing; | ||
readonly ignoreFrontMatter?: boolean; | ||
readonly authoredElementName?: ParserAuthoredElementNameDistinguishing; | ||
}; | ||
export type ParserAuthoredElementNameDistinguishing = string | RegExp | ParserAuthoredElementNameDistinguishingFunction | (string | RegExp | ParserAuthoredElementNameDistinguishingFunction)[]; | ||
export type ParserAuthoredElementNameDistinguishing = | ||
| string | ||
| Readonly<RegExp> | ||
| Readonly<ParserAuthoredElementNameDistinguishingFunction> | ||
| readonly (string | Readonly<RegExp> | ParserAuthoredElementNameDistinguishingFunction)[]; | ||
export type ParserAuthoredElementNameDistinguishingFunction = (name: string) => boolean; | ||
export type Parse = MLMarkupLanguageParser['parse']; | ||
export type Walker = (node: MLASTNode, depth: number) => void; | ||
export type NamespaceURI = 'http://www.w3.org/1999/xhtml' | 'http://www.w3.org/2000/svg' | 'http://www.w3.org/1998/Math/MathML' | 'http://www.w3.org/1999/xlink'; | ||
export type NamespaceURI = | ||
| 'http://www.w3.org/1999/xhtml' | ||
| 'http://www.w3.org/2000/svg' | ||
| 'http://www.w3.org/1998/Math/MathML' | ||
| 'http://www.w3.org/1999/xlink'; | ||
export type Namespace = 'html' | 'svg' | 'mml' | 'xlink'; |
{ | ||
"name": "@markuplint/ml-ast", | ||
"version": "3.0.0-dev.96+3b9f1720", | ||
"version": "3.0.0-dev.176+f6ad62e9", | ||
"description": "The markuplint AST types.", | ||
@@ -21,3 +21,3 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
}, | ||
"gitHead": "3b9f17205d7754b29edf790bdbbf5e4931ba27a2" | ||
"gitHead": "f6ad62e992e1569be4067f1e90d2d6017a658f57" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
7196
176