diff --git a/appletvjs/appletvjs-tests.ts b/appletvjs/appletvjs-tests.ts index ece6a00dbe..8bdda9c633 100644 --- a/appletvjs/appletvjs-tests.ts +++ b/appletvjs/appletvjs-tests.ts @@ -85,13 +85,27 @@ function test_MediaItem() { mediaItem.resumeTime = 0; mediaItem.subtitle = "Subtitle"; - mediaItem.loadAssetID = function (url, callback) { + var loadAssetIDCallback = function (assetID: string, error: string) { //do something }; - mediaItem.loadCertificate = function (url, callback) { + + mediaItem.loadAssetID = function (url: string, loadAssetIDCallback: (assetID: string, error: string) => void) { //do something }; - mediaItem.loadKey = function (url, callback) { + + var loadCertificateCallback = function (certificate: string, error: string) { + //do something + }; + + mediaItem.loadCertificate = function (url: string, loadCertificateCallback: (certificate: string, error: string) => void) { + //do something + }; + + var loadKeyCallback = function (key: string, renewalDate: string, error: string) { + //do something + }; + + mediaItem.loadKey = function (url: string, loadKeyCallback: (key: string, renewalDate: string, error: string) => void) { //do something }; } diff --git a/appletvjs/appletvjs.d.ts b/appletvjs/appletvjs.d.ts index c26ef5c172..7e3847cd2e 100644 --- a/appletvjs/appletvjs.d.ts +++ b/appletvjs/appletvjs.d.ts @@ -1,5 +1,5 @@ // Type definitions for AppleTVJS -// Reference: https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSFrameworkReference/index.html +// Project: https://developer.apple.com/library/prerelease/tvos/documentation/TVMLJS/Reference/TVJSFrameworkReference/index.html // Definitions by: Adam Valverde // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -179,13 +179,13 @@ declare module AppleTVJS { resumeTime: number; /** A callback function used to load the asset identifier for an item. */ - loadAssetID: (url, callback) => void; + loadAssetID: (url: string, callback: (assetID: string, error: string) => void) => void; /** A callback function used to load the security certificate for an item. */ - loadCertificate: (url, callback) => void; + loadCertificate: (url: string, callback: (certificate: string, error: string) => void) => void; /** A callback function used to load the security key for an item. */ - loadKey: (url, callback) => void; + loadKey: (url: string, requestData: any, callback: (key: string, renewalDate: string, error: string) => void) => void; } interface MenuBarDocument {