Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@markuplint/ml-ast

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markuplint/ml-ast - npm Package Compare versions

Comparing version 2.0.0-rc.6 to 2.0.0

171

lib/types.d.ts
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;
uuid: string;
raw: string;
startOffset: number;
endOffset: number;
startLine: number;
endLine: number;
startCol: number;
endCol: number;
[extendKey: `__${string}`]: string | number | boolean | null;
}

@@ -15,53 +15,53 @@ export declare type MLASTNodeType = 'doctype' | 'starttag' | 'endtag' | 'comment' | 'text' | 'omittedtag' | 'psblock';

export interface MLASTAbstructNode extends MLToken {
type: MLASTNodeType;
nodeName: string;
parentNode: MLASTParentNode | null;
prevNode: MLASTNode | null;
nextNode: MLASTNode | null;
isFragment: boolean;
isGhost: boolean;
type: MLASTNodeType;
nodeName: string;
parentNode: MLASTParentNode | null;
prevNode: MLASTNode | null;
nextNode: MLASTNode | null;
isFragment: boolean;
isGhost: boolean;
}
export interface MLASTDoctype extends MLASTAbstructNode {
type: 'doctype';
name: string;
publicId: string;
systemId: string;
type: 'doctype';
name: string;
publicId: string;
systemId: string;
}
export interface MLASTElement extends MLASTAbstructNode {
type: 'starttag';
namespace: string;
attributes: MLASTAttr[];
hasSpreadAttr: boolean;
childNodes?: MLASTNode[];
pearNode: MLASTElementCloseTag | null;
selfClosingSolidus?: MLToken;
endSpace?: MLToken;
tagOpenChar: string;
tagCloseChar: string;
isCustomElement: boolean;
type: 'starttag';
namespace: string;
attributes: MLASTAttr[];
hasSpreadAttr: boolean;
childNodes?: MLASTNode[];
pearNode: MLASTElementCloseTag | null;
selfClosingSolidus?: MLToken;
endSpace?: MLToken;
tagOpenChar: string;
tagCloseChar: string;
isCustomElement: boolean;
}
export interface MLASTElementCloseTag extends MLASTAbstructNode {
type: 'endtag';
namespace: string;
attributes: MLASTAttr[];
childNodes?: MLASTNode[];
pearNode: MLASTTag | null;
tagOpenChar: string;
tagCloseChar: string;
isCustomElement: boolean;
type: 'endtag';
namespace: string;
attributes: MLASTAttr[];
childNodes?: MLASTNode[];
pearNode: MLASTTag | null;
tagOpenChar: string;
tagCloseChar: string;
isCustomElement: boolean;
}
export interface MLASTOmittedElement extends MLASTAbstructNode {
type: 'omittedtag';
namespace: string;
childNodes?: MLASTNode[];
isCustomElement: boolean;
type: 'omittedtag';
namespace: string;
childNodes?: MLASTNode[];
isCustomElement: boolean;
}
export interface MLASTPreprocessorSpecificBlock extends MLASTAbstructNode {
type: 'psblock';
nodeName: string;
parentNode: MLASTParentNode | null;
prevNode: MLASTNode | null;
nextNode: MLASTNode | null;
childNodes?: MLASTNode[];
branchedChildNodes?: MLASTNode[];
type: 'psblock';
nodeName: string;
parentNode: MLASTParentNode | null;
prevNode: MLASTNode | null;
nextNode: MLASTNode | null;
childNodes?: MLASTNode[];
branchedChildNodes?: MLASTNode[];
}

@@ -71,46 +71,55 @@ export declare type MLASTTag = MLASTElement | MLASTElementCloseTag | MLASTOmittedElement;

export interface MLASTComment extends MLASTAbstructNode {
type: 'comment';
type: 'comment';
}
export interface MLASTText extends MLASTAbstructNode {
type: 'text';
type: 'text';
}
export declare type MLASTAttr = MLASTHTMLAttr | MLASTPreprocessorSpecificAttr;
export interface MLASTHTMLAttr extends MLToken {
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;
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;
}
export interface MLASTPreprocessorSpecificAttr extends MLToken {
type: 'ps-attr';
potentialName: string;
potentialValue: string;
valueType: 'string' | 'number' | 'boolean' | 'code';
isDuplicatable: boolean;
type: 'ps-attr';
potentialName: string;
potentialValue: string;
valueType: 'string' | 'number' | 'boolean' | 'code';
isDuplicatable: boolean;
}
export interface MLASTDocument {
nodeList: MLASTNode[];
isFragment: boolean;
unkownParseError?: string;
nodeList: MLASTNode[];
isFragment: boolean;
unkownParseError?: string;
}
export interface MLMarkupLanguageParser {
parse(sourceCode: string, offsetOffset?: number, offsetLine?: number, offsetColumn?: number, ignoreFrontMatter?: boolean): MLASTDocument;
tagNameCaseSensitive?: boolean;
/**
* @default "omittable"
*/
endTag?: 'xml' | 'omittable' | 'never';
parse(
sourceCode: string,
offsetOffset?: number,
offsetLine?: number,
offsetColumn?: number,
ignoreFrontMatter?: boolean,
): MLASTDocument;
tagNameCaseSensitive?: boolean;
/**
* @default "omittable"
*/
endTag?: 'xml' | 'omittable' | 'never';
}
export declare type Parse = MLMarkupLanguageParser['parse'];
export declare type Walker = (node: MLASTNode, depth: number) => void;
export declare type NamespaceURI = 'http://www.w3.org/1999/xhtml' | 'http://www.w3.org/2000/svg' | 'http://www.w3.org/1998/Math/MathML';
export declare type NamespaceURI =
| 'http://www.w3.org/1999/xhtml'
| 'http://www.w3.org/2000/svg'
| 'http://www.w3.org/1998/Math/MathML';
{
"name": "@markuplint/ml-ast",
"version": "2.0.0-rc.6",
"version": "2.0.0",
"description": "The markuplint AST types.",

@@ -18,3 +18,3 @@ "repository": "git@github.com:markuplint/markuplint.git",

},
"gitHead": "7c93367a86f935f6b94780b1fa14f3293f900b87"
"gitHead": "de81fc514acdf472f87184e3499e9364258f9b66"
}

@@ -9,4 +9,2 @@ # @markuplint/ml-ast

Prerequisites: [Node.js](https://nodejs.org) (Version 12.4.0 or later)
```sh

@@ -17,14 +15,1 @@ $ npm install @markuplint/ml-ast

```
## Contributing
```
$ git clone git@github.com:markuplint/markuplint.git -b main
$ yarn
$ yarn build
$ yarn test
```
---
Copyright © 2021 markuplint. Under the MIT License.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc