Skip to content

Commit 18d9d55

Browse files
committed
Enabled warning 105. Converted all externals to explicit using the brilliant https://comby.dev
1 parent b7e3095 commit 18d9d55

File tree

78 files changed

+850
-867
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+850
-867
lines changed

bsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"warnings": {
20-
"number": "+A-105",
20+
"number": "+A",
2121
"error": "+A"
2222
},
2323
"bs-dev-dependencies": [

src/Webapi.res

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Iterator = Webapi__Iterator
1010

1111
module Performance = Webapi__Performance
1212

13-
/** @since 0.19.0 */
1413
module ReadableStream = Webapi__ReadableStream
1514

1615
module IntersectionObserver = Webapi__IntersectionObserver
@@ -20,7 +19,7 @@ module WebSocket = Webapi__WebSocket
2019

2120
type rafId
2221

23-
@val external requestAnimationFrame: (float => unit) => unit = ""
22+
@val external requestAnimationFrame: (float => unit) => unit = "requestAnimationFrame"
2423
@val
2524
external requestCancellableAnimationFrame: (float => unit) => rafId = "requestAnimationFrame"
26-
@val external cancelAnimationFrame: rafId => unit = ""
25+
@val external cancelAnimationFrame: rafId => unit = "cancelAnimationFrame"

src/Webapi/Canvas/Webapi__Canvas__Canvas2d.res

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ type rec style<_> =
7878
| Pattern: style<pattern>
7979

8080
/* 2d Canvas API, following https://simon.html5.org/dump/html5-canvas-cheat-sheet.html */
81-
@send external save: t => unit = ""
82-
@send external restore: t => unit = ""
81+
@send external save: t => unit = "save"
82+
@send external restore: t => unit = "restore"
8383

8484
/* Transformation */
85-
@send external scale: (t, ~x: float, ~y: float) => unit = ""
86-
@send external rotate: (t, float) => unit = ""
87-
@send external translate: (t, ~x: float, ~y: float) => unit = ""
85+
@send external scale: (t, ~x: float, ~y: float) => unit = "scale"
86+
@send external rotate: (t, float) => unit = "rotate"
87+
@send external translate: (t, ~x: float, ~y: float) => unit = "translate"
8888
@send
8989
external transform: (
9090
t,
@@ -94,7 +94,7 @@ external transform: (
9494
~m22: float,
9595
~dx: float,
9696
~dy: float,
97-
) => unit = ""
97+
) => unit = "transform"
9898
@send
9999
external setTransform: (
100100
t,
@@ -104,17 +104,17 @@ external setTransform: (
104104
~m22: float,
105105
~dx: float,
106106
~dy: float,
107-
) => unit = ""
107+
) => unit = "setTransform"
108108

109109
/* Compositing */
110-
@set external globalAlpha: (t, float) => unit = ""
111-
@set external globalCompositeOperation: (t, Composite.t) => unit = ""
110+
@set external globalAlpha: (t, float) => unit = "globalAlpha"
111+
@set external globalCompositeOperation: (t, Composite.t) => unit = "globalCompositeOperation"
112112

113113
/* Line Styles */
114-
@set external lineWidth: (t, float) => unit = ""
115-
@set external lineCap: (t, LineCap.t) => unit = ""
116-
@set external lineJoin: (t, LineJoin.t) => unit = ""
117-
@set external miterLimit: (t, float) => unit = ""
114+
@set external lineWidth: (t, float) => unit = "lineWidth"
115+
@set external lineCap: (t, LineCap.t) => unit = "lineCap"
116+
@set external lineJoin: (t, LineJoin.t) => unit = "lineJoin"
117+
@set external miterLimit: (t, float) => unit = "miterLimit"
118118

119119
/* Colors, Styles, and Shadows */
120120
@set external setFillStyle: (t, @ignore style<'a>, 'a) => unit = "fillStyle"
@@ -145,21 +145,21 @@ let reifyStyle = (type a, x: 'a): (style<a>, a) => {
145145
)
146146
}
147147

148-
@get external fillStyle: t => 'a = ""
149-
@get external strokeStyle: t => 'a = ""
148+
@get external fillStyle: t => 'a = "fillStyle"
149+
@get external strokeStyle: t => 'a = "strokeStyle"
150150

151151
let fillStyle = (ctx: t) => ctx->fillStyle->reifyStyle
152152

153153
let strokeStyle = (ctx: t) => ctx->strokeStyle->reifyStyle
154154

155-
@set external shadowOffsetX: (t, float) => unit = ""
156-
@set external shadowOffsetY: (t, float) => unit = ""
157-
@set external shadowBlur: (t, float) => unit = ""
158-
@set external shadowColor: (t, string) => unit = ""
155+
@set external shadowOffsetX: (t, float) => unit = "shadowOffsetX"
156+
@set external shadowOffsetY: (t, float) => unit = "shadowOffsetY"
157+
@set external shadowBlur: (t, float) => unit = "shadowBlur"
158+
@set external shadowColor: (t, string) => unit = "shadowColor"
159159

