stream_edit: Convert module to typescript.

This commit is contained in:
evykassirer
2024-10-16 17:46:07 -07:00
committed by Tim Abbott
parent 16e3894bfa
commit 01b1a51a86
6 changed files with 248 additions and 174 deletions

View File

@@ -5,16 +5,15 @@ import * as settings_ui from "./settings_ui";
import type {StreamProperties, StreamSubscription} from "./sub_store";
import * as sub_store from "./sub_store";
export function bulk_set_stream_property(
sub_data: {
[Property in keyof StreamProperties]: {
stream_id: number;
property: Property;
value: StreamProperties[Property];
};
}[keyof StreamProperties][],
$status_element?: JQuery,
): void {
export type SubData = {
[Property in keyof StreamProperties]: {
stream_id: number;
property: Property;
value: StreamProperties[Property];
};
}[keyof StreamProperties][];
export function bulk_set_stream_property(sub_data: SubData, $status_element?: JQuery): void {
const url = "/json/users/me/subscriptions/properties";
const data = {subscription_data: JSON.stringify(sub_data)};
if (!$status_element) {