Skip to content

Commit 11621a3

Browse files
sgnyMoOx
authored andcommitted
Replace unnecessary names with empty strings in external statements (#482)
1 parent 140f1dd commit 11621a3

2 files changed

Lines changed: 40 additions & 52 deletions

File tree

‎reason-react-native/src/apis/Animated.md‎

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Animation = {
1010
type endResult = {. "finished": bool};
1111
type endCallback = endResult => unit;
1212
[@bs.send]
13-
external start: (t, ~endCallback: endCallback=?, unit) => unit = "start";
13+
external start: (t, ~endCallback: endCallback=?, unit) => unit = "";
1414
1515
[@bs.send] external stop: t => unit = "";
1616
[@bs.send] external reset: t => unit = "";
@@ -136,7 +136,7 @@ module Interpolation = {
136136
) =>
137137
config =
138138
"";
139-
[@bs.send] external interpolate: (value('a), config) => t = "interpolate";
139+
[@bs.send] external interpolate: (value('a), config) => t = "";
140140
};
141141
142142
module ValueOperations = {
@@ -161,21 +161,19 @@ module Value = {
161161
type callback = jsValue => unit;
162162
[@bs.new] [@bs.scope "Animated"] [@bs.module "react-native"]
163163
external create: float => t = "Value";
164-
[@bs.send] external setValue: (t, float) => unit = "setValue";
165-
[@bs.send] external setOffset: (t, float) => unit = "setOffset";
166-
[@bs.send] external flattenOffset: t => unit = "flattenOffset";
167-
[@bs.send] external extractOffset: t => unit = "extractOffset";
168-
[@bs.send] external addListener: (t, callback) => string = "addListener";
169-
[@bs.send] external removeListener: (t, string) => unit = "removeListener";
170-
[@bs.send] external removeAllListeners: t => unit = "removeAllListeners";
164+
[@bs.send] external setValue: (t, float) => unit = "";
165+
[@bs.send] external setOffset: (t, float) => unit = "";
166+
[@bs.send] external flattenOffset: t => unit = "";
167+
[@bs.send] external extractOffset: t => unit = "";
168+
[@bs.send] external addListener: (t, callback) => string = "";
169+
[@bs.send] external removeListener: (t, string) => unit = "";
170+
[@bs.send] external removeAllListeners: t => unit = "";
171171
172172
[@bs.send]
173-
external resetAnimation: (t, ~callback: callback=?, unit) => unit =
174-
"resetAnimation";
173+
external resetAnimation: (t, ~callback: callback=?, unit) => unit = "";
175174
176175
[@bs.send]
177-
external stopAnimation: (t, ~callback: callback=?, unit) => unit =
178-
"stopAnimation";
176+
external stopAnimation: (t, ~callback: callback=?, unit) => unit = "";
179177
180178
include ValueAnimations({
181179
type t = value(regular);
@@ -207,22 +205,18 @@ module ValueXY = {
207205
208206
[@bs.send] external setValue: (t, jsValue) => unit = "";
209207
[@bs.send] external setOffset: (t, jsValue) => unit = "";
210-
[@bs.send] external flattenOffset: t => unit = "flattenOffset";
211-
[@bs.send] external extractOffset: t => unit = "extractOffset";
208+
[@bs.send] external flattenOffset: t => unit = "";
209+
[@bs.send] external extractOffset: t => unit = "";
212210
[@bs.send]
213-
external resetAnimation: (t, ~callback: callback=?, unit) => unit =
214-
"resetAnimation";
211+
external resetAnimation: (t, ~callback: callback=?, unit) => unit = "";
215212
216213
[@bs.send]
217-
external stopAnimation: (t, ~callback: callback=?, unit) => unit =
218-
"stopAnimation";
219-
[@bs.send] external addListener: (t, callback) => string = "addListener";
220-
[@bs.send] external removeListener: (t, string) => unit = "removeListener";
221-
[@bs.send] external removeAllListeners: t => unit = "removeAllListeners";
222-
[@bs.send] external getLayout: t => layout = "getLayout";
223-
[@bs.send]
224-
external getTranslateTransform: t => translateTransform =
225-
"getTranslateTransform";
214+
external stopAnimation: (t, ~callback: callback=?, unit) => unit = "";
215+
[@bs.send] external addListener: (t, callback) => string = "";
216+
[@bs.send] external removeListener: (t, string) => unit = "";
217+
[@bs.send] external removeAllListeners: t => unit = "";
218+
[@bs.send] external getLayout: t => layout = "";
219+
[@bs.send] external getTranslateTransform: t => translateTransform = "";
226220
[@bs.get] external getX: t => Value.t = "x";
227221
[@bs.get] external getY: t => Value.t = "y";
228222
include ValueAnimations({

‎reason-react-native/src/apis/Animated.re‎

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Animation = {
33
type endResult = {. "finished": bool};
44
type endCallback = endResult => unit;
55
[@bs.send]
6-
external start: (t, ~endCallback: endCallback=?, unit) => unit = "start";
6+
external start: (t, ~endCallback: endCallback=?, unit) => unit = "";
77

88
[@bs.send] external stop: t => unit = "";
99
[@bs.send] external reset: t => unit = "";
@@ -129,7 +129,7 @@ module Interpolation = {
129129
) =>
130130
config =
131131
"";
132-
[@bs.send] external interpolate: (value('a), config) => t = "interpolate";
132+
[@bs.send] external interpolate: (value('a), config) => t = "";
133133
};
134134

135135
module ValueOperations = {
@@ -154,21 +154,19 @@ module Value = {
154154
type callback = jsValue => unit;
155155
[@bs.new] [@bs.scope "Animated"] [@bs.module "react-native"]
156156
external create: float => t = "Value";
157-
[@bs.send] external setValue: (t, float) => unit = "setValue";
158-
[@bs.send] external setOffset: (t, float) => unit = "setOffset";
159-
[@bs.send] external flattenOffset: t => unit = "flattenOffset";
160-
[@bs.send] external extractOffset: t => unit = "extractOffset";
161-
[@bs.send] external addListener: (t, callback) => string = "addListener";
162-
[@bs.send] external removeListener: (t, string) => unit = "removeListener";
163-
[@bs.send] external removeAllListeners: t => unit = "removeAllListeners";
157+
[@bs.send] external setValue: (t, float) => unit = "";
158+
[@bs.send] external setOffset: (t, float) => unit = "";
159+
[@bs.send] external flattenOffset: t => unit = "";
160+
[@bs.send] external extractOffset: t => unit = "";
161+
[@bs.send] external addListener: (t, callback) => string = "";
162+
[@bs.send] external removeListener: (t, string) => unit = "";
163+
[@bs.send] external removeAllListeners: t => unit = "";
164164

165165
[@bs.send]
166-
external resetAnimation: (t, ~callback: callback=?, unit) => unit =
167-
"resetAnimation";
166+
external resetAnimation: (t, ~callback: callback=?, unit) => unit = "";
168167

169168
[@bs.send]
170-
external stopAnimation: (t, ~callback: callback=?, unit) => unit =
171-
"stopAnimation";
169+
external stopAnimation: (t, ~callback: callback=?, unit) => unit = "";
172170

173171
include ValueAnimations({
174172
type t = value(regular);
@@ -200,22 +198,18 @@ module ValueXY = {
200198

201199
[@bs.send] external setValue: (t, jsValue) => unit = "";
202200
[@bs.send] external setOffset: (t, jsValue) => unit = "";
203-
[@bs.send] external flattenOffset: t => unit = "flattenOffset";
204-
[@bs.send] external extractOffset: t => unit = "extractOffset";
201+
[@bs.send] external flattenOffset: t => unit = "";
202+
[@bs.send] external extractOffset: t => unit = "";
205203
[@bs.send]
206-
external resetAnimation: (t, ~callback: callback=?, unit) => unit =
207-
"resetAnimation";
204+
external resetAnimation: (t, ~callback: callback=?, unit) => unit = "";
208205

209206
[@bs.send]
210-
external stopAnimation: (t, ~callback: callback=?, unit) => unit =
211-
"stopAnimation";
212-
[@bs.send] external addListener: (t, callback) => string = "addListener";
213-
[@bs.send] external removeListener: (t, string) => unit = "removeListener";
214-
[@bs.send] external removeAllListeners: t => unit = "removeAllListeners";
215-
[@bs.send] external getLayout: t => layout = "getLayout";
216-
[@bs.send]
217-
external getTranslateTransform: t => translateTransform =
218-
"getTranslateTransform";
207+
external stopAnimation: (t, ~callback: callback=?, unit) => unit = "";
208+
[@bs.send] external addListener: (t, callback) => string = "";
209+
[@bs.send] external removeListener: (t, string) => unit = "";
210+
[@bs.send] external removeAllListeners: t => unit = "";
211+
[@bs.send] external getLayout: t => layout = "";
212+
[@bs.send] external getTranslateTransform: t => translateTransform = "";
219213
[@bs.get] external getX: t => Value.t = "x";
220214
[@bs.get] external getY: t => Value.t = "y";
221215
include ValueAnimations({

0 commit comments

Comments
 (0)