UNPKG

@endo/compartment-mapper

Version:

The compartment mapper assembles Node applications in a sandbox

157 lines (66 loc) 4.04 kB
/** * The compartment mapper requires certain host capabilities. * These are the platform-neutral types for those capabilities. * For example, {@file node-powers.js} adapts Node.js how modules * to various subsets of these capabilities. * * @module */ /* eslint-disable no-use-before-define */ // #region read /** * All available read powers * * @template T The expected input/output type of the {@link CanonicalFn}. */ /** * @template T The expected input/output type of the {@link CanonicalFn}. */ /** * The extension of {@link ReadPowers} necessary for dynamic require support * * For a `ReadPowers` to be a `ReadNowPowers`: * * 1. It must be an object (not a {@link ReadFn}) * 2. Prop `maybeReadNow` is a function * 3. Prop `fileURLToPath` is a function * 4. Prop `isAbsolute` is a function * * @template T The expected input/output type of the {@link CanonicalFn}. */ /** * These properties are necessary for dynamic require support */ /** * Returns a canonical URL for a given URL, following redirects or symbolic * links if any exist along the path. Must return the given logical location if * the real location does not exist. * * @template T The expected input/output type of the {@link CanonicalFn}. This * may be a particular type of URL, such as a `FileUrlString`. */ /** * A function which reads some location and resolves with bytes. */ /** * A resolution of `undefined` indicates `ENOENT` or the equivalent. */ /** * A function which reads some location and returns bytes. */ /** * A resolution of `undefined` indicates `ENOENT` or the equivalent. */ /** * Returns a string hash of a byte array */ /** * Read powers with a {@link HashFn}. * * @template T The expected input/output type of the {@link CanonicalFn}. */ // #endregion // #region write // #endregion // #region execute // #endregion