Changeset View
Changeset View
Standalone View
Standalone View
lib/types/rust-binding-types.js
// @flow | // @flow | ||||
import type { SignedIdentityKeysBlob } from './crypto-types.js'; | |||||
type tunnelbrokerOnReceiveCallback = ( | type tunnelbrokerOnReceiveCallback = ( | ||||
err: Error | null, | err: Error | null, | ||||
payload: string, | payload: string, | ||||
) => mixed; | ) => mixed; | ||||
declare class TunnelbrokerClientClass { | declare class TunnelbrokerClientClass { | ||||
constructor( | constructor( | ||||
deviceId: string, | deviceId: string, | ||||
onReceiveCallback: tunnelbrokerOnReceiveCallback, | onReceiveCallback: tunnelbrokerOnReceiveCallback, | ||||
): TunnelbrokerClientClass; | ): TunnelbrokerClientClass; | ||||
publish(toDeviceId: string, payload: string): Promise<void>; | publish(toDeviceId: string, payload: string): Promise<void>; | ||||
} | } | ||||
type RustNativeBindingAPI = { | type RustNativeBindingAPI = { | ||||
+registerUser: ( | +registerUser: ( | ||||
userId: string, | userId: string, | ||||
deviceId: string, | deviceId: string, | ||||
username: string, | username: string, | ||||
password: string, | password: string, | ||||
userPublicKey: string, | userPublicKey: string, | ||||
) => Promise<string>, | ) => Promise<string>, | ||||
+loginUserPake: ( | |||||
userId: string, | |||||
signingPublicKey: string, | |||||
password: string, | |||||
sessionInitializationInfo: SignedIdentityKeysBlob, | |||||
) => Promise<string>, | |||||
+deleteUser: (userId: string) => Promise<boolean>, | +deleteUser: (userId: string) => Promise<boolean>, | ||||
+TunnelbrokerClient: Class<TunnelbrokerClientClass>, | +TunnelbrokerClient: Class<TunnelbrokerClientClass>, | ||||
}; | }; | ||||
export type { RustNativeBindingAPI }; | export type { RustNativeBindingAPI }; |