The REST API

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
SDK.REST.retrieveRecord("<SomeGuid>",
    "Account", // Entity type
    "", // Select string
    "", // Expand string
    function (account) { // Success callback
        // Code here..
    },
    function (error) { // Error callback

    }
);

From the given entity type in the function call, the TypeScript compiler can figure out that it is an Account entity result that should be expected in the success callback handler.

By knowing this, it can provide full intellisense for the retrieved account record and all of its attributes and relations!

Fork me on GitHub