The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/utils/client/lib/RestApiClient.d.ts

36 lines
1.5 KiB

import { Serialized } from '../../../../definition/Serialized';
export declare const APIClient: {
delete<P, R = any>(endpoint: string, params?: Serialized<P>): Promise<Serialized<R>>;
get<P, R = any>(endpoint: string, params?: void extends P ? void : Serialized<P>): Promise<Serialized<R>>;
post<P, B, R = any>(endpoint: string, params?: Serialized<P>, body?: B): Promise<Serialized<R>>;
upload<P, B, R = any>(
endpoint: string,
params?: Serialized<P>,
formData?: B,
xhrOptions?: {
progress: (amount: number) => void;
error: (ev: ProgressEvent<XMLHttpRequestEventTarget>) => void;
},
): { promise: Promise<Serialized<R>> };
getCredentials(): {
'X-User-Id': string;
'X-Auth-Token': string;
};
_jqueryCall(method?: string, endpoint?: string, params?: any, body?: any, headers?: Record<string, string>, dataType?: string): any;
v1: {
delete<P, R = any>(endpoint: string, params?: Serialized<P>): Promise<Serialized<R>>;
get<P, R = any>(endpoint: string, params?: Serialized<P>): Promise<Serialized<R>>;
post<P, B, R = any>(endpoint: string, params?: Serialized<P>, body?: B): Promise<Serialized<R>>;
put<P, B, R = any>(endpoint: string, params?: Serialized<P>, body?: B): Promise<Serialized<R>>;
upload<P, B, R = any>(
endpoint: string,
params?: Serialized<P>,
formData?: B,
xhrOptions?: {
progress: (amount: number) => void;
error: (ev: ProgressEvent<XMLHttpRequestEventTarget>) => void;
},
): { promise: Promise<Serialized<R>> };
};
};