160160
/* Gradients */
161161
@send
162-
external createLinearGradient: (t, ~x0: float, ~y0: float, ~x1: float, ~y1: float) => gradient = ""
162+
external createLinearGradient: (t, ~x0: float, ~y0: float, ~x1: float, ~y1: float) => gradient = "createLinearGradient"
163163
@send
164164
external createRadialGradient: (
165165
t,
@@ -169,8 +169,8 @@ external createRadialGradient: (
169169
~y1: float,
170170
~r0: float,
171171
~r1: float,
172-
) => gradient = ""
173-
@send external addColorStop: (gradient, float, string) => unit = ""
172+
) => gradient = "createRadialGradient"
173+
@send external addColorStop: (gradient, float, string) => unit = "addColorStop"
174174
@val
175175
external createPattern: (
176176
t,
@@ -182,17 +182,17 @@ external createPattern: (
182182
| @as("repeat-y") #repeatY
183183
| @as("no-repeat") #noRepeat
184184
],
185-
) => pattern = ""
185+
) => pattern = "createPattern"
186186

187187
/* Paths */
188-
@send external beginPath: t => unit = ""
189-
@send external closePath: t => unit = ""
190-
@send external fill: t => unit = ""
191-
@send external stroke: t => unit = ""
192-
@send external clip: t => unit = ""
193-
@send external moveTo: (t, ~x: float, ~y: float) => unit = ""
194-
@send external lineTo: (t, ~x: float, ~y: float) => unit = ""
195-
@send external quadraticCurveTo: (t, ~cp1x: float, ~cp1y: float, ~x: float, ~y: float) => unit = ""
188+
@send external beginPath: t => unit = "beginPath"
189+
@send external closePath: t => unit = "closePath"
190+
@send external fill: t => unit = "fill"
191+
@send external stroke: t => unit = "stroke"
192+
@send external clip: t => unit = "clip"
193+
@send external moveTo: (t, ~x: float, ~y: float) => unit = "moveTo"
194+
@send external lineTo: (t, ~x: float, ~y: float) => unit = "lineTo"
195+
@send external quadraticCurveTo: (t, ~cp1x: float, ~cp1y: float, ~x: float, ~y: float) => unit = "quadraticCurveTo"
196196
@send
197197
external bezierCurveTo: (
198198
t,
@@ -202,8 +202,8 @@ external bezierCurveTo: (
202202
~cp2y: float,
203203
~x: float,
204204
~y: float,
205-
) => unit = ""
206-
@send external arcTo: (t, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~r: float) => unit = ""
205+
) => unit = "bezierCurveTo"
206+
@send external arcTo: (t, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~r: float) => unit = "arcTo"
207207
@send
208208
external arc: (
209209
t,
@@ -213,26 +213,25 @@ external arc: (
213213
~startAngle: float,
214214
~endAngle: float,
215215
~anticw: bool,
216-
) => unit = ""
217-
@send external rect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
218-
@send external isPointInPath: (t, ~x: float, ~y: float) => bool = ""
216+
) => unit = "arc"
217+
@send external rect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "rect"
218+
@send external isPointInPath: (t, ~x: float, ~y: float) => bool = "isPointInPath"
219219

220220
/* Text */
221-
@set external font: (t, string) => unit = ""
222-
@set external textAlign: (t, string) => unit = ""
223-
@set external textBaseline: (t, string) => unit = ""
221+
@set external font: (t, string) => unit = "font"
222+
@set external textAlign: (t, string) => unit = "textAlign"
223+
@set external textBaseline: (t, string) => unit = "textBaseline"
224224
@send
225-
external fillText: (t, string, ~x: float, ~y: float, ~maxWidth: float=?, @ignore unit) => unit = ""
225+
external fillText: (t, string, ~x: float, ~y: float, ~maxWidth: float=?, @ignore unit) => unit = "fillText"
226226
@send
227-
external strokeText: (t, string, ~x: float, ~y: float, ~maxWidth: float=?, @ignore unit) => unit =
228-
""
229-
@send external measureText: (t, string) => measureText = ""
230-
@get external width: measureText => float = ""
227+
external strokeText: (t, string, ~x: float, ~y: float, ~maxWidth: float=?, @ignore unit) => unit = "strokeText"
228+
@send external measureText: (t, string) => measureText = "measureText"
229+
@get external width: measureText => float = "width"
231230

