Skip to content

Commit

Permalink
added some of the 'question' property declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed Aug 11, 2021
1 parent 8cdb630 commit da9e349
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.d.ts
Expand Up @@ -182,6 +182,7 @@ declare global {
svgIconHash: string;
svgIconPath: string;
};

const comments: {
uiForPost(comments: JQuery): {
addShow(value1: boolean, value2: boolean): void;
Expand All @@ -193,6 +194,12 @@ declare global {
): void;
};
};

const question: {
getQuestionId(): number;
canViewVoteCounts(): boolean;
scrollToPost(postId: number): boolean;
};
}
}

Expand Down
12 changes: 12 additions & 0 deletions stackexchange.ts
Expand Up @@ -17,3 +17,15 @@ StackExchange.helpers.isInNetwork("stackoverflow.com");

// $ExpectError
StackExchange.helpers.isInNetwork();

// $ExpectType number
StackExchange.question.getQuestionId();

// $ExpectType boolean
StackExchange.question.canViewVoteCounts();

// $ExpectError
StackExchange.question.scrollToPost();

// $ExpectType boolean
StackExchange.question.scrollToPost(123456);

0 comments on commit da9e349

Please sign in to comment.