htmljs-parser
Advanced tools
Comparing version 5.1.5 to 5.2.0
@@ -7,3 +7,4 @@ import { StateDefinition, Range, Ranges, Meta } from "../internal"; | ||
ARGUMENT = 3, | ||
BLOCK = 4 | ||
TYPE_PARAMS = 4, | ||
BLOCK = 5 | ||
} | ||
@@ -15,2 +16,3 @@ export interface AttrMeta extends Meta { | ||
args: boolean | Ranges.AttrMethod["params"]; | ||
typeParams: undefined | Ranges.Value; | ||
spread: boolean; | ||
@@ -17,0 +19,0 @@ bound: boolean; |
@@ -6,4 +6,5 @@ import { StateDefinition, Ranges, Meta, TagType } from "../internal"; | ||
ARGUMENT = 2, | ||
PARAMS = 3, | ||
ATTR_GROUP = 4 | ||
TYPES = 3, | ||
PARAMS = 4, | ||
ATTR_GROUP = 5 | ||
} | ||
@@ -19,2 +20,4 @@ export interface OpenTagMeta extends Meta { | ||
hasAttrs: boolean; | ||
hasParams: boolean; | ||
types: undefined | Ranges.Value; | ||
hasShorthandId: boolean; | ||
@@ -21,0 +24,0 @@ selfClosed: boolean; |
import { CODE, StateDefinition, Ranges, Meta } from "../internal"; | ||
export interface TagNameMeta extends Meta, Ranges.Template { | ||
shorthandCode?: CODE.NUMBER_SIGN | CODE.PERIOD; | ||
shorthandCode: -1 | CODE.NUMBER_SIGN | CODE.PERIOD; | ||
} | ||
export declare const TAG_NAME: StateDefinition<TagNameMeta>; |
@@ -93,2 +93,3 @@ export declare const enum CODE { | ||
params: Value; | ||
typeParams: Value | undefined; | ||
} | ||
@@ -125,3 +126,6 @@ interface OpenTagEnd extends Range { | ||
RESERVED_TAG_NAME = 24, | ||
ROOT_TAG_ONLY = 25 | ||
ROOT_TAG_ONLY = 25, | ||
INVALID_TAG_PARAMS = 26, | ||
INVALID_TAG_TYPES = 27, | ||
INVALID_ATTR_TYPE_PARAMS = 28 | ||
} | ||
@@ -147,4 +151,6 @@ export declare const enum TagType { | ||
onTagShorthandClass?(data: Ranges.Template): void; | ||
onTagTypeArgs?(data: Ranges.Value): void; | ||
onTagVar?(data: Ranges.Value): void; | ||
onTagArgs?(data: Ranges.Value): void; | ||
onTagTypeParams?(data: Ranges.Value): void; | ||
onTagParams?(data: Ranges.Value): void; | ||
@@ -151,0 +157,0 @@ onAttrName?(data: Range): void; |
@@ -18,4 +18,5 @@ import { type Parser } from "../internal"; | ||
export declare function htmlEOF(this: Parser): void; | ||
export declare function matchesCloseAngleBracket(code: number): boolean; | ||
export declare function matchesCloseParen(code: number): boolean; | ||
export declare function matchesCloseCurlyBrace(code: number): boolean; | ||
export declare function matchesPipe(code: number): boolean; |
{ | ||
"name": "htmljs-parser", | ||
"description": "An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values", | ||
"version": "5.1.5", | ||
"version": "5.2.0", | ||
"devDependencies": { | ||
"@changesets/changelog-github": "^0.4.6", | ||
"@changesets/cli": "^2.24.1", | ||
"@changesets/changelog-github": "^0.4.7", | ||
"@changesets/cli": "^2.25.2", | ||
"@types/degit": "^2.8.3", | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^18.6.4", | ||
"@typescript-eslint/eslint-plugin": "^5.32.0", | ||
"@typescript-eslint/parser": "^5.32.0", | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "^18.11.9", | ||
"@typescript-eslint/eslint-plugin": "^5.42.0", | ||
"@typescript-eslint/parser": "^5.42.0", | ||
"cross-env": "^7.0.3", | ||
"degit": "^2.8.4", | ||
"esbuild": "0.14.53", | ||
"eslint": "^8.21.0", | ||
"esbuild": "0.15.13", | ||
"eslint": "^8.26.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"fast-glob": "^3.2.11", | ||
"fast-glob": "^3.2.12", | ||
"fixpack": "^4.0.0", | ||
@@ -23,8 +23,8 @@ "husky": "^8.0.1", | ||
"mitata": "^0.1.6", | ||
"mocha": "^10.0.0", | ||
"mocha": "^10.1.0", | ||
"mocha-snap": "^4.3.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.7.1", | ||
"tsx": "^3.8.0", | ||
"typescript": "^4.7.4" | ||
"tsx": "^3.11.0", | ||
"typescript": "^4.8.4" | ||
}, | ||
@@ -31,0 +31,0 @@ "exports": { |
@@ -253,2 +253,14 @@ <h1 align="center"> | ||
/** | ||
* Called after the type arguments for a tag have been parsed. | ||
* | ||
* @example | ||
* 1╭─ <foo<string>> | ||
* │ │╰─ tagTypeArgs.value "string" | ||
* ╰─ ╰─ tagTypeArgs "<string>" | ||
*/ | ||
onTagTypeArgs(range) { | ||
range.value; // Another range that includes only the type arguments themselves and not the angle brackets. | ||
}, | ||
/** | ||
* Called after a tag variable has been parsed. | ||
@@ -278,2 +290,14 @@ * | ||
/** | ||
* Called after type parameters for the tag parameters have been parsed. | ||
* | ||
* @example | ||
* 1╭─ <tag<T>|input: { name: T }|> | ||
* │ │╰─ tagTypeParams.value | ||
* ╰─ ╰─ tagTypeParams "<T>" | ||
*/ | ||
onTagTypeParams(range) { | ||
range.value; // Another range that includes only the type params themselves and not the angle brackets. | ||
}, | ||
/** | ||
* Called after tag parameters have been parsed. | ||
@@ -339,2 +363,5 @@ * | ||
onAttrMethod(range) { | ||
range.typeParams; // Another range which includes the type params for the method. | ||
range.typeParams.value; // Another range which includes the type params without outer angle brackets. | ||
range.params; // Another range which includes the params for the method. | ||
@@ -341,0 +368,0 @@ range.params.value; // Another range which includes the method params without outer parenthesis. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
181273
5629
451