mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-30 09:54:02 +08:00
Add basic types from protocol to closure
Change-Id: I3c522e24f7f06fa55881f363546d4be12f5da64e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204108 Commit-Queue: Jan Scheffler <janscheffler@chromium.org> Auto-Submit: Jan Scheffler <janscheffler@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
36aca5228a
commit
bb0779674b
@@ -94,7 +94,7 @@ def param_type(domain_name, param, command=None):
|
||||
items = param["items"]
|
||||
return "!Array<%s>" % param_type(domain_name, items)
|
||||
else:
|
||||
return type_traits[param["type"]]
|
||||
return "Protocol.%s" % param["type"]
|
||||
if "$ref" in param:
|
||||
type_id = full_qualified_type_id(domain_name, param["$ref"])
|
||||
if type_id in ref_types:
|
||||
@@ -122,8 +122,11 @@ def generate_protocol_externs(output_path, file1, file2):
|
||||
load_schema(file2, domains)
|
||||
output_file = open(output_path, "w")
|
||||
output_file.write("var ProtocolProxyApi = {};\n")
|
||||
output_file.write("/** @typedef {string} */")
|
||||
output_file.write("Protocol.binary;")
|
||||
|
||||
# Add basic types from protocol to closure
|
||||
for protocolName, closureName in type_traits.items():
|
||||
output_file.write("/** @typedef {%s} */\n" % closureName)
|
||||
output_file.write("Protocol.%s;\n" % protocolName)
|
||||
|
||||
for domain in domains:
|
||||
domain_name = domain["domain"]
|
||||
|
||||
Reference in New Issue
Block a user