diff --git a/swfobject/swfobject-tests.d.ts b/swfobject/swfobject-tests.d.ts new file mode 100644 index 0000000000..9bf4d09f7c --- /dev/null +++ b/swfobject/swfobject-tests.d.ts @@ -0,0 +1,3 @@ +/// + +var userAgent = swfobject.ua; diff --git a/swfobject/swfobject.d.ts b/swfobject/swfobject.d.ts index 55fe3de4c7..f13f8a87a2 100644 --- a/swfobject/swfobject.d.ts +++ b/swfobject/swfobject.d.ts @@ -1,103 +1,105 @@ -// Type definitions for swfobject 2.2 -// https://code.google.com/p/swfobject/ +// Type definitions for swfobject v2.2 +// Project: https://code.google.com/p/swfobject/ +// 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; - ie: boolean; - win: boolean; - mac: boolean; - }; + export var ua: { + w3: boolean; + pv: number[]; + wk: any; // number or boolean + ie: boolean; + win: boolean; + mac: boolean; + }; - export function registerObject( - objectIdStr: string, - swfVersionStr: string, - xiSwfUrlStr: string, - callbackFn: (callbackObj: ICallbackObj) => void - ): void + export function registerObject( + objectIdStr: string, + swfVersionStr: string, + xiSwfUrlStr?: string, + callbackFn?: (callbackObj: ICallbackObj) => void + ): void; - export function getObjectById( - objectIdStr: string - ): HTMLElement; + export function 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 - ): void; + 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 + ): void; - export function switchOffAutoHideShow(): void; + export function switchOffAutoHideShow(): void; - export function getFlashPlayerVersion(): IFlashPlayerVersion; + export function getFlashPlayerVersion(): IFlashPlayerVersion; - interface IFlashPlayerVersion { - major: number; - minor: number; - release: number; - } + interface IFlashPlayerVersion { + major: number; + minor: number; + release: number; + } - export function hasPlayerVersion( - rv: string - ): void; + export function hasPlayerVersion( + rv: string + ): void; - export function createSWF( - attObj: ISwfObjectAttribute, - parObj: ISwfObjectParameter, - replaceElemIdStr: string - ): HTMLElement; + 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 showExpressInstall( + att: ISwfObjectAttribute, + par: ISwfObjectParameter, + replaceElemIdStr: string, + callbackFn?: (callbackObj: ICallbackObj) => void + ): void; - export function removeSWF( - objElemIdStr: string - ): void; + export function removeSWF( + objElemIdStr: string + ): void; - export function createCSS( - selStr: string, - declStr: string, - mediaStr: string, - newStyleBoolean: boolean - ): void; + export function createCSS( + selStr: string, + declStr: string, + mediaStr?: string, + newStyleBoolean?: boolean + ): void; - export function addDomLoadEvent( - fn: () => void - ): void; + export function addDomLoadEvent( + fn: () => void + ): void; - export function addLoadEvent( - fn: (event?: Event) => void - ): void; + export function addLoadEvent( + fn: (event?: Event) => void + ): void; - export function getQueryParamValue( - param?: string - ): string; + export function getQueryParamValue( + param?: string + ): string; - export interface ISwfObjectAttribute { - id?: string; - width?: string; - height?: string; - } + export interface ISwfObjectAttribute { + id?: string; + width?: string; + height?: string; + } - export interface ISwfObjectParameter { - flashvars?: string; - } + export interface ISwfObjectParameter { + flashvars?: string; + } - export interface ICallbackObj { - success: boolean; - id: string; - ref?: HTMLElement; - } + export interface ICallbackObj { + success: boolean; + id: string; + ref?: HTMLElement; + } }