|
1 | 1 | import "@stackoverflow/stacks/dist/js/stacks.js"; |
| 2 | +import "jquery"; |
2 | 3 |
|
3 | 4 | declare global { |
4 | 5 | namespace Stacks { |
@@ -71,6 +72,100 @@ declare global { |
71 | 72 | options?: TooltipOptions |
72 | 73 | ): void; |
73 | 74 | } |
| 75 | + |
| 76 | + namespace StackExchange { |
| 77 | + const helpers: { |
| 78 | + hideToasts(): void; |
| 79 | + isInNetwork(url: string): boolean; |
| 80 | + parseUrl(url: string): string; |
| 81 | + showConfirmModal(modal: ModalType): Promise<boolean>; |
| 82 | + showModal(popup: JQuery | Element | null): void; |
| 83 | + showToast( |
| 84 | + message: string, |
| 85 | + info: { type: string; transientTimeout: number } |
| 86 | + ): void; |
| 87 | + }; |
| 88 | + |
| 89 | + interface UserInfo { |
| 90 | + fkey: string; |
| 91 | + userId: number; |
| 92 | + isModerator: boolean; |
| 93 | + isRegistered: boolean; |
| 94 | + accountId: number; |
| 95 | + canSeeDeletedPosts: boolean; |
| 96 | + gravatar: string; |
| 97 | + keyboardShortcuts: boolean; |
| 98 | + profileUrl: string; |
| 99 | + rep: number; |
| 100 | + tid: string; |
| 101 | + userType: number; |
| 102 | + } |
| 103 | + |
| 104 | + interface RealtimeInfo { |
| 105 | + active: boolean; |
| 106 | + newest: boolean; |
| 107 | + tagged: boolean; |
| 108 | + staleDisconnectIntervalInHours: number; |
| 109 | + } |
| 110 | + |
| 111 | + interface SiteInfo { |
| 112 | + childUrl: string; |
| 113 | + cookieDomain: string; |
| 114 | + description: string; |
| 115 | + enableNewTagCreationWarning: boolean; |
| 116 | + enableSocialMediaInSharePopup: boolean; |
| 117 | + id: number; |
| 118 | + insertSpaceAfterNameTabCompletion: boolean; |
| 119 | + isNoticesTabEnabled: boolean; |
| 120 | + name: string; |
| 121 | + negativeVoteScoreFloor: null; |
| 122 | + protocol: "http" | "https"; |
| 123 | + styleCodeWithHighlightjs: boolean; |
| 124 | + } |
| 125 | + |
| 126 | + interface JobPreferences { |
| 127 | + maxNumDeveloperRoles: number; |
| 128 | + maxNumIndustries: number; |
| 129 | + } |
| 130 | + |
| 131 | + interface Story { |
| 132 | + dislikedTagsMaxLength: number; |
| 133 | + likedTagsMaxLength: number; |
| 134 | + minCompleteBodyLength: number; |
| 135 | + } |
| 136 | + |
| 137 | + interface Events { |
| 138 | + postEditionSection: { title: 1; body: 2; tags: 3 }; |
| 139 | + postType: { question: 1 }; |
| 140 | + } |
| 141 | + |
| 142 | + const options: { |
| 143 | + user: UserInfo; |
| 144 | + jobPreferences: JobPreferences; |
| 145 | + locale: string; |
| 146 | + networkMetaHostname: string; |
| 147 | + realtime: RealtimeInfo; |
| 148 | + routeName: string; |
| 149 | + serverTime: number; |
| 150 | + serverTimeOffsetSec: number; |
| 151 | + events: Events; |
| 152 | + site: SiteInfo; |
| 153 | + story: Story; |
| 154 | + svgIconHash: string; |
| 155 | + svgIconPath: string; |
| 156 | + }; |
| 157 | + const comments: { |
| 158 | + uiForPost(comments: JQuery): { |
| 159 | + addShow(value1: boolean, value2: boolean): void; |
| 160 | + showComments( |
| 161 | + value1: string, |
| 162 | + value2: string | null, |
| 163 | + value3: boolean, |
| 164 | + value4: boolean |
| 165 | + ): void; |
| 166 | + }; |
| 167 | + }; |
| 168 | + } |
74 | 169 | } |
75 | 170 |
|
76 | 171 | export {}; |
0 commit comments