Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Could eventually be added to TSD, or to jsforce package root...
- */
- declare module "jsforce" {
- class Connection {
- constructor({ loginUrl: string});
- login(username: string, password: string, callback: (err: Error, userInfo: UserInfo) => void);
- sobject(type: 'Account'): SObject<Account>;
- }
- interface UserInfo {
- id: string;
- organizationId: string;
- url: string;
- }
- interface SObject<T> {
- retrieve(id: string, callback: (err: Error, ret: T & ResponseExtra) => void);
- retrieve(id: string[], callback: (err: Error, ret: (T & ResponseExtra)[]) => void);
- upsert(record: any, extIdField: string, callback: (err: Error, ret: any) => void);
- }
- interface Account {
- Id: string;
- Name: string;
- // ...
- }
- interface ResponseExtra {
- attributes: Attributes;
- }
- interface Attributes {
- type: string;
- url: string;
- }
- export {
- Connection,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement