Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing of Stack for TypeScript 3.9.2 #398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/core/Stack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default class Stack extends StackProperties {
* An "array" of notices. It's actually built on the fly from the double
* linked list the notices are actually stored in.
*/
readonly notices: Notice[];
readonly notices: (typeof Notice)[];
/**
* How many notices there are in the stack.
*/
Expand All @@ -127,7 +127,7 @@ export default class Stack extends StackProperties {
* When a stack is modalish, this is the notice that is open in the non-modal
* state.
*/
readonly leader: Notice | null;
readonly leader: typeof Notice | null;

constructor(options: StackOptions);

Expand All @@ -139,14 +139,14 @@ export default class Stack extends StackProperties {
* @param options Controls which direction to iterate notices.
*/
forEach(
callback: (notice?: Notice) => void,
callback: (notice?: typeof Notice) => void,
options?: {
/**
* Where to start the iteration.
*
* @default 'oldest'
*/
start: Notice | 'head' | 'tail' | 'oldest' | 'newest';
start: typeof Notice | 'head' | 'tail' | 'oldest' | 'newest';
/**
* Which direction in the double linked list to iterate.
*
Expand Down