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

Utils typescript #2182

Merged
merged 8 commits into from
Mar 27, 2019
Merged

Utils typescript #2182

merged 8 commits into from
Mar 27, 2019

Conversation

itsjamie
Copy link
Collaborator

This PR will...

Add types for a few helpers modules.

Why is this Pull Request needed?

Progress towards typescripting hls.js

Are there any points in the code the reviewer needs to double check?

No.

Resolves issues:

Working towards #2070.

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

Copy link
Member

@tjenkinson tjenkinson left a comment

Choose a reason for hiding this comment

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

🎉

src/is-supported.ts Outdated Show resolved Hide resolved
src/utils/buffer-helper.ts Outdated Show resolved Hide resolved
src/utils/buffer-helper.ts Outdated Show resolved Hide resolved
Co-Authored-By: itsjamie <1956521+itsjamie@users.noreply.github.com>
src/utils/mediasource-helper.ts Show resolved Hide resolved
src/utils/buffer-helper.ts Outdated Show resolved Hide resolved
Both ; and , are allowed because the newline seems to be what matters to line terminate. Just using it consistently in this file.
Simple POJO definition gets simple type def.
This narrows the definition of what we accept as "media" to something that is "Bufferable". Which is an object with a "buffered" property that contains `TimeRanges`.
let vbuffered = media.buffered, buffered = [], i;
let vbuffered = media.buffered;
let buffered: BufferTimeRange[] = [];
let i: number;
for (i = 0; i < vbuffered.length; i++) {
Copy link
Member

@tjenkinson tjenkinson Mar 27, 2019

Choose a reason for hiding this comment

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

Suggested change
for (i = 0; i < vbuffered.length; i++) {
for (let i = 0; i < vbuffered.length; i++) {

then you don't need to define it above

@itsjamie itsjamie merged commit 1177e18 into master Mar 27, 2019
@itsjamie itsjamie deleted the utils-typescript branch March 27, 2019 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants