UNPKG

nativescript-matrix-sdk

Version:

Native Matrix SDK integration for NativeScript

119 lines (100 loc) 3.29 kB
/** * TypeScript declarations for iOS Matrix SDK * These declarations help TypeScript understand the Objective-C types * that are available at runtime in NativeScript */ declare class NSObject {} declare class NSString {} declare class NSMutableDictionary { static alloc(): NSMutableDictionary; init(): NSMutableDictionary; setObjectForKey(object: any, key: string): void; objectForKey(key: string): any; } declare class NSNotificationCenter { static defaultCenter: NSNotificationCenter; addObserverForNameObjectQueueUsingBlock(name: string, object: any, queue: any, block: (notification: any) => void): any; removeObserver(observer: any): void; } declare class NSOperationQueue { static mainQueue: NSOperationQueue; } declare class MXCredentials extends NSObject { homeServer: string; accessToken: string; userId: string; alloc(): MXCredentials; init(): MXCredentials; } declare class MXRestClient extends NSObject { alloc(): MXRestClient; initWithCredentials(credentials: MXCredentials): MXRestClient; userProfileWithUserId(userId: string | null): Promise<{ userId: string }>; rooms(): Promise<any>; joinRoom(roomId: string): Promise<void>; leaveRoom(roomId: string): Promise<void>; } declare class MXRoom extends NSObject { roomId: string; summary: { displayname: string; membersCount: number; lastMessage: { text: string; originServerTs: number; } | null; notificationCount: number; }; liveTimeline(): Promise<any>; memberWithUserId(userId: string): Promise<{ displayname?: string; avatarUrl?: string; }>; sendTextMessage(text: string): Promise<{ eventId: string }>; sendEventOfType(eventType: string, content: any): Promise<void>; } declare function NSClassFromString(className: string): any; declare class NSFileManager { static defaultManager: NSFileManager; fileExistsAtPath(path: string): boolean; attributesOfItemAtPathError(path: string): any; createDirectoryAtPathWithIntermediateDirectoriesAttributesError( path: string, createIntermediate: boolean, attributes: any, error: any ): boolean; } declare const NSFileSize: string; declare class NSData { static dataWithContentsOfFile(path: string): NSData; length: number; } declare class UIImage { static imageWithData(data: NSData): UIImage; size: CGSize; drawInRect(rect: CGRect): void; } declare function UIImageJPEGRepresentation(image: UIImage, compressionQuality: number): NSData; declare function CGSizeMake(width: number, height: number): CGSize; declare function CGRectMake(x: number, y: number, width: number, height: number): CGRect; declare function UIGraphicsBeginImageContextWithOptions(size: CGSize, opaque: boolean, scale: number): void; declare function UIGraphicsGetImageFromCurrentImageContext(): UIImage; declare function UIGraphicsEndImageContext(): void; declare class CGSize { width: number; height: number; } declare class CGRect { x: number; y: number; width: number; height: number; } declare class MXMediaLoaderProgress { constructor(options: { onProgress: (progress: number, totalBytes: number) => void }); } declare class MXMediaManager { static sharedManager(): MXMediaManager; cancelDownloadsInCacheForId(eventId: string): void; }