@markuplint/ml-ast
Advanced tools
Comparing version 3.0.0-dev.186 to 3.0.0-dev.290
@@ -1,1 +0,1 @@ | ||
export * from './types'; | ||
export * from './types.js'; |
@@ -1,4 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
export * from './types.js'; |
export interface MLToken { | ||
readonly 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 { | ||
readonly 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 { | ||
readonly type: 'doctype'; | ||
name: string; | ||
readonly publicId: string; | ||
readonly systemId: string; | ||
readonly type: 'doctype'; | ||
name: string; | ||
readonly publicId: string; | ||
readonly systemId: string; | ||
} | ||
export interface MLASTElement extends MLASTAbstractNode { | ||
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; | ||
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; | ||
} | ||
@@ -60,18 +51,18 @@ /** | ||
export interface MLASTElementCloseTag extends MLASTAbstractNode { | ||
readonly type: 'endtag'; | ||
readonly namespace: string; | ||
attributes: MLASTAttr[]; | ||
childNodes?: MLASTNode[]; | ||
pearNode: MLASTTag | null; | ||
readonly tagOpenChar: string; | ||
readonly 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 { | ||
readonly 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[]; | ||
} | ||
@@ -81,65 +72,62 @@ export type MLASTTag = MLASTElement | MLASTElementCloseTag; | ||
export interface MLASTComment extends MLASTAbstractNode { | ||
readonly type: 'comment'; | ||
readonly type: 'comment'; | ||
} | ||
export interface MLASTText extends MLASTAbstractNode { | ||
readonly type: 'text'; | ||
readonly type: 'text'; | ||
} | ||
export type MLASTAttr = MLASTHTMLAttr | MLASTPreprocessorSpecificAttr; | ||
export interface MLASTHTMLAttr extends MLASTAbstractNode { | ||
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; | ||
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 { | ||
readonly type: 'ps-attr'; | ||
readonly potentialName: string; | ||
readonly potentialValue: string; | ||
readonly 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[]; | ||
readonly isFragment: boolean; | ||
unknownParseError?: string; | ||
nodeList: MLASTNode[]; | ||
readonly isFragment: boolean; | ||
unknownParseError?: string; | ||
} | ||
export interface MLMarkupLanguageParser { | ||
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; | ||
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; | ||
} | ||
@@ -155,18 +143,10 @@ /** | ||
export type ParserOptions = { | ||
readonly ignoreFrontMatter?: boolean; | ||
readonly authoredElementName?: ParserAuthoredElementNameDistinguishing; | ||
readonly ignoreFrontMatter?: boolean; | ||
readonly authoredElementName?: ParserAuthoredElementNameDistinguishing; | ||
}; | ||
export type ParserAuthoredElementNameDistinguishing = | ||
| string | ||
| Readonly<RegExp> | ||
| Readonly<ParserAuthoredElementNameDistinguishingFunction> | ||
| readonly (string | Readonly<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'; |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
export {}; |
{ | ||
"name": "@markuplint/ml-ast", | ||
"version": "3.0.0-dev.186+37ceba57", | ||
"version": "3.0.0-dev.290+af676442", | ||
"description": "The markuplint AST types.", | ||
@@ -9,3 +9,8 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"private": false, | ||
"main": "lib/index.js", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": "./lib/index.js" | ||
} | ||
}, | ||
"types": "lib/index.d.ts", | ||
@@ -22,3 +27,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "37ceba578aff49e0326c5e374cef3da6be303b25" | ||
"gitHead": "af6764422feecb56d1d84659028f53daf685bb78" | ||
} |
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
7316
Yes
152