-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): generate declaration files instead of importing from src (#…
…24)
- Loading branch information
Showing
23 changed files
with
132 additions
and
35 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,3 +1,3 @@ | ||
console.log("Log here"); | ||
console.warn("Warn here"); | ||
console.error("Error here"); | ||
console.log('Log here') | ||
console.warn('Warn here') | ||
console.error('Error here') |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {TestInstance} from '../types' | ||
declare const eventMap: { | ||
sigterm: (instance: TestInstance) => Promise<void> | ||
sigkill: (instance: TestInstance) => Promise<void> | ||
write: ( | ||
instance: TestInstance, | ||
props: { | ||
value: string | ||
}, | ||
) => boolean | ||
} | ||
export {eventMap} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {keyboard} from './keyboard/index' | ||
declare const userEvent: { | ||
keyboard: typeof keyboard | ||
} | ||
export default userEvent | ||
export type {keyboardKey} from './keyboard/index' |
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,15 @@ | ||
import {keyboardKey, keyboardOptions} from './types' | ||
/** | ||
* Get the next key from keyMap | ||
* | ||
* Keys can be referenced by `{key}` or `{special}` as well as physical locations per `[code]`. | ||
* Everything else will be interpreted as a typed character - e.g. `a`. | ||
* Brackets `{` and `[` can be escaped by doubling - e.g. `foo[[bar` translates to `foo[bar`. | ||
*/ | ||
export declare function getNextKeyDef( | ||
text: string, | ||
options: keyboardOptions, | ||
): { | ||
keyDef: keyboardKey | ||
consumedLength: number | ||
} |
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 @@ | ||
import {TestInstance} from '../../../types' | ||
import {keyboardOptions, keyboardKey} from './types' | ||
export type {keyboardOptions, keyboardKey} | ||
export declare function keyboard( | ||
instance: TestInstance, | ||
text: string, | ||
options?: Partial< | ||
keyboardOptions & { | ||
delay: number | ||
} | ||
>, | ||
): void | Promise<void> | ||
export declare function keyboardImplementationWrapper( | ||
instance: TestInstance, | ||
text: string, | ||
config?: Partial<keyboardOptions>, | ||
): { | ||
promise: Promise<void> | ||
} |
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,10 @@ | ||
import {keyboardKey} from './types' | ||
/** | ||
* Mapping for a default US-104-QWERTY keyboard | ||
* | ||
* These use ANSI-C quoting, which seems to work for Linux, macOS, and Windows alike | ||
* @see https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#ANSI_002dC-Quoting | ||
* @see https://stackoverflow.com/questions/35429671/detecting-key-press-within-bash-scripts | ||
* @see https://gist.github.com/crutchcorn/2811db78a7b924cf54f4507198427fd2 | ||
*/ | ||
export declare const defaultKeyMap: keyboardKey[] |
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,7 @@ | ||
import {TestInstance} from '../../../types' | ||
import {keyboardOptions} from './types' | ||
export declare function keyboardImplementation( | ||
instance: TestInstance, | ||
text: string, | ||
options: keyboardOptions, | ||
): Promise<void> |
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,12 @@ | ||
export type keyboardOptions = { | ||
/** Delay between keystrokes */ | ||
delay: number | ||
/** Keyboard layout to use */ | ||
keyboardMap: keyboardKey[] | ||
} | ||
export interface keyboardKey { | ||
/** Physical location on a keyboard */ | ||
code?: string | ||
/** Character or functional key hex code */ | ||
hex?: string | ||
} |
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 @@ | ||
export declare function wait(time?: number): Promise<void> |