fix: remove devices from the API (#280)
This commit is contained in:
@@ -1056,11 +1056,6 @@ class NestedClass extends TypeDefinition {
|
||||
if (!isReturnType) {
|
||||
writeConstructor(output, bodyOffset);
|
||||
writeBuilderMethods(output, bodyOffset);
|
||||
if (asList("Browser.newContext.options",
|
||||
"Browser.newPage.options",
|
||||
"BrowserType.launchPersistentContext.options").contains(jsonPath)) {
|
||||
writeDeviceDescriptorBuilder(output, bodyOffset);
|
||||
}
|
||||
}
|
||||
output.add(offset + "}");
|
||||
}
|
||||
@@ -1083,17 +1078,6 @@ class NestedClass extends TypeDefinition {
|
||||
requiredFields.forEach(f -> output.add(bodyOffset + " this." + f.name + " = " + f.name + ";"));
|
||||
output.add(bodyOffset + "}");
|
||||
}
|
||||
|
||||
private void writeDeviceDescriptorBuilder(List<String> output, String bodyOffset) {
|
||||
output.add(bodyOffset + "public " + name + " withDevice(DeviceDescriptor device) {");
|
||||
output.add(bodyOffset + " withViewportSize(device.viewportSize());");
|
||||
output.add(bodyOffset + " withUserAgent(device.userAgent());");
|
||||
output.add(bodyOffset + " withDeviceScaleFactor(device.deviceScaleFactor());");
|
||||
output.add(bodyOffset + " withIsMobile(device.isMobile());");
|
||||
output.add(bodyOffset + " withHasTouch(device.hasTouch());");
|
||||
output.add(bodyOffset + " return this;");
|
||||
output.add(bodyOffset + "}");
|
||||
}
|
||||
}
|
||||
|
||||
class Enum extends TypeDefinition {
|
||||
|
||||
@@ -56,7 +56,6 @@ class Types {
|
||||
add("Selectors.register.script", "Object|function|string", "String");
|
||||
|
||||
// The method has custom signatures
|
||||
add("BrowserContext.cookies", "Array<Object>", "Cookie");
|
||||
add("BrowserContext.route.url", "RegExp|function(URL):boolean|string", "String");
|
||||
add("BrowserContext.unroute.url", "RegExp|function(URL):boolean|string", "String");
|
||||
add("Page.waitForNavigation.options.url", "RegExp|function(URL):boolean|string", "Custom");
|
||||
@@ -75,9 +74,6 @@ class Types {
|
||||
add("ElementHandle.setInputFiles.files", "Array<Object>|Array<path>|Object|path", "String");
|
||||
add("FileChooser.setFiles.files", "Array<Object>|Array<path>|Object|path", "String");
|
||||
add("Route.resume.options.postData", "Buffer|string", "byte[]", new Empty());
|
||||
|
||||
// TODO: fix upstream types!
|
||||
add("Playwright.devices", "Object", "Map<String, DeviceDescriptor>", new Empty());
|
||||
}
|
||||
|
||||
Mapping findForPath(String jsonPath) {
|
||||
|
||||
Reference in New Issue
Block a user