-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Interfaces for each domain type used #43
Comments
Noticing there's theres a tiny problem here, i was hoping we could do something like: import { Runtime } from "./interfaces/domains/runtime.ts"
public assertSee(...) {
const res = await this.sendWebSocketMessage("Runtime.evaluate", {
expression: command,
}) as Runtime.evaluate
...
} But the expression param we pass in for Runtime.evaluate will change the response object based on the value:
And. in the const res = ... as Runtime.evaluate(...)
if (res.result.value) {
// ...
} It's making us use the conditional (as This leads me to think, we should scrap creating an interface for each domain, and check the result value in each method, and add the type directly, eg: public assertSee(...) {
const res = ... as {
result: {
type: "boolean",
value: boolean
}
}
} |
Summary
What:
Add an interface for each sub domain type used, so this can be used in it's respective method
Why:
So we can better type the return values from
sendWebSocketMessage
, it'll give us a clearer idea on what will be returned for that respective methodHow:
These must also account ERRORS (eg frameId is "blahblahblah")
The text was updated successfully, but these errors were encountered: