Skip to content
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

core(tsc): add types for DevtoolsLog and NetworkRecorder #4918

Merged
merged 5 commits into from
Apr 4, 2018
Merged

Conversation

brendankenny
Copy link
Member

@brendankenny brendankenny commented Apr 3, 2018

easy change to add types to DevtoolsLog and NetworkRecorder since we already have all the crdp event types.

Moved @patrickhulce's existing work on NetworkRequest to a LH.WebInspector namespace (since that's how we've nested it in our not-actually-type-checking past) and added the additional properties we needed to the interface.

We can probably continue to add properties as we go (seems ok?), though we do need to be careful about optional properties on the interface because the state we deal with these requests (after passing through NetworkRecorder which requires the full request lifecycle) is quite different than the initial constructed object which has many uninitialized properties (and even more added later but not initialized in the constructor :S)

Also did a quick s/WebInspector.NetworkRequest/LH.WebInspector.NetworkRequest params replacement elsewhere so that they'll be correct when we turn on type checking for all those files.

args: any;
args: {
data?: {
url: string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an optional property, url?: string

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants