diff --git a/playwright/src/main/java/com/microsoft/playwright/Keyboard.java b/playwright/src/main/java/com/microsoft/playwright/Keyboard.java index 3ddae906..0fb3b0a9 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Keyboard.java +++ b/playwright/src/main/java/com/microsoft/playwright/Keyboard.java @@ -114,7 +114,7 @@ public interface Keyboard { * * @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}. */ - void press(String key, PressOptions delay); + void press(String key, PressOptions options); default void type(String text) { type(text, null); } @@ -127,7 +127,7 @@ public interface Keyboard { * * @param text A text to type into a focused element. */ - void type(String text, TypeOptions delay); + void type(String text, TypeOptions options); /** * Dispatches a {@code keyup} event. * diff --git a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java index 73023fda..1d1bb873 100644 --- a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java +++ b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java @@ -760,7 +760,7 @@ class Method extends Element { sections.add(""); hasBlankLine = true; } - sections.add("@param " + p.name() + " " + comment); + sections.add("@param " + p.jsonName + " " + comment); } } if (jsonElement.getAsJsonObject().has("returnComment")) { @@ -778,12 +778,6 @@ class Method extends Element { class Param extends Element { final TypeRef type; - private static Map customName = new HashMap<>(); - static { - customName.put("Keyboard.type.options", "delay"); - customName.put("Keyboard.press.options", "delay"); - } - Param(Method method, JsonObject jsonElement) { super(method, jsonElement); type = new TypeRef(this, jsonElement.get("type").getAsJsonObject()); @@ -793,16 +787,8 @@ class Param extends Element { return !jsonElement.getAsJsonObject().get("required").getAsBoolean(); } - String name() { - String name = customName.get(jsonPath); - if (name != null) { - return name; - } - return jsonName; - } - String toJava() { - return type.toJava() + " " + name(); + return type.toJava() + " " + jsonName; } }