advanced-post-message
Version:
Inspired from post robot, this module is designed to provide a simple interface for cross domain communication.
50 lines • 2.28 kB
TypeScript
export declare const ERROR_MESSAGES: {
readonly common: {
readonly windowClosed: "The window closed before the response was received";
readonly windowNotFound: "The window was not found.";
readonly channelIdRequired: "The channelId is required";
};
readonly sendEvent: {
readonly receiverReturnedError: "The receiver returned an error";
readonly eventCancelled: "The event was cancelled";
readonly noAckReceived: "The ACK was not received";
};
readonly receiveEvent: {
readonly noRequestListenerFound: (type: string) => `No request listener found for event "${string}"`;
readonly codeReturnedError: "The code returned an error";
readonly noResponseListenerFound: (hash: string) => `No response listener found for hash "${string}"`;
readonly noAckListenerFound: (hash: string) => `No ack listener found for hash "${string}"`;
readonly unknownNature: (nature: string) => `The nature "${string}" is unknown`;
};
readonly registerEvent: {
readonly eventAlreadyRegistered: (type: string) => `The event "${string}" is already registered`;
};
readonly unregisterEvent: {
readonly eventDoesNotExist: (type: string) => `The event "${string}" does not exist`;
};
};
export declare const ERROR_CODES: {
readonly common: {
readonly windowClosed: "WINDOW_CLOSED";
readonly windowNotFound: "WINDOW_NOT_FOUND";
};
readonly sendEvent: {
readonly receiverReturnedError: "RECEIVER_RETURNED_ERROR";
readonly eventCancelled: "EVENT_CANCELLED";
readonly noAckReceived: "NO_ACK_RECEIVED";
};
readonly receiveEvent: {
readonly noRequestListenerFound: "NO_REQUEST_LISTENER_FOUND";
readonly codeReturnedError: "CODE_RETURNED_ERROR";
readonly noResponseListenerFound: "NO_RESPONSE_LISTENER_FOUND";
readonly noAckListenerFound: "NO_ACK_LISTENER_FOUND";
readonly unknownNature: "UNKNOWN_NATURE";
};
readonly registerEvent: {
readonly eventAlreadyRegistered: "EVENT_ALREADY_REGISTERED";
};
readonly unregisterEvent: {
readonly eventDoesNotExist: "EVENT_DOES_NOT_EXIST";
};
};
//# sourceMappingURL=errorMessages.constants.d.ts.map