typescript: Migrate messages.js to typescript.

This commit is contained in:
vsvipul
2019-06-23 18:45:17 +05:30
committed by Akash Nimare
parent 6e07945d7c
commit 448822a5fb

View File

@@ -1,5 +1,5 @@
class Messages {
invalidZulipServerError(domain) {
invalidZulipServerError(domain: string): string {
return `${domain} does not appear to be a valid Zulip server. Make sure that
\n You can connect to that URL in a web browser.\
\n If you need a proxy to connect to the Internet, that you've configured your proxy in the Network settings.\
@@ -7,16 +7,16 @@ class Messages {
\n The server has a valid certificate. (You can add custom certificates in Settings > Organizations).`;
}
noOrgsError(domain) {
noOrgsError(domain: string): string {
return `${domain} does not have any organizations added.\
\nPlease contact your server administrator.`;
}
certErrorMessage(domain, error) {
certErrorMessage(domain: string, error: string): string {
return `Do you trust certificate from ${domain}? \n ${error}`;
}
certErrorDetail() {
certErrorDetail(): string {
return `The organization you're connecting to is either someone impersonating the Zulip server you entered, or the server you're trying to connect to is configured in an insecure way.
\nIf you have a valid certificate please add it from Settings>Organizations and try to add the organization again.
\nUnless you have a good reason to believe otherwise, you should not proceed.
@@ -24,4 +24,4 @@ class Messages {
}
}
module.exports = new Messages();
export = new Messages();