import { BrowserTypes } from '@finos/fdc3'; import { FullyQualifiedAppIdentifier, RequestMessage } from '../contracts.js'; type PartialRequestMessage = { type: T['type']; payload: T['payload']; meta: Required; }; /** * Attempts to construct a request message of the given type. * Currently all types that extend AppRequestMessage can be constructed by this function * If this changes in the future and some types require extra props this function will have a return type of unknown and will need to be modified */ export declare function createRequestMessage(type: T['type'], source: FullyQualifiedAppIdentifier, payload: T['payload']): PartialRequestMessage extends T ? T : unknown; type PartialResponseMessage = { type: T['type']; payload: T['payload']; meta: Required; }; export declare function createResponseMessage(type: T['type'], payload: T['payload'], requestUuid: string, source: FullyQualifiedAppIdentifier): PartialResponseMessage extends T ? T : unknown; type PartialEvent = { type: T['type']; payload: T['payload']; meta: Required; }; export declare function createEvent(type: T['type'], payload: T['payload']): PartialEvent extends T ? T : unknown; export declare function generateHelloMessage(identityUrl?: string): BrowserTypes.WebConnectionProtocol1Hello; export declare function generateHandshakeResponseMessage(message: BrowserTypes.WebConnectionProtocol1Hello): BrowserTypes.WebConnectionProtocol3Handshake; export declare function generateValidateIdentityMessage(connectionAttemptUuid: string, identityUrl?: string, instanceId?: string, instanceUuid?: string): BrowserTypes.WebConnectionProtocol4ValidateAppIdentity; export declare function generateGoodbyeMessage(): BrowserTypes.WebConnectionProtocol6Goodbye; /** * Listens to hello messages on the provided window and calls the provided callback with the connectionAttemptUuid * If the connection fails and is re-attempted a second connection attempt will be passed to the callback * call the returned unsubscribe function to stop listening */ export declare function subscribeToConnectionAttemptUuids( /** * The window to listen for hello messages on */ windowRef: WindowProxy, /** * The new window that has just been created that will be sending hello messages */ childWindow: WindowProxy, callback: (connectionAttemptUuid: string) => void): { unsubscribe: () => void; }; export {};