Skip to content

Commit da9e349

Browse files
committed
added some of the 'question' property declarations
1 parent 8cdb630 commit da9e349

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ declare global {
182182
svgIconHash: string;
183183
svgIconPath: string;
184184
};
185+
185186
const comments: {
186187
uiForPost(comments: JQuery): {
187188
addShow(value1: boolean, value2: boolean): void;
@@ -193,6 +194,12 @@ declare global {
193194
): void;
194195
};
195196
};
197+
198+
const question: {
199+
getQuestionId(): number;
200+
canViewVoteCounts(): boolean;
201+
scrollToPost(postId: number): boolean;
202+
};
196203
}
197204
}
198205

stackexchange.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ StackExchange.helpers.isInNetwork("stackoverflow.com");
1717

1818
// $ExpectError
1919
StackExchange.helpers.isInNetwork();
20+
21+
// $ExpectType number
22+
StackExchange.question.getQuestionId();
23+
24+
// $ExpectType boolean
25+
StackExchange.question.canViewVoteCounts();
26+
27+
// $ExpectError
28+
StackExchange.question.scrollToPost();
29+
30+
// $ExpectType boolean
31+
StackExchange.question.scrollToPost(123456);

0 commit comments

Comments
 (0)