ts: Migrate setup.js to typescript.

Also added global type definition for `get_offset_to_window`
helper function.
This commit is contained in:
xoldyckk 2023-05-11 15:14:10 +05:30 committed by Tim Abbott
parent 1584668dde
commit a062a82f06
4 changed files with 4 additions and 1 deletions

View File

@ -181,7 +181,7 @@ EXEMPT_FILES = make_set(
"web/src/settings_user_groups_legacy.js", "web/src/settings_user_groups_legacy.js",
"web/src/settings_user_topics.js", "web/src/settings_user_topics.js",
"web/src/settings_users.js", "web/src/settings_users.js",
"web/src/setup.js", "web/src/setup.ts",
"web/src/spectators.js", "web/src/spectators.js",
"web/src/spoilers.ts", "web/src/spoilers.ts",
"web/src/starred_messages_ui.js", "web/src/starred_messages_ui.js",

1
web/src/global.d.ts vendored
View File

@ -15,6 +15,7 @@ type JQueryCaretRange = {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
interface JQuery { interface JQuery {
expectOne(): JQuery; expectOne(): JQuery;
get_offset_to_window(): DOMRect;
tab(action?: string): this; // From web/third/bootstrap tab(action?: string): this; // From web/third/bootstrap
modal(action?: string): this; // From web/third/bootstrap modal(action?: string): this; // From web/third/bootstrap

View File

@ -16,6 +16,8 @@ export const page_params: {
is_moderator: boolean; is_moderator: boolean;
is_owner: boolean; is_owner: boolean;
is_spectator: boolean; is_spectator: boolean;
needs_tutorial: boolean;
page_load_time: number;
promote_sponsoring_zulip: boolean; promote_sponsoring_zulip: boolean;
realm_add_custom_emoji_policy: number; realm_add_custom_emoji_policy: number;
realm_avatar_changes_disabled: boolean; realm_avatar_changes_disabled: boolean;