@cleartrip/ct-design-style-manager 4.0.0-SNAPSHOT-rnfinaltest65.0 → 4.0.0-SNAPSHOT-reactnative.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-design-style-manager",
3
- "version": "4.0.0-SNAPSHOT-rnfinaltest65.0",
3
+ "version": "4.0.0-SNAPSHOT-reactnative.1",
4
4
  "description": "Style hooks",
5
5
  "types": "dist/index.d.ts",
6
6
  "react-native": "src/index.ts",
@@ -19,11 +19,11 @@
19
19
  "dependencies": {
20
20
  "@emotion/css": "11.13.4",
21
21
  "@react-native/normalize-colors": "^0.78.1",
22
- "@cleartrip/ct-design-theme": "4.0.0-SNAPSHOT-rnfinaltest65.0",
23
- "@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-rnfinaltest65.0"
22
+ "@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-reactnative.1",
23
+ "@cleartrip/ct-design-theme": "4.0.0-SNAPSHOT-reactnative.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-rnfinaltest65.0"
26
+ "@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-reactnative.1"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": ">=16.8.0",
@@ -1,13 +0,0 @@
1
- import { Styles } from '@cleartrip/ct-design-types';
2
- type NeverString<T> = T extends string ? never : T;
3
- type WeakStyle = NeverString<Styles>;
4
- declare class StylingCacheManager {
5
- static instance: StylingCacheManager;
6
- private cache;
7
- constructor();
8
- set(key: WeakStyle, value: string): void;
9
- get(key: WeakStyle): string | undefined;
10
- }
11
- declare const StylingCache: Readonly<StylingCacheManager>;
12
- export default StylingCache;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/StylingCache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC;AAEnD,KAAK,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAErC,cAAM,mBAAmB;IACvB,MAAM,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACrC,OAAO,CAAC,KAAK,CAA6B;;IAgB1C,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM;IASjC,GAAG,CAAC,GAAG,EAAE,SAAS;CAGnB;AAED,QAAA,MAAM,YAAY,+BAA2C,CAAC;AAC9D,eAAe,YAAY,CAAC"}
@@ -1,40 +0,0 @@
1
- import { Styles } from '@cleartrip/ct-design-types';
2
-
3
- type NeverString<T> = T extends string ? never : T;
4
-
5
- type WeakStyle = NeverString<Styles>;
6
-
7
- class StylingCacheManager {
8
- static instance: StylingCacheManager;
9
- private cache: WeakMap<WeakStyle, string>;
10
-
11
- constructor() {
12
- if (StylingCacheManager.instance) {
13
- throw new Error('You can only create one instance!');
14
- }
15
- StylingCacheManager.instance = this;
16
- this.cache = new WeakMap();
17
- }
18
-
19
- /**
20
- *
21
- * @param key Key is primarily the page name or any unique string
22
- * @param value Value is the slot node index and it corresponding height
23
- * @description This method is used to set new cache or replace the entire existing cache key
24
- */
25
- set(key: WeakStyle, value: string) {
26
- this.cache.set(key, value);
27
- }
28
-
29
- /**
30
- *
31
- * @param key Key is primarily the page name or any unique string
32
- * @returns This method returns the cache data if the cache exists or undefined if it does not
33
- */
34
- get(key: WeakStyle) {
35
- return this.cache.get(key);
36
- }
37
- }
38
-
39
- const StylingCache = Object.freeze(new StylingCacheManager());
40
- export default StylingCache;