Update swfobject to work with other scopes and variable names.

This commit is contained in:
Payton Yao
2014-11-07 16:20:40 +08:00
parent b9b6d6b3d5
commit 01c33d5b56
+74 -70
View File
@@ -3,90 +3,94 @@
// Definitions by: rou <https://github.com/rou>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module swfobject {
export var ua: {
w3: boolean;
pv: number[];
wk: any; // number or boolean
ie: boolean;
win: boolean;
mac: boolean;
};
declare var swfobject: swfobject.SwfObject;
export function registerObject(
objectIdStr: string,
swfVersionStr: string,
xiSwfUrlStr?: string,
callbackFn?: (callbackObj: ICallbackObj) => void
declare module swfobject {
export interface SwfObject {
ua: {
w3: boolean;
pv: number[];
wk: any; // number or boolean
ie: boolean;
win: boolean;
mac: boolean;
};
registerObject(
objectIdStr: string,
swfVersionStr: string,
xiSwfUrlStr?: string,
callbackFn?: (callbackObj: ICallbackObj) => void
): void;
export function getObjectById(
objectIdStr: string
getObjectById(
objectIdStr: string
): HTMLElement;
export function embedSWF(
swfUrlStr: string,
replaceElemIdStr: string,
widthStr: string,
heightStr: string,
swfVersionStr: string,
xiSwfUrlStr?: string,
flashvarsObj?: Object,
parObj?: Object,
attObj?: Object,
callbackFn?: (callbackObj: ICallbackObj) => void
embedSWF(
swfUrlStr: string,
replaceElemIdStr: string,
widthStr: string,
heightStr: string,
swfVersionStr: string,
xiSwfUrlStr?: string,
flashvarsObj?: Object,
parObj?: Object,
attObj?: Object,
callbackFn?: (callbackObj: ICallbackObj) => void
): void;
export function switchOffAutoHideShow(): void;
switchOffAutoHideShow(): void;
export function getFlashPlayerVersion(): IFlashPlayerVersion;
getFlashPlayerVersion(): IFlashPlayerVersion;
interface IFlashPlayerVersion {
hasFlashPlayerVersion(
rv: string
): void;
createSWF(
attObj: ISwfObjectAttribute,
parObj: ISwfObjectParameter,
replaceElemIdStr: string
): HTMLElement;
showExpressInstall(
att: ISwfObjectAttribute,
par: ISwfObjectParameter,
replaceElemIdStr: string,
callbackFn?: (callbackObj: ICallbackObj) => void
): void;
removeSWF(
objElemIdStr: string
): void;
createCSS(
selStr: string,
declStr: string,
mediaStr?: string,
newStyleBoolean?: boolean
): void;
addDomLoadEvent(
fn: () => void
): void;
addLoadEvent(
fn: (event?: Event) => void
): void;
getQueryParamValue(
param?: string
): string;
}
export interface IFlashPlayerVersion {
major: number;
minor: number;
release: number;
}
export function hasFlashPlayerVersion(
rv: string
): void;
export function createSWF(
attObj: ISwfObjectAttribute,
parObj: ISwfObjectParameter,
replaceElemIdStr: string
): HTMLElement;
export function showExpressInstall(
att: ISwfObjectAttribute,
par: ISwfObjectParameter,
replaceElemIdStr: string,
callbackFn?: (callbackObj: ICallbackObj) => void
): void;
export function removeSWF(
objElemIdStr: string
): void;
export function createCSS(
selStr: string,
declStr: string,
mediaStr?: string,
newStyleBoolean?: boolean
): void;
export function addDomLoadEvent(
fn: () => void
): void;
export function addLoadEvent(
fn: (event?: Event) => void
): void;
export function getQueryParamValue(
param?: string
): string;
export interface ISwfObjectAttribute {
id?: string;
width?: string;