-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use close watcher when supported in place of escape key handlers
- Loading branch information
1 parent
fd65254
commit 8158b15
Showing
5 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
packages/web-components/fast-foundation/src/close-watcher.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
interface CloseWatcher extends EventTarget { | ||
new (options?: CloseWatcherOptions): CloseWatcher; | ||
requestClose(): void; | ||
close(): void; | ||
destroy(): void; | ||
|
||
oncancel: (event: Event) => any | null; | ||
onclose: (event: Event) => any | null; | ||
} | ||
|
||
declare const CloseWatcher: CloseWatcher; | ||
|
||
interface CloseWatcherOptions { | ||
signal: AbortSignal; | ||
} | ||
|
||
declare interface Window { | ||
CloseWatcher?: CloseWatcher; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters