@awayfl/avm2
Version:
Virtual machine for executing AS3 code
129 lines • 5.35 kB
TypeScript
import { AXApplicationDomain } from './AXApplicationDomain';
import { ClassAliases } from '../amf';
import { AXClass } from './AXClass';
import { AXMethodClosureClass } from './AXMethodClosureClass';
import { AXXMLClass } from './AXXMLClass';
import { AXXMLListClass } from './AXXMLListClass';
import { AXQNameClass } from './AXQNameClass';
import { AXNamespaceClass } from './AXNamespaceClass';
import { GenericVector } from '../natives/GenericVector';
import { Int32Vector } from '../natives/int32Vector';
import { Uint32Vector } from '../natives/uint32Vector';
import { Float64Vector } from '../natives/float64Vector';
import { XMLParser } from '../natives/xml';
import { AXObject } from './AXObject';
import { ABCCatalog } from '../abc/lazy/ABCCatalog';
import { Multiname } from '../abc/lazy/Multiname';
import { ABCFile } from '../abc/lazy/ABCFile';
import { ClassInfo } from '../abc/lazy/ClassInfo';
import { MethodInfo } from '../abc/lazy/MethodInfo';
import { ExceptionInfo } from '../abc/lazy/ExceptionInfo';
import { AVMStage } from '@awayfl/swf-loader';
import { Scope } from './Scope';
import { AXFunction } from './AXFunction';
import { AXCallable } from './AXCallable';
import { AXActivation } from './AXActivation';
import { AXCatch } from './AXCatch';
import { AXGlobal } from './AXGlobal';
import { IGlobalInfo } from '../abc/lazy/IGlobalInfo';
/**
* Provides security isolation between application domains.
*/
export declare class AXSecurityDomain {
player: AVMStage;
system: AXApplicationDomain;
application: AXApplicationDomain;
classAliases: ClassAliases;
AXObject: AXClass;
AXArray: AXClass;
AXClass: AXClass;
AXFunction: AXClass;
AXMethodClosure: AXMethodClosureClass;
AXError: AXClass;
AXNumber: AXClass;
AXInt: AXClass;
AXUint: AXClass;
AXString: AXClass;
AXBoolean: AXClass;
AXRegExp: AXClass;
AXMath: AXClass;
AXDate: AXClass;
AXXML: AXXMLClass;
AXXMLList: AXXMLListClass;
AXNamespace: AXNamespaceClass;
AXQName: AXQNameClass;
ObjectVector: typeof GenericVector;
Int32Vector: typeof Int32Vector;
Uint32Vector: typeof Uint32Vector;
Float64Vector: typeof Float64Vector;
get xmlParser(): XMLParser;
private _xmlParser;
private AXPrimitiveBox;
private AXGlobalPrototype;
private AXActivationPrototype;
private AXCatchPrototype;
private _AXFunctionUndefinedPrototype;
get AXFunctionUndefinedPrototype(): any;
objectPrototype: AXObject;
argumentsPrototype: AXObject;
private rootClassPrototype;
private nativeClasses;
private vectorClasses;
private _catalogs;
constructor();
addCatalog(abcCatalog: ABCCatalog): void;
findDefiningABC(mn: Multiname): ABCFile;
throwError(className: string, error: any, replacement1?: any, replacement2?: any, replacement3?: any, replacement4?: any): void;
createError(className: string, error: any, replacement1?: any, replacement2?: any, replacement3?: any, replacement4?: any): any;
applyType(axClass: AXClass, types: AXClass[]): AXClass;
getVectorClass(type: AXClass): AXClass;
createVectorClass(type: AXClass): AXClass;
/**
* Constructs a plain vanilla object in this security domain.
*/
createObject(): any;
/**
* Takes a JS Object and transforms it into an AXObject.
*/
createObjectFromJS(value: Object, deep?: boolean): any;
/**
* Constructs an AXArray in this security domain and sets its value to the given array.
* Warning: This doesn't handle non-indexed keys.
*/
createArrayUnsafe(value: any[]): any;
/**
* Constructs an AXArray in this security domain and copies all enumerable properties of
* the given array, setting them as public properties on the AXArray.
* Warning: this does not use the given Array as the `value`.
*/
createArray(value: any[]): any;
/**
* Constructs an AXFunction in this security domain and sets its value to the given function.
*/
boxFunction(value: Function): any;
createClass(classInfo: ClassInfo, superClass: AXClass, scope: Scope): AXClass;
private initializeRuntimeTraits;
createFunction(methodInfo: MethodInfo, scope: Scope, hasDynamicScope: boolean): AXFunction;
createInitializerFunction(classInfo: ClassInfo, scope: Scope): AXCallable;
createActivation(methodInfo: MethodInfo, scope: Scope): AXActivation;
createCatch(exceptionInfo: ExceptionInfo, scope: Scope): AXCatch;
box(v: any): any;
isPrimitive(v: any): any;
createAXGlobal(applicationDomain: AXApplicationDomain, globalInfo: IGlobalInfo): AXGlobal;
/**
* Prepares the dynamic Class prototype that all Class instances (including Class) have in
* their prototype chain.
*
* This prototype defines the default hooks for all classes. Classes can override some or
* all of them.
*/
prepareRootClassPrototype(): void;
private initializeCoreNatives;
prepareNativeClass(exportName: string, name: string, isPrimitiveClass: boolean): AXClass;
preparePrimitiveClass(exportName: string, name: string, convert: any, defaultValue: any, coerce: any, isType: any, isInstanceOf: any): AXClass;
/**
* Configures all the builtin Objects.
*/
initialize(): void;
}
//# sourceMappingURL=AXSecurityDomain.d.ts.map