You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import {
|
|
Quote,
|
|
AttachmentPointer,
|
|
Preview,
|
|
} from '../../ts/session/messages/outgoing';
|
|
|
|
interface UploadResponse {
|
|
url: string;
|
|
id?: number;
|
|
}
|
|
|
|
interface DownloadResponse {
|
|
statucCode: number;
|
|
reponse: any;
|
|
}
|
|
|
|
export interface LokiAppDotNetServerInterface {
|
|
findOrCreateChannel(
|
|
api: LokiPublicChatFactoryAPI,
|
|
channelId: number,
|
|
conversationId: string
|
|
): Promise<LokiPublicChannelAPI>;
|
|
uploadData(data: FormData): Promise<UploadResponse>;
|
|
uploadAvatar(data: FormData): Promise<UploadResponse>;
|
|
putAttachment(data: ArrayBuffer): Promise<UploadResponse>;
|
|
putAvatar(data: ArrayBuffer): Promise<UploadResponse>;
|
|
downloadAttachment(url: String): Promise<DownloadResponse>; // todo: add return type
|
|
}
|
|
|
|
export interface LokiPublicChannelAPI {
|
|
sendMessage(
|
|
data: {
|
|
quote?: Quote;
|
|
attachments: Array<AttachmentPointer>;
|
|
preview: Array<Preview>;
|
|
body?: string;
|
|
},
|
|
timestamp: number
|
|
): Promise<{ serverId; serverTimestamp }>;
|
|
}
|
|
|
|
declare class LokiAppDotNetServerAPI implements LokiAppDotNetServerInterface {
|
|
public baseServerUrl: string;
|
|
constructor(ourKey: string, url: string);
|
|
}
|
|
|
|
export default LokiAppDotNetServerAPI;
|