UNPKG

1.07 kBTypeScriptView Raw
1import { Stream } from 'stream';
2
3import { RecordResult } from './record-result';
4import { Connection } from './connection';
5import { SalesforceId } from './salesforce-id';
6
7export class RecordReference<T = any> {
8 constructor(conn: Connection, type: string, id: SalesforceId);
9
10 blob(fieldName: string): Stream;
11 del(options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise<RecordResult>;
12 delete(options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise<RecordResult>;
13 destroy(options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise<RecordResult>;
14 retrieve(options?: Object, callback?: (err: Error, record: Record<T>) => void): Promise<Record<T>>;
15 update(record: Partial<T>, options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise<RecordResult>;
16}
17
18export interface RecordAttributes {
19 type: string;
20 url: string;
21}
22
23export type Record<T = any> = {
24 Id?: SalesforceId | undefined;
25 attributes?: RecordAttributes | undefined
26} & T;