@endo/compartment-mapper
Version:
The compartment mapper assembles Node applications in a sandbox
51 lines • 2.12 kB
TypeScript
export function makeReadNowPowers({ fs, url, crypto, path, }: {
fs: FsInterface;
url?: UrlInterface | undefined;
crypto?: CryptoInterface | undefined;
path?: PathInterface | undefined;
}): ReadNowPowers<FileUrlString>;
/**
* The implementation of `makeReadPowers` and the deprecated
* `makeNodeReadPowers` handles the case when the `url` power is not provided,
* but `makeReadPowers` presents a type that requires `url`.
*
* @param {object} args
* @param {FsInterface} args.fs
* @param {UrlInterface} [args.url]
* @param {CryptoInterface} [args.crypto]
* @param {PathInterface} [args.path]
* @returns {MaybeReadPowers<FileUrlString>}
*/
export function makeReadPowers({ fs, url, crypto, path, }: {
fs: FsInterface;
url?: UrlInterface | undefined;
crypto?: CryptoInterface | undefined;
path?: PathInterface | undefined;
}): MaybeReadPowers<FileUrlString>;
/**
* The implementation of `makeWritePowers` and the deprecated
* `makeNodeWritePowers` handles the case when the `url` power is not provided,
* but `makeWritePowers` presents a type that requires `url`.
*
* @param {object} args
* @param {FsInterface} args.fs
* @param {UrlInterface} [args.url]
*/
export function makeWritePowers({ fs, url }: {
fs: FsInterface;
url?: UrlInterface | undefined;
}): {
write: (location: string, data: Uint8Array) => Promise<void>;
};
export function makeNodeReadPowers(fs: FsInterface, crypto?: CryptoInterface): ReadPowers<FileUrlString>;
export function makeNodeWritePowers(fs: FsInterface): WritePowers;
import type { FsInterface } from './types/node-powers.js';
import type { UrlInterface } from './types/node-powers.js';
import type { CryptoInterface } from './types/node-powers.js';
import type { PathInterface } from './types/node-powers.js';
import type { FileUrlString } from './types/external.js';
import type { ReadNowPowers } from './types/powers.js';
import type { MaybeReadPowers } from './types/powers.js';
import type { ReadPowers } from './types/powers.js';
import type { WritePowers } from './types/powers.js';
//# sourceMappingURL=node-powers.d.ts.map