@navita/engine 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/index.d.ts +44 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,4 +1,26 @@
1
- import { StyleRule, FontFaceRule, CSSKeyframes } from '@navita/types';
1
+ import { CSSKeyframes, FontFaceRule, StyleRule } from '@navita/types';
2
+
3
+ interface StyleBlock {
4
+ type: 'rule' | 'static';
5
+ selector: string;
6
+ property: string;
7
+ value: string;
8
+ pseudo: string;
9
+ media: string;
10
+ support: string;
11
+ container: string;
12
+ id: string | number;
13
+ }
14
+ interface KeyframesBlock {
15
+ type: 'keyframes';
16
+ rule: CSSKeyframes;
17
+ id: string;
18
+ }
19
+ interface FontFaceBlock {
20
+ type: 'fontFace';
21
+ rule: FontFaceRule[];
22
+ id: string;
23
+ }
2
24
 
3
25
  declare class ClassList extends String {
4
26
  }
@@ -10,6 +32,10 @@ type CacheKeys = keyof Engine["caches"];
10
32
  type UsedIdCache = {
11
33
  [key in CacheKeys]?: (string | number)[];
12
34
  };
35
+ interface Identifier {
36
+ value: string;
37
+ id: string;
38
+ }
13
39
  type Options = {
14
40
  context?: string;
15
41
  enableSourceMaps?: boolean;
@@ -47,7 +73,23 @@ declare class Engine {
47
73
  deserialize(buffer: Buffer | string): Promise<void>;
48
74
  setFilePath(filePath: string | undefined): void;
49
75
  getUsedFilePaths(): string[];
50
- getItems(caches: UsedIdCache): {};
76
+ getItems(caches: UsedIdCache): {
77
+ rule?: (StyleBlock & {
78
+ id: string | number;
79
+ })[];
80
+ static?: (StyleBlock & {
81
+ id: string | number;
82
+ })[];
83
+ keyframes?: (KeyframesBlock & {
84
+ id: string | number;
85
+ })[];
86
+ fontFace?: (FontFaceBlock & {
87
+ id: string | number;
88
+ })[];
89
+ identifiers?: (Identifier & {
90
+ id: string | number;
91
+ })[];
92
+ };
51
93
  clearUsedIds(filePath: string): void;
52
94
  private addUsedIds;
53
95
  getCacheIds(filePaths?: string[]): UsedIdCache;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navita/engine",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Navitas CSS-in-JS engine",
5
5
  "keywords": [
6
6
  "css-in-js",