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

add jsdoc types #69

Merged
merged 2 commits into from
Aug 30, 2018
Merged

add jsdoc types #69

merged 2 commits into from
Aug 30, 2018

Conversation

brendankenny
Copy link
Collaborator

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 :)

* @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
Copy link
Owner

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);
Copy link
Owner

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"
Copy link
Owner

Choose a reason for hiding this comment

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

core lib *.js

@paulirish paulirish merged commit acb7f50 into master Aug 30, 2018
@paulirish paulirish deleted the jsdoc branch August 30, 2018 22:10
@paulirish paulirish mentioned this pull request Jan 18, 2022
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.

2 participants