232231
/* Rectangles */
233-
@send external fillRect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
234-
@send external strokeRect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
235-
@send external clearRect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = ""
232+
@send external fillRect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "fillRect"
233+
@send external strokeRect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "strokeRect"
234+
@send external clearRect: (t, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "clearRect"
236235

237236
@send
238237
external createImageDataCoords: (t, ~width: float, ~height: float) => Webapi__Dom__Image.t =
@@ -242,11 +241,10 @@ external createImageDataFromImage: (t, Webapi__Dom__Image.t) => Webapi__Dom__Ima
242241
"createImageData"
243242

244243
@send
245-
external getImageData: (t, ~sx: float, ~sy: float, ~sw: float, ~sh: float) => Webapi__Dom__Image.t =
246-
""
244+
external getImageData: (t, ~sx: float, ~sy: float, ~sw: float, ~sh: float) => Webapi__Dom__Image.t = "getImageData"
247245

248246
@send
249-
external putImageData: (t, ~imageData: Webapi__Dom__Image.t, ~dx: float, ~dy: float) => unit = ""
247+
external putImageData: (t, ~imageData: Webapi__Dom__Image.t, ~dx: float, ~dy: float) => unit = "putImageData"
250248

251249
@send
252250
external putImageDataWithDirtyRect: (

src/Webapi/Dom/Webapi__Dom__AnimationEvent.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ include Webapi__Dom__Event.Impl({
77
@new external make: string => t = "AnimationEvent"
88
@new external makeWithOptions: (string, {..}) => t = "AnimationEvent"
99

10-
@get external animationName: t => string = ""
11-
@get external elapsedTime: t => float = ""
12-
@get external pseudoElement: t => string /* enum-ish */ = ""
10+
@get external animationName: t => string = "animationName"
11+
@get external elapsedTime: t => float = "elapsedTime"
12+
@get external pseudoElement: t => string = "pseudoElement"

src/Webapi/Dom/Webapi__Dom__Attr.res

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ include Webapi__Dom__EventTarget.Impl({
77
type t = t
88
})
99

10-
@get external namespaceURI: t => string = ""
11-
@get external prefix: t => string = ""
12-
@get external localName: t => string = ""
13-
@get external name: t => string = ""
14-
@get external value: t => string = ""
15-
@get @return(nullable) external ownerElement: t => option<Dom.element> = ""
16-
@get external specified: t => bool = "" /* useless; always returns true (exact wording from spec) */
10+
@get external namespaceURI: t => string = "namespaceURI"
11+
@get external prefix: t => string = "prefix"
12+
@get external localName: t => string = "localName"
13+
@get external name: t => string = "name"
14+
@get external value: t => string = "value"
15+
@get @return(nullable) external ownerElement: t => option<Dom.element> = "ownerElement"
16+
@get external specified: t => bool = "specified" /* useless; always returns true (exact wording from spec) */

src/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ include Webapi__Dom__Event.Impl({
77
@new external make: string => t = "BeforeUnloadEvent"
88
@new external makeWithOptions: (string, {..}) => t = "BeforeUnloadEvent"
99

10-
@get external returnValue: t => string = ""
10+
@get external returnValue: t => string = "returnValue"

src/Webapi/Dom/Webapi__Dom__CharacterData.res

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ module Impl = (
33
type t
44
},
55
) => {
6-
@get external data: T.t => string = ""
7-
@get external length: T.t => int = ""
6+
@get external data: T.t => string = "data"
7+
@get external length: T.t => int = "length"
88

9-
@send external substringData: (T.t, ~offset: int, ~count: int) => string = ""
10-
@send external appendData: (T.t, string) => unit = ""
11-
@send external insertData: (T.t, ~offset: int, string) => unit = ""
12-
@send external deleteData: (T.t, ~offset: int, ~count: int) => unit = ""
13-
@send external replaceData: (T.t, ~offset: int, ~count: int, string) => unit = ""
9+
@send external substringData: (T.t, ~offset: int, ~count: int) => string = "substringData"
10+
@send external appendData: (T.t, string) => unit = "appendData"
11+
@send external insertData: (T.t, ~offset: int, string) => unit = "insertData"
12+
@send external deleteData: (T.t, ~offset: int, ~count: int) => unit = "deleteData"
13+
@send external replaceData: (T.t, ~offset: int, ~count: int, string) => unit = "replaceData"
1414
}
1515

1616
type t = Dom.characterData

src/Webapi/Dom/Webapi__Dom__ChildNode.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module Impl = (
44
type t
55
},
66
) => {
7-
@send external remove: T.t => unit = ""
7+
@send external remove: T.t => unit = "remove"
88
}

src/Webapi/Dom/Webapi__Dom__ClipboardEvent.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ include Webapi__Dom__Event.Impl({
77
@new external make: string => t = "ClipboardEvent"
88
@new external makeWithOptions: (string, {..}) => t = "ClipboardEvent"
99

10-
@get external clipboardData: t => Dom.dataTransfer = ""
10+
@get external clipboardData: t => Dom.dataTransfer = "clipboardData"

src/Webapi/Dom/Webapi__Dom__CloseEvent.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ include Webapi__Dom__Event.Impl({
77
@new external make: string => t = "CloseEvent"
88
@new external makeWithOptions: (string, {..}) => t = "CloseEvent"
99

10-
@get external wasClean: t => bool = ""
11-
@get external code: t => int = ""
12-
@get external reason: t => string = ""
10+
@get external wasClean: t => bool = "wasClean"
11+
@get external code: t => int = "code"
12+
@get external reason: t => string = "reason"

0 commit comments

Comments
 (0)