@master/css 2.0.0-beta.192 → 2.0.0-beta.194

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.
@@ -1,33 +1,12 @@
1
+ import type { ConfigFunction } from './';
1
2
  declare const functions: {
2
3
  $: {
3
- transform(opening: any, value: any, closing: any): any;
4
- };
5
- calc: {
6
- transform(opening: any, value: any, closing: any): (string | number | {
7
- type: "function";
8
- name: string;
9
- symbol: string;
10
- childrens: (string | number | any | {
11
- type: "variable";
12
- name: string;
13
- alpha?: string;
14
- } | {
15
- type: "separator";
16
- value: string;
17
- prefixWhite?: boolean;
18
- suffixWhite?: boolean;
19
- })[];
20
- } | {
21
- type: "variable";
22
- name: string;
23
- alpha?: string;
24
- } | {
25
- type: "separator";
26
- value: string;
27
- prefixWhite?: boolean;
28
- suffixWhite?: boolean;
29
- })[];
4
+ transform(value: any): {
5
+ type: string;
6
+ name: any;
7
+ }[];
30
8
  };
9
+ calc: ConfigFunction;
31
10
  translate: {
32
11
  unit: string;
33
12
  };
@@ -6,7 +6,7 @@ import variables from './variables';
6
6
  import rules from './rules';
7
7
  import functions from './functions';
8
8
  import { CSSDeclarations } from '../types/css-declarations';
9
- import type { Rule } from '../rule';
9
+ import type { Rule, RuleOptions, ValueComponent } from '../rule';
10
10
  declare const config: Config;
11
11
  export { config, mediaQueries, selectors, semantics, rules, functions, animations, variables };
12
12
  export type ConfigVariable = number | string | Array<number | string>;
@@ -15,6 +15,16 @@ export type ConfigVariableGroup = {
15
15
  } & {
16
16
  [key: string]: ConfigVariable | ConfigVariableGroup;
17
17
  };
18
+ export type ConfigFunction = {
19
+ unit?: string;
20
+ colored?: boolean;
21
+ transform?(this: Rule, value: string): string | ValueComponent[];
22
+ };
23
+ export type ConfigAnimation = {
24
+ [key in 'from' | 'to']?: CSSDeclarations;
25
+ } & {
26
+ [key: string]: CSSDeclarations;
27
+ };
18
28
  export interface Config {
19
29
  extends?: (Config | {
20
30
  config: Config;
@@ -39,21 +49,13 @@ export interface Config {
39
49
  [key: string]: ConfigVariableGroup | ConfigVariable;
40
50
  };
41
51
  rules?: {
42
- [key in keyof typeof rules | string]?: Rule['options'];
52
+ [key in keyof typeof rules | string]?: RuleOptions;
43
53
  };
44
54
  rootSize?: number;
45
55
  scope?: string;
46
56
  important?: boolean;
47
57
  override?: boolean;
48
- functions?: Record<string, {
49
- unit?: string;
50
- colored?: boolean;
51
- transform?(this: Rule, opening: string, value: string, closing: string): string | Rule['valueNodes'];
52
- }>;
53
- animations?: Record<string, {
54
- [key in 'from' | 'to']?: CSSDeclarations;
55
- } & {
56
- [key: string]: CSSDeclarations;
57
- }>;
58
+ functions?: Record<string, ConfigFunction>;
59
+ animations?: Record<string, ConfigAnimation>;
58
60
  themeDriver?: 'class' | 'media' | 'host';
59
61
  }