-
Notifications
You must be signed in to change notification settings - Fork 44
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 jsdoc types #69
Merged
add jsdoc types #69
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paulirish
requested changes
Aug 30, 2018
core/lib/frame.js
Outdated
* @typedef {import('../speedline').Options<IncludeType>} Options | ||
* @typedef {import('../speedline').TraceEvent} TraceEvent | ||
* @typedef {import('../speedline').Output['frames'][number]} Frame | ||
* @typedef {{data: Buffer, width: number, height: number}} ImageData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function synthesizeWhiteFrame(frames) { | ||
const firstImageData = jpeg.decode(frames[0].getImage()); | ||
const width = firstImageData.width; | ||
const height = firstImageData.height; | ||
|
||
const frameData = new Buffer(width * height * 4); | ||
const frameData = Buffer.alloc(width * height * 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
tsconfig.json
Outdated
}, | ||
"include": [ | ||
"./cli.js", | ||
"core/lib/index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core lib *.js
paulirish
approved these changes
Aug 30, 2018
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
while changing code I kept having to manually trace arguments up three or four levels of function calls to figure out what was being passed in. This adds jsdoc types to make it so you know locally what everything is :)
Functional code changes are minimal, an array initialization, a local variable name, and switching off of
new Buffer()
. Note that the tsc type checking doesn't actually pass; we'll have to figure out the optional types used in a bunch of places on a different day :)