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

feat: StorageEstimateUsageDetails #859

Closed

Conversation

lekoaf
Copy link

@lekoaf lekoaf commented May 27, 2020

This PR adds usageDetails to StorageEstimate with its own interface StorageEstimateUsageDetails.

This is already supported in Chrome and discussions are being had about this at WhatWG.

Try this in Chrome:

const quota = await navigator.storage.estimate()
console.log(quota)

{
  quota: 74378659430,
  usage: 385967396,
  usageDetails: {
    caches: 335832064,
    indexedDB: 50090672,
    serviceWorkerRegistrations: 44660
  }
}

I added [key: string]: number because I'm not sure what other keys can be in the usageDetails object.

Read more about StorageEstimate.

Should I also update webworker.generated.d.ts?

This PR adds `usageDetails` to `StorageEstimate`
with its own interface `StorageEstimateUsageDetails`
@lekoaf lekoaf requested a review from sandersn as a code owner May 27, 2020 10:19
@HolgerJeromin
Copy link
Contributor

Thanks for helping.
Is this a change in the widl from upstream?
I suspect no, so the correct place would be the addTypes.json

@lekoaf
Copy link
Author

lekoaf commented May 28, 2020

Thanks @HolgerJeromin. I'll see what I can come up with. 🙈

@saschanaz
Copy link
Contributor

The PR has no activity, and a single engine support only from Blink doesn't meet the standard to be added. It will be automatically added when it gets multiple engine supports.

@github-actions close

@github-actions github-actions bot closed this Mar 19, 2022
@github-actions
Copy link
Contributor

Closing because @saschanaz is one of the code-owners of this repository.

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

Successfully merging this pull request may close these issues.

4 participants