/** * Copyright 2014 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AVM1Movie } from "./ISecurityDomain"; import { AnalyzerResults } from "./analyze"; import { IAVM1Builtins, IAVM1Context } from "./runtime"; import { AVM1Globals } from "./lib/AVM1Globals"; import { AVM1MovieClip } from "./lib/AVM1MovieClip"; import { LoaderInfo } from "./customAway/LoaderInfo"; import { AVMAwayStage } from "./AVMAwayStage"; import { AVM1Object } from "./runtime/AVM1Object"; import { AVM1Function } from "./runtime/AVM1Function"; export declare class AVM1ActionsData { bytes: Uint8Array; id: string; parent: AVM1ActionsData; ir: AnalyzerResults; compiled: Function; constructor(bytes: Uint8Array, id: string, parent?: AVM1ActionsData); } export interface AVM1ExportedSymbol { symbolId: number; symbolProps: any; } export interface IAVM1RuntimeUtils { hasProperty(obj: any, name: any): boolean; getProperty(obj: any, name: any): any; setProperty(obj: any, name: any, value: any): void; warn(msg: string): void; } export interface IAVM1EventPropertyObserver { onEventPropertyModified(name: string): any; } export declare class ActionsDataFactory { private _cache; createActionsData(bytes: Uint8Array, id: string, parent?: AVM1ActionsData): AVM1ActionsData; } export declare class AVM1Context implements IAVM1Context { loaderInfo: LoaderInfo; sec: any; globals: AVM1Globals; builtins: IAVM1Builtins; isPropertyCaseSensitive: boolean; actionsDataFactory: ActionsDataFactory; swfVersion: number; levelsContainer: AVM1Movie; private eventObservers; private assets; private awayAssets; private assetsSymbols; private assetsClasses; private staticStates; constructor(swfVersion: number); utils: IAVM1RuntimeUtils; static create: (loaderInfo: LoaderInfo) => AVM1Context; resolveTarget(target: any): any; resolveRoot(): any; checkTimeout(): void; executeActions(actionsData: AVM1ActionsData, scopeObj: any): void; executeFunction(fn: AVM1Function, thisArg: any, args: any): any; /** * Normalize the name according to the current AVM1Context's settings. * * This entails coercing it to number or string. For SWF versions < 7, it also means converting * it to lower-case. * To avoid runtime checks, the implementation is set during context initialization based on * the SWF version. */ normalizeName: (name: any) => string; private normalizeNameCaseSensitive; private _nameCache; private normalizeNameCaseInsensitive; private _getEventPropertyObservers; registerEventPropertyObserver(propertyName: string, observer: IAVM1EventPropertyObserver): void; unregisterEventPropertyObserver(propertyName: string, observer: IAVM1EventPropertyObserver): void; broadcastEventPropertyChange(propertyName: string): void; addAsset(className: string, symbolId: number, symbolProps: any): void; registerClass(className: string, theClass: AVM1Object): void; getSymbolClass(symbolId: number): AVM1Object; getAsset(className: string): AVM1ExportedSymbol; reset(): void; private htmlElement; setStage(stage: AVMAwayStage, htmlElement: any): void; getStaticState(cls: any): any; resolveLevel(level: number): AVM1MovieClip; }