mirror of
https://github.com/Boof2015/astra-mobile.git
synced 2026-08-12 05:10:52 +02:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { requireOptionalNativeModule, type NativeModule } from 'expo-modules-core';
|
|
|
|
export interface AstraDesktopDiscoveryItem {
|
|
endpointUuid: string | null;
|
|
desktopName: string | null;
|
|
protocolVersion: number;
|
|
certificateFingerprint: string;
|
|
transport: 'https';
|
|
name: string;
|
|
baseUrl: string;
|
|
address: string;
|
|
port: number;
|
|
lastSeenAt: number;
|
|
}
|
|
|
|
type AstraDesktopDiscoveryEvents = {
|
|
onDesktopRemoteFound: (desktop: AstraDesktopDiscoveryItem) => void;
|
|
onDesktopRemoteLost: (event: { name: string }) => void;
|
|
};
|
|
|
|
declare class AstraDesktopDiscoveryModuleType extends NativeModule<AstraDesktopDiscoveryEvents> {
|
|
start(): Promise<void>;
|
|
stop(): Promise<void>;
|
|
getCached(): AstraDesktopDiscoveryItem[];
|
|
}
|
|
|
|
const native = requireOptionalNativeModule<AstraDesktopDiscoveryModuleType>('AstraDesktopDiscovery');
|
|
|
|
export const AstraDesktopDiscovery = native ?? {
|
|
addListener: () => ({ remove: () => {} }),
|
|
removeAllListeners: () => {},
|
|
start: async () => {},
|
|
stop: async () => {},
|
|
getCached: () => [],
|
|
};
|