@stacksjs/ts-css 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +173 -0
- package/LICENSE.md +21 -0
- package/README.md +213 -0
- package/dist/config.d.ts +4 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +7835 -0
- package/dist/optimize/clean/comment.d.ts +2 -0
- package/dist/optimize/clean/declaration.d.ts +2 -0
- package/dist/optimize/clean/index.d.ts +2 -0
- package/dist/optimize/compress/index.d.ts +5 -0
- package/dist/optimize/index.d.ts +13 -0
- package/dist/optimize/index.js +3390 -0
- package/dist/optimize/minify.d.ts +14 -0
- package/dist/optimize/specificity.d.ts +5 -0
- package/dist/parse/clone.d.ts +2 -0
- package/dist/parse/generator.d.ts +2 -0
- package/dist/parse/index.d.ts +58 -0
- package/dist/parse/index.js +2369 -0
- package/dist/parse/list.d.ts +54 -0
- package/dist/parse/parser/index.d.ts +6 -0
- package/dist/parse/tokenizer.d.ts +67 -0
- package/dist/parse/types.d.ts +264 -0
- package/dist/parse/walker.d.ts +55 -0
- package/dist/select/index.d.ts +18 -0
- package/dist/select/index.js +1289 -0
- package/dist/select/types.d.ts +41 -0
- package/dist/types.d.ts +9 -0
- package/dist/what/index.d.ts +20 -0
- package/dist/what/index.js +514 -0
- package/dist/what/parse.d.ts +2 -0
- package/dist/what/stringify.d.ts +2 -0
- package/dist/what/traversal.d.ts +3 -0
- package/dist/what/types.d.ts +66 -0
- package/package.json +123 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CssNode } from '../parse';
|
|
2
|
+
export declare function minify(source: string, options?: MinifyOptions): MinifyResult;
|
|
3
|
+
export declare function minifyBlock(source: string, options?: MinifyOptions): MinifyResult;
|
|
4
|
+
export declare interface MinifyOptions {
|
|
5
|
+
comments?: boolean | 'exclamation' | 'first-exclamation'
|
|
6
|
+
floatPrecision?: number | null
|
|
7
|
+
restructure?: boolean
|
|
8
|
+
forceMediaMerge?: boolean
|
|
9
|
+
usage?: { tags?: string[], ids?: string[], classes?: string[], force?: boolean } | null
|
|
10
|
+
}
|
|
11
|
+
export declare interface MinifyResult {
|
|
12
|
+
css: string
|
|
13
|
+
ast: CssNode
|
|
14
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CssNode } from '../parse';
|
|
2
|
+
import type { Selector as WhatSelector } from '../what';
|
|
3
|
+
export declare function specificity(input: CssNode | WhatSelector[][] | WhatSelector[] | string): Specificity;
|
|
4
|
+
export declare function specificityToString(s: Specificity): string;
|
|
5
|
+
export type Specificity = [number, number, number];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type { ListItem } from './list';
|
|
2
|
+
export type { Token } from './tokenizer';
|
|
3
|
+
export type {
|
|
4
|
+
Atrule,
|
|
5
|
+
AtrulePrelude,
|
|
6
|
+
AttributeSelector,
|
|
7
|
+
Block,
|
|
8
|
+
ClassSelector,
|
|
9
|
+
Combinator,
|
|
10
|
+
CommentNode,
|
|
11
|
+
CssLocation,
|
|
12
|
+
CssNode,
|
|
13
|
+
CssNodeType,
|
|
14
|
+
Declaration,
|
|
15
|
+
DeclarationList,
|
|
16
|
+
DimensionNode,
|
|
17
|
+
FunctionNode,
|
|
18
|
+
HashNode,
|
|
19
|
+
Identifier,
|
|
20
|
+
IdSelector,
|
|
21
|
+
MediaFeatureNode,
|
|
22
|
+
MediaQueryListNode,
|
|
23
|
+
MediaQueryNode,
|
|
24
|
+
NestingSelector,
|
|
25
|
+
NthNode,
|
|
26
|
+
NumberNode,
|
|
27
|
+
OperatorNode,
|
|
28
|
+
ParenthesesNode,
|
|
29
|
+
ParseContext,
|
|
30
|
+
ParseOptions,
|
|
31
|
+
PercentageNode,
|
|
32
|
+
PseudoClassSelector,
|
|
33
|
+
PseudoElementSelector,
|
|
34
|
+
RatioNode,
|
|
35
|
+
Raw,
|
|
36
|
+
RawNode,
|
|
37
|
+
Rule,
|
|
38
|
+
Selector,
|
|
39
|
+
SelectorList,
|
|
40
|
+
StringNode,
|
|
41
|
+
StyleSheet,
|
|
42
|
+
TypeSelector,
|
|
43
|
+
UnicodeRangeNode,
|
|
44
|
+
UrlNode,
|
|
45
|
+
Value,
|
|
46
|
+
WhiteSpaceNode,
|
|
47
|
+
} from './types';
|
|
48
|
+
export type { WalkContext, WalkVisitor } from './walker';
|
|
49
|
+
/**
|
|
50
|
+
* Public surface for the CSS parser/generator/walker. Drop-in compatible
|
|
51
|
+
* with css-tree v3 for the API surface used by csso/SVGO.
|
|
52
|
+
*/
|
|
53
|
+
export { clone } from './clone';
|
|
54
|
+
export { generate } from './generator';
|
|
55
|
+
export { CssList as List, makeList } from './list';
|
|
56
|
+
export { parse, TokenType } from './parser';
|
|
57
|
+
export { decodeName, Tokenizer } from './tokenizer';
|
|
58
|
+
export { walk } from './walker';
|