-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: difference between any and object without properties? #245
Comments
As I read the devtools-protocol/json/browser_protocol.json Line 603 in bc63f36
devtools-protocol/types/protocol.d.ts Line 2844 in bc63f36
The |
I think I might have been unclear here. The general case of In this question, I am specifically talking about places where devtools-protocol/json/js_protocol.json Line 1090 in bc63f36
That's an occurrence of a type The only difference I can imagine with |
Ah I see, I had missed the usage in |
No problem, I was also confused when I searched Thanks a lot for asking around! |
@joffrey-bion, you're reading it right -- "type": "any" implies any type at all, including primitive types such as boolean/numer/string, while "type": "object" implies a JSON object (i.e. a dictionary with string keys and values of "any" type). |
In the protocol definitions, I have seen occurrences of both
type: "any"
andtype: "object"
without anyproperties
list.What's the difference? Is it that
any
can be anything including primitives (effectively any JSON value) butobject
is limited to only structures with properties (effectively only JSON objects)?In that case, does an
object
without properties list represent a type whose properties are unknown/dynamic?In the typescript definitions, I noticed that most params of type
object
without properties are represented with theHeaders
interface, which is basically{[key: string]: string}
. This would confirm my guess here. However, some are still translated into TS'sany
(e.g.PausedEvent.data
), which is why I'm asking here.The text was updated successfully, but these errors were encountered: