0

Just wondering if anyone has added typings for any of the client side javascript libraries out there?

If not, is forcetk still the latest and greatest solution (will be using primarily for VF pages)? Seems like it hasn't been updated in a couple years. Want to make sure I pick the best library if I'm going to commit to manually adding typings.

0

I couldn't find a decent option so I wrote one: ts-force

It leverages code generation to build concrete types for whatever SObjects you want to work with.

Example:

let acc = new Account({ //all props can be set in constructor
    name: 'John Doe',
    website: 'example.com'
});
await acc.insert();
acc.name = 'Jane Doe';
await acc.update(); //passing true refreshes SObject after update

//supports relationships
let contacts = Contact.retrieve(`[SELECT Id, Name, Owner.Id, Owner.Name 
                                  FROM Contact WHERE AccountId ='${acc.id}'`);

let user = contacts[0].owner
user.email = 'john@example.com'
user.update(true) //passing true causes the user object to be refreshed

It currently support standard REST operations, as well as the more powerful composite API. Plans to add bulk and other API's in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.