mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-13 00:56:22 +00:00
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import type NativeRobosats from './index';
|
|
|
|
declare global {
|
|
interface Window {
|
|
ReactNativeWebView?: ReactNativeWebView;
|
|
NativeRobosats?: NativeRobosats;
|
|
RobosatsSettings: 'web-basic' | 'web-pro' | 'selfhosted-basic' | 'selfhosted-pro';
|
|
DesktopRobosats: undefined | 'Desktop-App';
|
|
}
|
|
}
|
|
|
|
export interface ReactNativeWebView {
|
|
postMessage: (message: string) => Promise<Record<string, any>>;
|
|
}
|
|
|
|
export interface NativeWebViewMessageHttp {
|
|
id?: number;
|
|
category: 'http';
|
|
type: 'post' | 'get' | 'put' | 'delete';
|
|
path: string;
|
|
baseUrl: string;
|
|
headers?: object;
|
|
body?: object;
|
|
}
|
|
|
|
export interface NativeWebViewMessageSystem {
|
|
id?: number;
|
|
category: 'system';
|
|
type: 'init' | 'torStatus' | 'copyToClipboardString' | 'setCookie' | 'deleteCookie';
|
|
key?: string;
|
|
detail?: string;
|
|
}
|
|
|
|
export interface NativeWebViewMessageRoboidentities {
|
|
id?: number;
|
|
category: 'roboidentities';
|
|
type: 'roboname' | 'robohash';
|
|
string?: string;
|
|
size?: string;
|
|
}
|
|
|
|
export declare type NativeWebViewMessage =
|
|
| NativeWebViewMessageHttp
|
|
| NativeWebViewMessageSystem
|
|
| NativeWebViewMessageRoboidentities
|
|
| NA;
|
|
|
|
export interface NativeRobosatsPromise {
|
|
resolve: (value: object | PromiseLike<object>) => void;
|
|
reject: (reason?: any) => void;
|
|
}
|