-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE
- Loading branch information
Showing
7 changed files
with
115 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from "./parse"; | ||
export { default as parse } from "./parse"; | ||
export { default as stringify } from "./stringify"; | ||
export * from "./types"; | ||
export { isTraversal, parse } from "./parse"; | ||
export { stringify } from "./stringify"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
export interface Options { | ||
/** | ||
* When false, tag names will not be lowercased. | ||
* @default true | ||
*/ | ||
lowerCaseAttributeNames?: boolean; | ||
/** | ||
* When false, attribute names will not be lowercased. | ||
* @default true | ||
*/ | ||
lowerCaseTags?: boolean; | ||
/** | ||
* When `true`, `xmlMode` implies both `lowerCaseTags` and `lowerCaseAttributeNames` are set to `false`. | ||
* Also, `ignoreCase` on attributes will not be inferred based on HTML rules anymore. | ||
* @default false | ||
*/ | ||
xmlMode?: boolean; | ||
} | ||
|
||
export type Selector = | ||
| PseudoSelector | ||
| PseudoElement | ||
| AttributeSelector | ||
| TagSelector | ||
| UniversalSelector | ||
| Traversal; | ||
|
||
export interface AttributeSelector { | ||
type: "attribute"; | ||
name: string; | ||
action: AttributeAction; | ||
value: string; | ||
ignoreCase: boolean | null; | ||
namespace: string | null; | ||
} | ||
|
||
export type DataType = Selector[][] | null | string; | ||
|
||
export interface PseudoSelector { | ||
type: "pseudo"; | ||
name: string; | ||
data: DataType; | ||
} | ||
|
||
export interface PseudoElement { | ||
type: "pseudo-element"; | ||
name: string; | ||
} | ||
|
||
export interface TagSelector { | ||
type: "tag"; | ||
name: string; | ||
namespace: string | null; | ||
} | ||
|
||
export interface UniversalSelector { | ||
type: "universal"; | ||
namespace: string | null; | ||
} | ||
|
||
export interface Traversal { | ||
type: TraversalType; | ||
} | ||
|
||
export type AttributeAction = | ||
| "any" | ||
| "element" | ||
| "end" | ||
| "equals" | ||
| "exists" | ||
| "hyphen" | ||
| "not" | ||
| "start"; | ||
|
||
export type TraversalType = | ||
| "adjacent" | ||
| "child" | ||
| "descendant" | ||
| "parent" | ||
| "sibling"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"target": "ES2019", | ||
"module": "es2015", | ||
"outDir": "lib/es", | ||
"moduleResolution": "node" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters