// Type definitions for css // Project: https://github.com/reworkcss/css // Definitions by: Ilya Verbitskiy // Definitions: https://github.com/ilich/DefinitelyTyped declare module "css" { // Options interface ParserOptions { silent?: boolean; source?: string; } interface StringifyOptions { indent?: string; compress?: boolean; sourcemap?: string; inputSourcemaps?: boolean; } // Errors interface ParserError { message?: string; reason?: string; filename?: string; line?: number; column?: number; source?: string; } // AST Tree interface Position { line?: number; column?: number; } interface Node { type?: string; parent?: Node; position?: { start?: Position; end?: Position; source?: string; content?: string; }; } interface Rule extends Node { selectors?: Array; declarations?: Array; } interface Declaration extends Node { property?: string; value?: string; } interface Comment extends Node { comment?: string; } interface Charset { charset?: string; } interface CustomMedia { name?: string; media?: string; } interface Document { document?: string; vendor?: string; rules?: Array; } interface FontFace { declarations?: Array; } interface Host { rules?: Array; } interface Import { import?: string; } interface KeyFrames { name?: string; vendor?: string; keyframes?: Array; } interface KeyFrame { values?: Array; declarations?: Array; } interface Media { media?: string; rules?: Array; } interface Namespace { namespace?: string; } interface Page { selectors?: Array; declarations?: Array; } interface Supports { supports?: string; rules?: Array; } type AtRule = Charset|CustomMedia|Document|FontFace|Host|Import|KeyFrames|Media|Namespace|Page|Supports; interface Stylesheet extends Node { stylesheet?: { rules?: Array; parsingErrors?: Array }; } // API function parse(code?: string, options?: ParserOptions): Stylesheet; function stringify(stylesheet?: Stylesheet, options?: StringifyOptions): string; }