@locker/near-membrane-base
Advanced tools
Comparing version 0.9.26 to 0.9.27
{ | ||
"name": "@locker/near-membrane-base", | ||
"version": "0.9.26", | ||
"version": "0.9.27", | ||
"license": "MIT", | ||
@@ -23,3 +23,3 @@ "author": "Caridy Patiño <caridy@gmail.com>", | ||
}, | ||
"gitHead": "ceb068cab927275ccdf34f7d8eae746bffcf8c70" | ||
"gitHead": "3543f940c4995ef1a8c174db137adda0cd71de82" | ||
} |
import { createMembraneMarshall } from './membrane'; | ||
export declare function createBlueConnector(globalObjectVirtualizationTarget?: WindowProxy & typeof globalThis): ReturnType<typeof createMembraneMarshall>; | ||
export declare function createRedConnector(evaluator: typeof eval): ReturnType<typeof createMembraneMarshall>; | ||
export declare type Connector = ReturnType<typeof createMembraneMarshall>; | ||
export declare function createBlueConnector(globalObject: typeof globalThis): Connector; | ||
export declare function createRedConnector(evaluator: typeof eval): Connector; | ||
//# sourceMappingURL=connector.d.ts.map |
@@ -0,8 +1,9 @@ | ||
import { DistortionCallback, ProxyTarget } from './membrane'; | ||
import { Connector } from './connector'; | ||
import { Instrumentation } from './instrumentation'; | ||
import { createMembraneMarshall, DistortionCallback, ProxyTarget } from './membrane'; | ||
import { PropertyKeys } from './types'; | ||
interface VirtualEnvironmentOptions { | ||
blueConnector: ReturnType<typeof createMembraneMarshall>; | ||
export interface VirtualEnvironmentOptions { | ||
blueConnector: Connector; | ||
distortionCallback?: DistortionCallback; | ||
redConnector: ReturnType<typeof createMembraneMarshall>; | ||
redConnector: Connector; | ||
instrumentation?: Instrumentation; | ||
@@ -30,3 +31,2 @@ } | ||
} | ||
export {}; | ||
//# sourceMappingURL=environment.d.ts.map |
@@ -7,2 +7,3 @@ export * from './connector'; | ||
export * from './types'; | ||
export * from './utils'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -5,3 +5,3 @@ import { VirtualEnvironment } from './environment'; | ||
export declare function getFilteredGlobalOwnKeys(source: object): PropertyKeys; | ||
export declare function linkIntrinsics(env: VirtualEnvironment, globalObjectVirtualizationTarget: typeof globalThis): void; | ||
export declare function linkIntrinsics(env: VirtualEnvironment, globalObject: typeof globalThis): void; | ||
//# sourceMappingURL=intrinsics.d.ts.map |
@@ -1,31 +0,8 @@ | ||
/** | ||
* This file contains an exportable (portable) function `init()` used to initialize | ||
* one side of a membrane on any realm. The only prerequisite is the ability to | ||
* evaluate the sourceText of the `init()` function there. Once evaluated, the | ||
* function will return a set of values that can be used to wire up the side of | ||
* the membrane with another existing `init()` function from another realm, in | ||
* which case they will exchange callable functions that are required to connect | ||
* the two realms via the membrane. | ||
* | ||
* About the mechanics of the membrane, there are few important considerations: | ||
* | ||
* 1. Pointers are the way to pass reference to object and functions. | ||
* 2. A dedicated symbol (LOCKER_NEAR_MEMBRANE_UNDEFINED_VALUE_SYMBOL) is needed | ||
* to represent the absence of a value. | ||
* 3. The realm that owns the object or function is responsible for projecting | ||
* the proxy onto the other side (via callablePushTarget), which returns a | ||
* Pointer that can be used by the realm to pass the reference to the same | ||
* proxy over and over again. | ||
* 4. The realm that owns the proxy (after the other side projects it into it) | ||
* will hold a Pointer alongside the proxy to signal what original object or | ||
* function should the foreign operation operates, it is always the first | ||
* argument of the foreign callable for proxies, and the other side can use | ||
* it via `selectedTarget!`. | ||
*/ | ||
import { Instrumentation } from './instrumentation'; | ||
import { PropertyKey, PropertyKeys } from './types'; | ||
declare type CallablePushTarget = (foreignTargetPointer: () => void, foreignTargetTraits: number, foreignTargetFunctionArity: number | undefined, foreignTargetFunctionName: string | undefined) => Pointer; | ||
import { Getter, PropertyKey, PropertyKeys } from './types'; | ||
declare type CallablePushTarget = (foreignTargetPointer: () => void, foreignTargetTraits: number, foreignTargetFunctionArity: number, foreignTargetFunctionName: string, foreignTargetTypedArrayLength: number) => Pointer; | ||
declare type CallablePushErrorTarget = CallablePushTarget; | ||
declare type CallableApply = (targetPointer: Pointer, thisArgPointerOrUndefined: PointerOrPrimitive, ...args: PointerOrPrimitive[]) => PointerOrPrimitive; | ||
declare type CallableConstruct = (targetPointer: Pointer, newTargetPointer: PointerOrPrimitive, ...args: PointerOrPrimitive[]) => PointerOrPrimitive; | ||
declare type CallableDefineProperty = (targetPointer: Pointer, key: PropertyKey, configurable: boolean | symbol, enumerable: boolean | symbol, writable: boolean | symbol, valuePointer: PointerOrPrimitive, getPointer: PointerOrPrimitive, setPointer: PointerOrPrimitive, foreignCallableNonConfigurableDescriptorCallback: CallableNonConfigurableDescriptorCallback) => boolean; | ||
declare type CallableDefineProperty = (targetPointer: Pointer, key: PropertyKey, configurable: boolean | symbol, enumerable: boolean | symbol, writable: boolean | symbol, valuePointer: PointerOrPrimitive, getterPointer: PointerOrPrimitive, setterPointer: PointerOrPrimitive, foreignCallableNonConfigurableDescriptorCallback: CallableNonConfigurableDescriptorCallback) => boolean; | ||
declare type CallableDeleteProperty = (targetPointer: Pointer, key: PropertyKey) => boolean; | ||
@@ -40,6 +17,7 @@ declare type CallableGet = (targetPointer: Pointer, targetTraits: number, key: PropertyKey, receiverPointerOrPrimitive: PointerOrPrimitive) => PointerOrPrimitive; | ||
declare type CallableSet = (targetPointer: Pointer, key: PropertyKey, valuePointerOrPrimitive: PointerOrPrimitive, receiverPointerOrPrimitive: PointerOrPrimitive) => boolean; | ||
declare type CallableDebugInfo = (...args: Parameters<typeof console.info>) => boolean; | ||
declare type CallableDebugInfo = (...args: Parameters<typeof console.info>) => void; | ||
declare type CallableGetLazyPropertyDescriptorStateByTarget = (targetPointer: Pointer) => PointerOrPrimitive; | ||
declare type CallableGetTargetIntegrityTraits = (targetPointer: Pointer) => number; | ||
declare type CallableGetToStringTagOfTarget = (targetPointer: Pointer) => string; | ||
declare type CallableGetTypedArrayIndexedValue = (targetPointer: Pointer, index: PropertyKey) => number | bigint; | ||
declare type CallableInstallErrorPrepareStackTrace = () => void; | ||
@@ -53,3 +31,3 @@ declare type CallableIsTargetLive = (targetPointer: Pointer) => boolean; | ||
declare type CallableBatchGetPrototypeOfWhenHasNoOwnPropertyDescriptor = (targetPointer: Pointer, key: PropertyKey, foreignCallableDescriptorCallback: CallableDescriptorCallback) => PointerOrPrimitive; | ||
declare type CallableDescriptorCallback = (key: PropertyKey, configurable: boolean | symbol, enumerable: boolean | symbol, writable: boolean | symbol, valuePointer: PointerOrPrimitive, getPointer: PointerOrPrimitive, setPointer: PointerOrPrimitive) => void; | ||
declare type CallableDescriptorCallback = (key: PropertyKey, configurable: boolean | symbol, enumerable: boolean | symbol, writable: boolean | symbol, valuePointer: PointerOrPrimitive, getterPointer: PointerOrPrimitive, setterPointer: PointerOrPrimitive) => void; | ||
declare type CallableDescriptorsCallback = (...descriptorTuples: [...Parameters<CallableDescriptorCallback>]) => void; | ||
@@ -71,9 +49,9 @@ declare type CallableNonConfigurableDescriptorCallback = CallableDescriptorCallback; | ||
export declare type DistortionCallback = (target: ProxyTarget) => ProxyTarget; | ||
export declare type GetSelectedTarget = () => any; | ||
export declare type GetSelectedTarget = Getter; | ||
export declare type GetTransferableValue = (value: any) => PointerOrPrimitive; | ||
export declare type HooksCallback = (globalThisPointer: Pointer | undefined, getSelectedTarget: GetSelectedTarget | undefined, getTransferableValue: GetTransferableValue | undefined, callableGetPropertyValuePointer: CallableGetPropertyValuePointer | undefined, callableEvaluate: CallableEvaluate | undefined, callableLinkPointers: CallableLinkPointers | undefined, callablePushTarget: CallablePushTarget, callableApply: CallableApply, callableConstruct: CallableConstruct, callableDefineProperty: CallableDefineProperty, callableDeleteProperty: CallableDeleteProperty, callableGet: CallableGet, callableGetOwnPropertyDescriptor: CallableGetOwnPropertyDescriptor, callableGetPrototypeOf: CallableGetPrototypeOf, callableHas: CallableHas, callableIsExtensible: CallableIsExtensible, callableOwnKeys: CallableOwnKeys, callablePreventExtensions: CallablePreventExtensions, callableSet: CallableSet, callableSetPrototypeOf: CallableSetPrototypeOf, callableDebugInfo: CallableDebugInfo, callableDefineProperties: CallableDefineProperties | undefined, callableGetLazyPropertyDescriptorStateByTarget: CallableGetLazyPropertyDescriptorStateByTarget, callableGetTargetIntegrityTraits: CallableGetTargetIntegrityTraits, callableGetToStringTagOfTarget: CallableGetToStringTagOfTarget, callableInstallErrorPrepareStackTrace: CallableInstallErrorPrepareStackTrace, callableInstallLazyPropertyDescriptors: CallableInstallLazyPropertyDescriptors | undefined, callableIsTargetLive: CallableIsTargetLive, callableIsTargetRevoked: CallableIsTargetRevoked, callableSerializeTarget: CallableSerializeTarget, callableSetLazyPropertyDescriptorStateByTarget: CallableSetLazyPropertyDescriptorStateByTarget, callableBatchGetPrototypeOfAndGetOwnPropertyDescriptors: CallableBatchGetPrototypeOfAndGetOwnPropertyDescriptors, callableBatchGetPrototypeOfWhenHasNoOwnProperty: CallableBatchGetPrototypeOfWhenHasNoOwnProperty, callableBatchGetPrototypeOfWhenHasNoOwnPropertyDescriptor: CallableBatchGetPrototypeOfWhenHasNoOwnPropertyDescriptor) => void; | ||
export declare type HooksCallback = (globalThisPointer: Pointer | undefined, getSelectedTarget: GetSelectedTarget | undefined, getTransferableValue: GetTransferableValue | undefined, callableGetPropertyValuePointer: CallableGetPropertyValuePointer | undefined, callableEvaluate: CallableEvaluate | undefined, callableLinkPointers: CallableLinkPointers | undefined, callablePushErrorTarget: CallablePushErrorTarget, callablePushTarget: CallablePushTarget, callableApply: CallableApply, callableConstruct: CallableConstruct, callableDefineProperty: CallableDefineProperty, callableDeleteProperty: CallableDeleteProperty, callableGet: CallableGet, callableGetOwnPropertyDescriptor: CallableGetOwnPropertyDescriptor, callableGetPrototypeOf: CallableGetPrototypeOf, callableHas: CallableHas, callableIsExtensible: CallableIsExtensible, callableOwnKeys: CallableOwnKeys, callablePreventExtensions: CallablePreventExtensions, callableSet: CallableSet, callableSetPrototypeOf: CallableSetPrototypeOf, callableDebugInfo: CallableDebugInfo, callableDefineProperties: CallableDefineProperties | undefined, callableGetLazyPropertyDescriptorStateByTarget: CallableGetLazyPropertyDescriptorStateByTarget, callableGetTargetIntegrityTraits: CallableGetTargetIntegrityTraits, callableGetToStringTagOfTarget: CallableGetToStringTagOfTarget, callableGetTypedArrayIndexedValue: CallableGetTypedArrayIndexedValue, callableInstallErrorPrepareStackTrace: CallableInstallErrorPrepareStackTrace, callableInstallLazyPropertyDescriptors: CallableInstallLazyPropertyDescriptors | undefined, callableIsTargetLive: CallableIsTargetLive, callableIsTargetRevoked: CallableIsTargetRevoked, callableSerializeTarget: CallableSerializeTarget, callableSetLazyPropertyDescriptorStateByTarget: CallableSetLazyPropertyDescriptorStateByTarget, callableBatchGetPrototypeOfAndGetOwnPropertyDescriptors: CallableBatchGetPrototypeOfAndGetOwnPropertyDescriptors, callableBatchGetPrototypeOfWhenHasNoOwnProperty: CallableBatchGetPrototypeOfWhenHasNoOwnProperty, callableBatchGetPrototypeOfWhenHasNoOwnPropertyDescriptor: CallableBatchGetPrototypeOfWhenHasNoOwnPropertyDescriptor) => void; | ||
export declare type Pointer = CallableFunction; | ||
export declare type ProxyTarget = CallableFunction | any[] | object; | ||
export declare function createMembraneMarshall(globalObjectVirtualizationTarget?: WindowProxy & typeof globalThis): (color: string, foreignCallableHooksCallback: HooksCallback, options?: HooksOptions | undefined) => HooksCallback; | ||
export declare function createMembraneMarshall(globalObject?: typeof globalThis | (WindowProxy & typeof globalThis)): (color: string, foreignCallableHooksCallback: HooksCallback, options?: HooksOptions | undefined) => HooksCallback; | ||
export {}; | ||
//# sourceMappingURL=membrane.d.ts.map |
@@ -0,3 +1,5 @@ | ||
export declare type Getter = () => any; | ||
export declare type PropertyKey = string | symbol; | ||
export declare type PropertyKeys = PropertyKey[]; | ||
export declare type Setter = (value: any) => void; | ||
//# sourceMappingURL=types.d.ts.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
367877
21
7637