endo icon indicating copy to clipboard operation
endo copied to clipboard

fix(compartment-mapper): fix ReadPowers-related types

Open boneskull opened this issue 1 year ago • 1 comments

Description

This change:

  1. Creates a minimal interface for the fs, url, and crypto objects as passed into makeReadPowers(). This makes it easier to duck-type the objects. The drawback here is that it is not future-proof, and these types will need to be updated if we end up using additional methods on these objects.
  2. Fixes the invalid type of MaybeReadPowers; properties (defined thru @property) are ignored in a @typedef of that @typedef does not extend object/Object.
  3. Added necessary type assertion in powers.js
  4. Adds return type to makeReadPowersSloppy()

Upgrade Considerations

This is a type-only change.

boneskull avatar Mar 28 '24 19:03 boneskull

  • #2190 Graphite
  • #2189 Graphite
  • #2188 Graphite 👈
  • master

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @boneskull and the rest of your teammates on Graphite Graphite

boneskull avatar Mar 28 '24 19:03 boneskull