summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@csstools/css-parser-algorithms/dist/index.d.ts')
-rw-r--r--node_modules/@csstools/css-parser-algorithms/dist/index.d.ts43
1 files changed, 17 insertions, 26 deletions
diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
index 9759d057..9889d9ea 100644
--- a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
+++ b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts
@@ -15,7 +15,7 @@
* Parse a string of CSS into a component value:
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseComponentValue } from '@csstools/css-parser';
+ * import { parseComponentValue } from '@csstools/css-parser-algorithms';
*
* const myCSS = `calc(1px * 2)`;
*
@@ -35,15 +35,15 @@
* If your context allows a list of component values, use {@link parseListOfComponentValues}:
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseListOfComponentValues } from '@csstools/css-parser';
+ * import { parseListOfComponentValues } from '@csstools/css-parser-algorithms';
*
- * parseComponentValue(tokenize({ css: `10x 20px` }));
+ * parseListOfComponentValues(tokenize({ css: `10x 20px` }));
* ```
*
* If your context allows a comma-separated list of component values, use {@link parseCommaSeparatedListOfComponentValues}:
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser';
+ * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` }));
* ```
@@ -53,7 +53,7 @@
*
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseComponentValue, isSimpleBlockNode } from '@csstools/css-parser';
+ * import { parseComponentValue, isSimpleBlockNode } from '@csstools/css-parser-algorithms';
*
* const myCSS = `calc(1px * (5 / 2))`;
*
@@ -106,10 +106,7 @@ export declare class CommentNode {
* A debug helper to convert the current object to a JSON representation.
* This is useful in asserts and to store large ASTs in files.
*/
- toJSON(): {
- type: ComponentValueType;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
@@ -344,14 +341,14 @@ export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode;
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser';
+ * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `20deg, 50%, 30%` }));
* ```
*/
export declare function parseCommaSeparatedListOfComponentValues(tokens: Array<CSSToken>, options?: {
onParseError?: (error: ParseError) => void;
-}): ComponentValue[][];
+}): Array<Array<ComponentValue>>;
/**
* Parse a single component value.
@@ -359,7 +356,7 @@ export declare function parseCommaSeparatedListOfComponentValues(tokens: Array<C
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser';
+ * import { parseCommaSeparatedListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `10px` }));
* parseCommaSeparatedListOfComponentValues(tokenize({ css: `calc((10px + 1x) * 4)` }));
@@ -375,20 +372,20 @@ export declare function parseComponentValue(tokens: Array<CSSToken>, options?: {
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseListOfComponentValues } from '@csstools/css-parser';
+ * import { parseListOfComponentValues } from '@csstools/css-parser-algorithms';
*
* parseListOfComponentValues(tokenize({ css: `20deg 30%` }));
* ```
*/
export declare function parseListOfComponentValues(tokens: Array<CSSToken>, options?: {
onParseError?: (error: ParseError) => void;
-}): ComponentValue[];
+}): Array<ComponentValue>;
/**
* Replace specific component values in a list of component values.
* A helper for the most common and simplistic cases when mutating an AST.
*/
-export declare function replaceComponentValues(componentValuesList: Array<Array<ComponentValue>>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][];
+export declare function replaceComponentValues(componentValuesList: Array<Array<ComponentValue>>, replaceWith: (componentValue: ComponentValue) => Array<ComponentValue> | ComponentValue | void): Array<Array<ComponentValue>>;
/**
* A simple block node.
@@ -479,7 +476,7 @@ export declare class TokenNode {
/**
* This is the inverse of parsing from a list of tokens.
*/
- tokens(): Array<CSSToken>;
+ tokens(): [CSSToken];
/**
* Convert the current token to a string.
* This is not a true serialization.
@@ -492,14 +489,11 @@ export declare class TokenNode {
* A debug helper to convert the current object to a JSON representation.
* This is useful in asserts and to store large ASTs in files.
*/
- toJSON(): {
- type: ComponentValueType;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/
- isTokenNode(): this is TokenNode;
+ isTokenNod(): this is TokenNode;
/**
* @internal
*/
@@ -524,7 +518,7 @@ export declare class TokenNode {
* @example
* ```js
* import { tokenize } from '@csstools/css-tokenizer';
- * import { parseListOfComponentValues, isSimpleBlockNode } from '@csstools/css-parser';
+ * import { parseListOfComponentValues, isSimpleBlockNode } from '@csstools/css-parser-algorithms';
*
* const myCSS = `calc(1px * (5 / 2)) 10px`;
*
@@ -590,10 +584,7 @@ export declare class WhitespaceNode {
* A debug helper to convert the current object to a JSON representation.
* This is useful in asserts and to store large ASTs in files.
*/
- toJSON(): {
- type: ComponentValueType;
- tokens: CSSToken[];
- };
+ toJSON(): Record<string, unknown>;
/**
* @internal
*/