UNPKG

@nota/nativescript-webview-ext

Version:

Extended WebView for NativeScript which adds 'x-local' scheme for local-files. events between WebView and native-layer, javascript execution, injecting CSS and JS-files.

121 lines (61 loc) 4.91 kB
declare class CustomNSURLProtocol extends NSURLProtocol implements NSURLConnectionDelegate, NSURLSessionTaskDelegate { static alloc(): CustomNSURLProtocol; // inherited from NSObject static clearRegisteredLocalResource(): void; static getRegisteredLocalResourceForKey(forKey: string): string; static new(): CustomNSURLProtocol; // inherited from NSObject static registerLocalResourceForKeyFilepath(forKey: string, filepath: string): void; static resolveFilePath(url: NSURL): string; static setResourceDict(value: NSDictionary<string, string>): void; static unregisterLocalResourceForKey(forKey: string): void; static resourceDict: NSDictionary<string, string>; readonly debugDescription: string; // inherited from NSObjectProtocol readonly description: string; // inherited from NSObjectProtocol readonly hash: number; // inherited from NSObjectProtocol readonly isProxy: boolean; // inherited from NSObjectProtocol readonly superclass: typeof NSObject; // inherited from NSObjectProtocol readonly // inherited from NSObjectProtocol URLSessionDidBecomeInvalidWithError(session: NSURLSession, error: NSError): void; URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession): void; URLSessionDidReceiveChallengeCompletionHandler(session: NSURLSession, challenge: NSURLAuthenticationChallenge, completionHandler: (p1: NSURLSessionAuthChallengeDisposition, p2: NSURLCredential) => void): void; URLSessionTaskDidCompleteWithError(session: NSURLSession, task: NSURLSessionTask, error: NSError): void; URLSessionTaskDidFinishCollectingMetrics(session: NSURLSession, task: NSURLSessionTask, metrics: NSURLSessionTaskMetrics): void; URLSessionTaskDidReceiveChallengeCompletionHandler(session: NSURLSession, task: NSURLSessionTask, challenge: NSURLAuthenticationChallenge, completionHandler: (p1: NSURLSessionAuthChallengeDisposition, p2: NSURLCredential) => void): void; URLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSend(session: NSURLSession, task: NSURLSessionTask, bytesSent: number, totalBytesSent: number, totalBytesExpectedToSend: number): void; URLSessionTaskIsWaitingForConnectivity(session: NSURLSession, task: NSURLSessionTask): void; URLSessionTaskNeedNewBodyStream(session: NSURLSession, task: NSURLSessionTask, completionHandler: (p1: NSInputStream) => void): void; URLSessionTaskWillBeginDelayedRequestCompletionHandler(session: NSURLSession, task: NSURLSessionTask, request: NSURLRequest, completionHandler: (p1: NSURLSessionDelayedRequestDisposition, p2: NSURLRequest) => void): void; URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler(session: NSURLSession, task: NSURLSessionTask, response: NSHTTPURLResponse, request: NSURLRequest, completionHandler: (p1: NSURLRequest) => void): void; class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; connectionCanAuthenticateAgainstProtectionSpace(connection: NSURLConnection, protectionSpace: NSURLProtectionSpace): boolean; connectionDidCancelAuthenticationChallenge(connection: NSURLConnection, challenge: NSURLAuthenticationChallenge): void; connectionDidFailWithError(connection: NSURLConnection, error: NSError): void; connectionDidReceiveAuthenticationChallenge(connection: NSURLConnection, challenge: NSURLAuthenticationChallenge): void; connectionShouldUseCredentialStorage(connection: NSURLConnection): boolean; connectionWillSendRequestForAuthenticationChallenge(connection: NSURLConnection, challenge: NSURLAuthenticationChallenge): void; isEqual(object: any): boolean; isKindOfClass(aClass: typeof NSObject): boolean; isMemberOfClass(aClass: typeof NSObject): boolean; performSelector(aSelector: string): any; performSelectorWithObject(aSelector: string, object: any): any; performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any; resolveMimeTypeFromFilepath(filepath: string): string; respondsToSelector(aSelector: string): boolean; retainCount(): number; self(): this; } declare class CustomUrlSchemeHandler extends NSObject { static alloc(): CustomUrlSchemeHandler; // inherited from NSObject static new(): CustomUrlSchemeHandler; // inherited from NSObject checkTcpPortForListenWithPort(port: number): boolean; clearRegisteredLocalResource(): void; getRegisteredLocalResourceForKey(forKey: string): string; registerLocalResourceForKeyFilepath(forKey: string, filepath: string): void; resolveFilePath(url: NSURL): string; resolveMimeTypeFromFilepath(filepath: string): string; unregisterLocalResourceForKey(forKey: string): void; webViewStartURLSchemeTask(webView: WKWebView, urlSchemeTask: WKURLSchemeTask): void; webViewStopURLSchemeTask(webView: WKWebView, urlSchemeTask: WKURLSchemeTask): void; } declare var NotaWebViewExtVersionNumber: number; declare var NotaWebViewExtVersionString: interop.Reference<number>;