@awayfl/avm1
Version:
Virtual machine for executing AS1 and AS2 code
130 lines • 5.06 kB
TypeScript
import { IAVM1Context } from './runtime';
import { AVM1Object } from './runtime/AVM1Object';
import { AVM1Function } from './runtime/AVM1Function';
import { AVM1PropertyDescriptor } from './runtime/AVM1PropertyDescriptor';
export declare class AVM1ObjectFunction extends AVM1Function {
constructor(context: IAVM1Context);
registerClass(name: any, theClass: any): void;
alConstruct(args?: any[]): AVM1Object;
alCall(thisArg: any, args?: any[]): any;
}
export declare class AVM1FunctionFunction extends AVM1Function {
constructor(context: IAVM1Context);
alConstruct(args?: any[]): AVM1Object;
alCall(thisArg: any, args?: any[]): any;
}
export declare class AVM1BooleanNative extends AVM1Object {
value: boolean;
constructor(context: IAVM1Context, value: boolean);
valueOf(): any;
}
export declare class AVM1BooleanPrototype extends AVM1Object {
constructor(context: IAVM1Context);
_valueOf(): boolean;
_toString(): "false" | "true";
}
export declare class AVM1BooleanFunction extends AVM1Function {
constructor(context: IAVM1Context);
alConstruct(args?: any[]): AVM1Object;
alCall(thisArg: any, args?: any[]): any;
}
export declare class AVM1NumberNative extends AVM1Object {
value: number;
constructor(context: IAVM1Context, value: number);
valueOf(): any;
}
export declare class AVM1NumberPrototype extends AVM1Object {
constructor(context: IAVM1Context);
_valueOf(): number;
_toString(radix: any): string;
}
export declare class AVM1NumberFunction extends AVM1Function {
constructor(context: IAVM1Context);
alConstruct(args?: any[]): AVM1Object;
alCall(thisArg: any, args?: any[]): any;
}
export declare class AVM1StringNative extends AVM1Object {
value: string;
constructor(context: IAVM1Context, value: string);
toString(): string;
}
export declare class AVM1StringPrototype extends AVM1Object {
constructor(context: IAVM1Context);
_valueOf(): string;
_toString(): string;
getLength(): number;
charAt(index: number): string;
charCodeAt(index: number): number;
concat(...items: AVM1Object[]): string;
indexOf(searchString: string, position?: number): number;
lastIndexOf(searchString: string, position?: number): number;
slice(start: number, end?: number): string;
split(separator: any, limit?: number): AVM1ArrayNative;
substr(start: number, length?: number): string;
substring(start: number, end?: number): string;
toLowerCase(): string;
toUpperCase(): string;
}
export declare class AVM1StringFunction extends AVM1Function {
constructor(context: IAVM1Context);
alConstruct(args?: any[]): AVM1Object;
alCall(thisArg: any, args?: any[]): any;
fromCharCode(...codes: number[]): string;
}
export declare class AVM1ArrayNative extends AVM1Object {
value: any[];
constructor(context: IAVM1Context, value: any[]);
alGetOwnProperty(p: any): AVM1PropertyDescriptor;
alSetOwnProperty(p: any, v: AVM1PropertyDescriptor): void;
alDeleteOwnProperty(p: any): void;
alGetOwnPropertiesKeys(): string[];
/**
* Creates a JavaScript array from the AVM1 list object.
* @param arr An array-like AVM1 object.
* @param fn A function that converts AVM1 list object item to JavaScript object.
* @param thisArg Optional. Value to use as this when executing fn.
* @returns {any[]} A JavaScript array.
*/
static mapToJSArray(arr: AVM1Object, fn: (item: any, index?: number) => any, thisArg?: any): any[];
}
export declare class AVM1ArrayPrototype extends AVM1Object {
constructor(context: IAVM1Context);
_toString(): string;
getLength(): number;
setLength(length: number): void;
concat(...items: any[]): AVM1Object;
join(separator?: string): string;
pop(): any;
push(...items: any[]): number;
reverse(): any;
shift(): any;
slice(start: number, end?: number): AVM1Object;
splice(start: number, deleteCount: number, ...items: any[]): AVM1Object;
sort(comparefn?: AVM1Function): AVM1Object;
sortOn(fieldNames: AVM1Object, options: any): AVM1Object;
unshift(...items: any[]): number;
}
export declare class AVM1ArrayFunction extends AVM1Function {
constructor(context: IAVM1Context);
alConstruct(args?: any[]): AVM1Object;
alCall(thisArg: any, args?: any[]): any;
}
export declare class AVM1ErrorNative extends AVM1Object {
constructor(context: IAVM1Context, message: string);
}
export declare class AVM1ErrorPrototype extends AVM1Object {
constructor(context: IAVM1Context);
_toString(): any;
}
export declare class AVM1ErrorFunction extends AVM1Function {
constructor(context: IAVM1Context);
alConstruct(args?: any[]): AVM1Object;
alCall(thisArg: any, args?: any[]): any;
}
/**
* Installs built-ins on the AVM1Context. It shall be a first call before
* any AVM1Object is instantiated.
* @param {IAVM1Context} context
*/
export declare function installBuiltins(context: IAVM1Context): void;
//# sourceMappingURL=natives.d.ts.map