@colisweb/rescript-toolkit 2.27.0 → 2.29.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": "@colisweb/rescript-toolkit",
3
- "version": "2.27.0",
3
+ "version": "2.29.1",
4
4
  "scripts": {
5
5
  "clean": "rescript clean",
6
6
  "build": "rescript build",
@@ -1,37 +1,37 @@
1
1
  open BsSentryReactNative
2
2
 
3
- @val @scope("process.env") external nodeEnv: string = "NODE_ENV"
3
+ @val external isDev: bool = "__DEV__"
4
4
 
5
5
  let debugStyle = "background-color: #208E9C; color: white; padding: 5px; font-size: 10px;"
6
6
  let warningStyle = "background-color: #FFAD2D; color: white; padding: 5px; font-size: 10px;"
7
7
  let errorStyle = "background-color: #FF4714; color: white; padding: 5px; font-size: 10px;"
8
8
 
9
9
  let debug = str => {
10
- if nodeEnv !== "production" {
10
+ if isDev {
11
11
  Js.Console.log3("%cDEBUG", debugStyle, str)
12
12
  }
13
13
  }
14
14
 
15
15
  let debug2 = (str, str2) => {
16
- if nodeEnv !== "production" {
16
+ if isDev {
17
17
  Js.Console.log4("%cDEBUG", debugStyle, str, str2)
18
18
  }
19
19
  }
20
20
 
21
21
  let warning = str => {
22
- if nodeEnv !== "production" {
22
+ if isDev {
23
23
  Js.Console.log3("%cWARN", warningStyle, str)
24
24
  }
25
25
  }
26
26
 
27
27
  let warning2 = (str, str2) => {
28
- if nodeEnv !== "production" {
28
+ if isDev {
29
29
  Js.Console.log4("%cWARN", warningStyle, str, str2)
30
30
  }
31
31
  }
32
32
 
33
33
  let error = str => {
34
- if nodeEnv !== "production" {
34
+ if isDev {
35
35
  Js.Console.log3("%cERROR", errorStyle, str)
36
36
  } else {
37
37
  open Sentry
@@ -42,7 +42,7 @@ let error = str => {
42
42
  }
43
43
 
44
44
  let error2 = (str, str2) => {
45
- if nodeEnv !== "production" {
45
+ if isDev {
46
46
  Js.Console.log4("%cERROR", errorStyle, str, str2)
47
47
  } else {
48
48
  open Sentry
@@ -50,3 +50,9 @@ module DomElement = {
50
50
 
51
51
  @val
52
52
  external innerWidth: int = "window.innerWidth"
53
+
54
+ @val
55
+ external screenWidth: int = "window.screen.width"
56
+
57
+ @val
58
+ external screenHeight: int = "window.screen.height"
@@ -0,0 +1,16 @@
1
+ module Browser = {
2
+ @module("@datadog/browser-rum") @scope("datadogRum")
3
+ external datadogRumInit: 'a => unit = "init"
4
+
5
+ @module("@datadog/browser-rum") @scope("datadogRum")
6
+ external startSessionReplayRecording: 'a => unit = "startSessionReplayRecording"
7
+
8
+ @module("@datadog/browser-rum") @scope("datadogRum")
9
+ external addAction: (string, 'a) => unit = "addAction"
10
+
11
+ @module("@datadog/browser-rum") @scope("datadogRum")
12
+ external addRumGlobalContext: (string, 'a) => unit = "addRumGlobalContext"
13
+
14
+ @module("@datadog/browser-rum") @scope("datadogRum")
15
+ external setUser: 'a => unit = "setUser"
16
+ }
@@ -65,6 +65,9 @@ module SwrConfig = {
65
65
 
66
66
  @send
67
67
  external mutate: (t, 'key, 'data, bool) => unit = "mutate"
68
+
69
+ @module("swr") @react.component
70
+ external make: (~value: fetcherOptions=?, ~children: React.element) => React.element = "SWRConfig"
68
71
  }
69
72
 
70
73
  @module("swr")