Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

shared: Add flow types for internal_url.

Austin Ribadf1d395d4eb0
diff --git a/static/shared/js/internal_url.js.flow b/static/shared/js/internal_url.js.flow
new file mode 100644
index 00000000000..9d221e9a866
--- /dev/null
+++ b/static/shared/js/internal_url.js.flow
@@ -0,0 +1,30 @@
+/**
+ * @flow strict
+ */
+
+"use strict";
+
+declare export function encodeHashComponent(str: string): string;
+
+declare export function decodeHashComponent(str: string): string;
+
+declare export function stream_id_to_slug(
+ stream_id: number,
+ maybe_get_stream_name: (id: number) => ?string,
+): string;
+
+declare export function encode_stream_id(
+ stream_id: number,
+ maybe_get_stream_name: (id: number) => ?string,
+): string;
+
+declare export function by_stream_url(
+ stream_id: number,
+ maybe_get_stream_name: (id: number) => ?string,
+): string;
+
+declare export function by_stream_topic_url(
+ stream_id: number,
+ topic: string,
+ maybe_get_stream_name: (id: number) => ?string,
+): string;