@types/css-tree
Advanced tools
Comparing version 1.0.3 to 1.0.4
// Type definitions for css-tree 1.0 | ||
// Project: https://github.com/csstree/csstree | ||
// Definitions by: Erik Källén <https://github.com/erik-kallen> | ||
// Jason Kratzer <https://github.com/pyoor> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -621,1 +622,194 @@ // TypeScript Version: 2.7 | ||
export function toPlainObject(node: CssNode): CssNodePlain; | ||
/** | ||
* Definition syntax AtWord node | ||
*/ | ||
export interface DSNodeAtWord { | ||
type: 'AtKeyword'; | ||
name: string; | ||
} | ||
/** | ||
* Definition syntax Comma node | ||
*/ | ||
export interface DSNodeComma { | ||
type: 'Comma'; | ||
} | ||
/** | ||
* Definition syntax Function node | ||
*/ | ||
export interface DSNodeFunction { | ||
type: 'Function'; | ||
name: string; | ||
} | ||
export type DSNodeCombinator = '|' | '||' | '&&' | ' '; | ||
/** | ||
* Definition syntax Group node | ||
*/ | ||
export interface DSNodeGroup { | ||
type: 'Group'; | ||
terms: DSNode[]; | ||
combinator: DSNodeCombinator; | ||
disallowEmpty: boolean; | ||
explicit: boolean; | ||
} | ||
/** | ||
* Definition syntax Keyword node | ||
*/ | ||
export interface DSNodeKeyword { | ||
type: 'Keyword'; | ||
name: string; | ||
} | ||
/** | ||
* Definition syntax Multiplier node | ||
*/ | ||
export interface DSNodeMultiplier { | ||
type: 'Multiplier'; | ||
comma: boolean; | ||
min: number; | ||
max: number; | ||
term: DSNodeMultiplied; | ||
} | ||
/** | ||
* Definition syntax Property node | ||
*/ | ||
export interface DSNodeProperty { | ||
type: 'Property'; | ||
name: string; | ||
} | ||
/** | ||
* Definition syntax String node | ||
*/ | ||
export interface DSNodeString { | ||
type: 'String'; | ||
value: string; | ||
} | ||
/** | ||
* Definition syntax Token node | ||
*/ | ||
export interface DSNodeToken { | ||
type: 'Token'; | ||
value: string; | ||
} | ||
/** | ||
* Definition syntax Type node options | ||
*/ | ||
export interface DSNodeTypeOpts { | ||
type: 'Range'; | ||
min: number | null; | ||
max: number | null; | ||
} | ||
/** | ||
* Definition syntax Type node | ||
*/ | ||
export interface DSNodeType { | ||
type: 'Type'; | ||
name: string; | ||
opts: DSNodeTypeOpts | null; | ||
} | ||
/** | ||
* Definition syntax node | ||
*/ | ||
export type DSNode = | ||
DSNodeAtWord | ||
| DSNodeComma | ||
| DSNodeFunction | ||
| DSNodeGroup | ||
| DSNodeKeyword | ||
| DSNodeMultiplier | ||
| DSNodeProperty | ||
| DSNodeString | ||
| DSNodeToken | ||
| DSNodeType; | ||
/** | ||
* Definition syntax node compatible with a multiplier | ||
*/ | ||
export type DSNodeMultiplied = | ||
DSNodeFunction | ||
| DSNodeGroup | ||
| DSNodeKeyword | ||
| DSNodeProperty | ||
| DSNodeString | ||
| DSNodeType; | ||
/** | ||
* Definition syntax generate options | ||
*/ | ||
export interface DSGenerateOptions { | ||
forceBraces?: boolean; | ||
compact?: boolean; | ||
decorate?: (result: string, node: DSNode) => void; | ||
} | ||
/** | ||
* Definition syntax walk options | ||
*/ | ||
export interface DSWalkOptions { | ||
enter?: DSWalkEnterOrLeaveFn; | ||
leave?: DSWalkEnterOrLeaveFn; | ||
} | ||
/** | ||
* Definition syntax walk callback | ||
*/ | ||
export type DSWalkEnterOrLeaveFn = (node: DSNode) => void; | ||
/** | ||
* DefinitionSyntax | ||
*/ | ||
export interface DefinitionSyntax { | ||
/** | ||
* Generates CSS value definition syntax from an AST | ||
* | ||
* @param node - The AST | ||
* @param options - Options that affect generation | ||
* | ||
* @example | ||
* generate({type: 'Keyword', name: 'foo'}) => 'foo' | ||
*/ | ||
generate(node: DSNode, options?: DSGenerateOptions): string; | ||
/** | ||
* Generates an AST from a CSS value syntax | ||
* | ||
* @param source - The CSS value syntax to parse | ||
* | ||
* @example | ||
* parse('foo | bar') => | ||
* { | ||
* type: 'Group', | ||
* terms: [ | ||
* { type: 'Keyword', name: 'foo' }, | ||
* { type: 'Keyword', name: 'bar' } | ||
* ], | ||
* combinator: '|', | ||
* disallowEmpty: false, | ||
* explicit: false | ||
* } | ||
*/ | ||
parse(source: string): DSNodeGroup; | ||
/** | ||
* Walks definition syntax AST | ||
*/ | ||
walk(node: DSNode, options: DSWalkEnterOrLeaveFn | DSWalkOptions, context?: any): void; | ||
/** | ||
* Wrapper for syntax errors | ||
*/ | ||
syntaxError: SyntaxError; | ||
} | ||
export const definitionSyntax: DefinitionSyntax; |
{ | ||
"name": "@types/css-tree", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "TypeScript definitions for css-tree", | ||
@@ -11,2 +11,7 @@ "license": "MIT", | ||
"githubUsername": "erik-kallen" | ||
}, | ||
{ | ||
"name": "Jason Kratzer", | ||
"url": "https://github.com/pyoor", | ||
"githubUsername": "pyoor" | ||
} | ||
@@ -23,4 +28,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "d677b050708fdd631a178e09cd715a381de384b1dd60100cf86c16733752e0d6", | ||
"typeScriptVersion": "2.8" | ||
"typesPublisherContentHash": "18466815efe0d82fb289b4a95881160fa3ae327f5261f49627426b6994140c53", | ||
"typeScriptVersion": "3.2" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Sat, 07 Dec 2019 01:18:34 GMT | ||
* Last updated: Wed, 18 Nov 2020 19:32:44 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Erik Källén (https://github.com/erik-kallen). | ||
These definitions were written by [Erik Källén](https://github.com/erik-kallen), and [Jason Kratzer](https://github.com/pyoor). |
Sorry, the diff of this file is not supported yet
22392
707