-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the NPM key. and moved the documentation to the Typescript de…
…finition file.
- Loading branch information
lsphillips
committed
Dec 6, 2018
1 parent
6dcc4e8
commit 9036cf3
Showing
10 changed files
with
76 additions
and
96 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,56 @@ | ||
export interface KonamiCodeOptions | ||
/** | ||
* Options that define how a Konami Code sequence is detected. | ||
*/ | ||
export interface KonamiCodeDetectionOptions | ||
{ | ||
/** | ||
* Determines whether the enter key is required to conclude a Konami Code sequence. | ||
*/ | ||
requireEnterPress? : boolean; | ||
|
||
/** | ||
* The maximum amount of time (in milliseconds) to wait between key presses before sequence progress is reset. | ||
*/ | ||
allowedTimeBetweenKeys? : number; | ||
} | ||
|
||
// -------------------------------------------------------- | ||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
|
||
/** | ||
* A synchronous function that will remove support for the Konami Code. | ||
*/ | ||
export interface KonamiCodeSupportRemover | ||
{ | ||
() : void | ||
} | ||
|
||
// -------------------------------------------------------- | ||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
|
||
export function addSupportForTheKonamiCode(options? : KonamiCodeOptions) : KonamiCodeSupportRemover; | ||
/** | ||
* Adds support for the Konami Code. | ||
* | ||
* Example usage: | ||
* | ||
* ``` js | ||
* addSupportForTheKonamiCode( | ||
* { | ||
* allowedTimeBetweenKeys : 500 | ||
* }); | ||
* ``` | ||
* | ||
* Once support is added, all elements will now fire a `konamicode` event whenever the user enters the Konami Code sequence: | ||
* | ||
* ``` js | ||
* target.addEventListener('konamicode', () => | ||
* { | ||
* console.log('The Konami Code has been entered. 30 more lives for you!'); | ||
* }); | ||
* ``` | ||
* | ||
* **Note:** The `konamicode` event bubbles and is cancelable. | ||
* | ||
* @param options Options that define how a Konami Code sequence is detected. By default, the enter key is not required to conclude the Konami Code sequence and it will wait indefinitely between key presses. | ||
* | ||
* @returns A synchronous function that can be called to remove support for the Konami Code. | ||
*/ | ||
export function addSupportForTheKonamiCode(options? : KonamiCodeDetectionOptions) : KonamiCodeSupportRemover; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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