@testing-library/user-event
Advanced tools
Comparing version 14.0.0-beta.6 to 14.0.0-beta.7
@@ -1,2 +0,2 @@ | ||
import { UserEvent } from '../setup'; | ||
export declare function copy(this: UserEvent): Promise<DataTransfer | undefined>; | ||
import { Instance } from '../setup'; | ||
export declare function copy(this: Instance): Promise<DataTransfer | undefined>; |
@@ -1,2 +0,2 @@ | ||
import { UserEvent } from '../setup'; | ||
export declare function cut(this: UserEvent): Promise<DataTransfer | undefined>; | ||
import { Instance } from '../setup'; | ||
export declare function cut(this: Instance): Promise<DataTransfer | undefined>; |
@@ -1,2 +0,2 @@ | ||
import { UserEvent } from '../setup'; | ||
export declare function paste(this: UserEvent, clipboardData?: DataTransfer | string): Promise<void>; | ||
import { Instance } from '../setup'; | ||
export declare function paste(this: Instance, clipboardData?: DataTransfer | string): Promise<void>; |
@@ -1,4 +0,4 @@ | ||
import { UserEvent } from '../setup'; | ||
export declare function click(this: UserEvent, element: Element): Promise<void>; | ||
export declare function dblClick(this: UserEvent, element: Element): Promise<void>; | ||
export declare function tripleClick(this: UserEvent, element: Element): Promise<void>; | ||
import { Instance } from '../setup'; | ||
export declare function click(this: Instance, element: Element): Promise<void>; | ||
export declare function dblClick(this: Instance, element: Element): Promise<void>; | ||
export declare function tripleClick(this: Instance, element: Element): Promise<void>; |
@@ -1,3 +0,3 @@ | ||
import { UserEvent } from '../setup'; | ||
export declare function hover(this: UserEvent, element: Element): Promise<void>; | ||
export declare function unhover(this: UserEvent, element: Element): Promise<void>; | ||
import { Instance } from '../setup'; | ||
export declare function hover(this: Instance, element: Element): Promise<void>; | ||
export declare function unhover(this: Instance, element: Element): Promise<void>; |
@@ -1,4 +0,4 @@ | ||
import type { UserEvent } from '../setup'; | ||
export declare function tab(this: UserEvent, { shift, }?: { | ||
import type { Instance } from '../setup'; | ||
export declare function tab(this: Instance, { shift, }?: { | ||
shift?: boolean; | ||
}): Promise<void>; |
export { userEvent as default } from './setup'; | ||
export type { keyboardKey } from './keyboard'; | ||
export type { pointerKey } from './pointer'; | ||
export { PointerEventsCheckLevel } from './options'; |
@@ -1,2 +0,2 @@ | ||
import { UserEvent } from '../setup'; | ||
import { Instance } from '../setup'; | ||
import { releaseAllKeys } from './keyboardAction'; | ||
@@ -6,3 +6,3 @@ import type { keyboardState, keyboardKey } from './types'; | ||
export type { keyboardKey, keyboardState }; | ||
export declare function keyboard(this: UserEvent, text: string): Promise<void>; | ||
export declare function keyboard(this: Instance, text: string): Promise<void>; | ||
export declare function createKeyboardState(): keyboardState; |
import type { keyboardKey } from './keyboard/types'; | ||
import type { pointerKey } from './pointer/types'; | ||
export declare enum PointerEventsCheckLevel { | ||
/** | ||
* Check pointer events on every user interaction that triggers a bunch of events. | ||
* E.g. once for releasing a mouse button even though this triggers `pointerup`, `mouseup`, `click`, etc... | ||
*/ | ||
EachTrigger = 4, | ||
/** Check each target once per call to pointer (related) API */ | ||
EachApiCall = 2, | ||
/** Check each event target once */ | ||
EachTarget = 1, | ||
/** No pointer events check */ | ||
Never = 0 | ||
} | ||
export interface Options { | ||
@@ -56,2 +69,12 @@ /** | ||
/** | ||
* The pointer API includes a check if an element has or inherits `pointer-events: none`. | ||
* This check is known to be expensive and very expensive when checking deeply nested nodes. | ||
* This option determines how often the pointer related APIs perform the check. | ||
* | ||
* This is a binary flag option. You can combine multiple Levels. | ||
* | ||
* @default PointerEventsCheckLevel.EachCall | ||
*/ | ||
pointerEventsCheck?: PointerEventsCheckLevel | number; | ||
/** | ||
* `userEvent.type` automatically releases any keys still pressed at the end of the call. | ||
@@ -78,10 +101,2 @@ * This option allows to opt out of this feature. | ||
/** | ||
* Calling pointer related APIs on an element triggers a check if that element can receive pointer events. | ||
* This check is known to be expensive. | ||
* This option allows to skip the check. | ||
* | ||
* @default false | ||
*/ | ||
skipPointerEventsCheck?: boolean; | ||
/** | ||
* Write selected data to Clipboard API when a `cut` or `copy` is triggered. | ||
@@ -88,0 +103,0 @@ * |
@@ -1,2 +0,2 @@ | ||
import { UserEvent } from '../setup'; | ||
import { Instance } from '../setup'; | ||
import { PointerAction, PointerActionTarget } from './pointerAction'; | ||
@@ -9,3 +9,3 @@ import type { pointerState, pointerKey } from './types'; | ||
export declare type PointerInput = PointerActionInput | Array<PointerActionInput>; | ||
export declare function pointer(this: UserEvent, input: PointerInput): Promise<void>; | ||
export declare function pointer(this: Instance, input: PointerInput): Promise<void>; | ||
export declare function createPointerState(document: Document): pointerState; |
@@ -1,2 +0,2 @@ | ||
import { inputDeviceState } from '../setup'; | ||
import { Config } from '../setup'; | ||
import { PointerTarget, SelectionTarget } from './types'; | ||
@@ -6,2 +6,2 @@ export interface PointerMoveAction extends PointerTarget, SelectionTarget { | ||
} | ||
export declare function pointerMove({ pointerName, target, coords, node, offset }: PointerMoveAction, { pointerState, keyboardState }: inputDeviceState): Promise<void>; | ||
export declare function pointerMove(config: Config, { pointerName, target, coords, node, offset }: PointerMoveAction): Promise<void>; |
@@ -1,2 +0,2 @@ | ||
import { inputDeviceState } from '../setup'; | ||
import { Config } from '../setup'; | ||
import type { pointerKey, PointerTarget, SelectionTarget } from './types'; | ||
@@ -8,2 +8,2 @@ export interface PointerPressAction extends PointerTarget, SelectionTarget { | ||
} | ||
export declare function pointerPress(action: PointerPressAction, state: inputDeviceState): Promise<void>; | ||
export declare function pointerPress(config: Config, action: PointerPressAction): Promise<void>; |
@@ -1,2 +0,1 @@ | ||
import type { PointerOptions } from '../utils'; | ||
import type { PointerInput } from '../pointer'; | ||
@@ -18,4 +17,4 @@ import type { UserEventApi } from '.'; | ||
export declare function type(element: Element, text: string, options?: Partial<Config> & Parameters<UserEventApi['type']>[2]): Promise<void>; | ||
export declare function unhover(element: Element, options?: PointerOptions): Promise<void>; | ||
export declare function unhover(element: Element, options?: Partial<Config>): Promise<void>; | ||
export declare function upload(element: HTMLElement, fileOrFiles: File | File[], options?: Partial<Config>): Promise<void>; | ||
export declare function tab(options?: Partial<Config> & Parameters<UserEventApi['tab']>[0]): Promise<void>; |
@@ -8,6 +8,10 @@ import type * as userEventApi from './api'; | ||
export declare type UserEventApi = typeof userEventApi; | ||
export declare type UserEvent = UserEventApi & { | ||
readonly setup: typeof setupSub; | ||
export declare type Instance = UserEventApi & { | ||
[Config]: Config; | ||
}; | ||
export declare type UserEvent = { | ||
readonly setup: (...args: Parameters<typeof setupSub>) => UserEvent; | ||
} & { | ||
readonly [k in keyof UserEventApi]: (...args: Parameters<UserEventApi[k]>) => ReturnType<UserEventApi[k]>; | ||
}; | ||
export declare const userEvent: { | ||
@@ -14,0 +18,0 @@ readonly setup: typeof setupMain; |
import { Options } from '../options'; | ||
import type { UserEvent } from './index'; | ||
import type { Instance, UserEvent } from './index'; | ||
import { Config } from './config'; | ||
import * as userEventApi from './api'; | ||
/** | ||
@@ -9,22 +8,3 @@ * Start a "session" with userEvent. | ||
*/ | ||
export declare function setupMain(options?: Options): { | ||
setup: typeof setupSub; | ||
[Config]: Config; | ||
click: typeof userEventApi.click; | ||
dblClick: typeof userEventApi.dblClick; | ||
tripleClick: typeof userEventApi.tripleClick; | ||
hover: typeof userEventApi.hover; | ||
unhover: typeof userEventApi.unhover; | ||
tab: typeof userEventApi.tab; | ||
keyboard: typeof userEventApi.keyboard; | ||
copy: typeof userEventApi.copy; | ||
cut: typeof userEventApi.cut; | ||
paste: typeof userEventApi.paste; | ||
pointer: typeof userEventApi.pointer; | ||
clear: typeof userEventApi.clear; | ||
deselectOptions: typeof userEventApi.deselectOptions; | ||
selectOptions: typeof userEventApi.selectOptions; | ||
type: typeof userEventApi.type; | ||
upload: typeof userEventApi.upload; | ||
}; | ||
export declare function setupMain(options?: Options): UserEvent; | ||
/** | ||
@@ -34,20 +14,4 @@ * Setup in direct call per `userEvent.anyApi()` | ||
export declare function setupDirect(options?: Partial<Config>, node?: Node): { | ||
setup: typeof setupSub; | ||
[Config]: Config; | ||
click: typeof userEventApi.click; | ||
dblClick: typeof userEventApi.dblClick; | ||
tripleClick: typeof userEventApi.tripleClick; | ||
hover: typeof userEventApi.hover; | ||
unhover: typeof userEventApi.unhover; | ||
tab: typeof userEventApi.tab; | ||
keyboard: typeof userEventApi.keyboard; | ||
copy: typeof userEventApi.copy; | ||
cut: typeof userEventApi.cut; | ||
paste: typeof userEventApi.paste; | ||
pointer: typeof userEventApi.pointer; | ||
clear: typeof userEventApi.clear; | ||
deselectOptions: typeof userEventApi.deselectOptions; | ||
selectOptions: typeof userEventApi.selectOptions; | ||
type: typeof userEventApi.type; | ||
upload: typeof userEventApi.upload; | ||
config: Config; | ||
api: UserEvent; | ||
}; | ||
@@ -57,21 +21,2 @@ /** | ||
*/ | ||
export declare function setupSub(this: UserEvent, options: Options): { | ||
setup: typeof setupSub; | ||
[Config]: Config; | ||
click: typeof userEventApi.click; | ||
dblClick: typeof userEventApi.dblClick; | ||
tripleClick: typeof userEventApi.tripleClick; | ||
hover: typeof userEventApi.hover; | ||
unhover: typeof userEventApi.unhover; | ||
tab: typeof userEventApi.tab; | ||
keyboard: typeof userEventApi.keyboard; | ||
copy: typeof userEventApi.copy; | ||
cut: typeof userEventApi.cut; | ||
paste: typeof userEventApi.paste; | ||
pointer: typeof userEventApi.pointer; | ||
clear: typeof userEventApi.clear; | ||
deselectOptions: typeof userEventApi.deselectOptions; | ||
selectOptions: typeof userEventApi.selectOptions; | ||
type: typeof userEventApi.type; | ||
upload: typeof userEventApi.upload; | ||
}; | ||
export declare function setupSub(this: Instance, options: Options): UserEvent; |
@@ -1,2 +0,2 @@ | ||
import type { UserEvent } from '../setup'; | ||
export declare function clear(this: UserEvent, element: Element): Promise<void>; | ||
import type { Instance } from '../setup'; | ||
export declare function clear(this: Instance, element: Element): Promise<void>; |
@@ -1,3 +0,3 @@ | ||
import { UserEvent } from '../setup'; | ||
export declare function selectOptions(this: UserEvent, select: Element, values: HTMLElement | HTMLElement[] | string[] | string): Promise<void>; | ||
export declare function deselectOptions(this: UserEvent, select: Element, values: HTMLElement | HTMLElement[] | string[] | string): Promise<void>; | ||
import { Instance } from '../setup'; | ||
export declare function selectOptions(this: Instance, select: Element, values: HTMLElement | HTMLElement[] | string[] | string): Promise<void>; | ||
export declare function deselectOptions(this: Instance, select: Element, values: HTMLElement | HTMLElement[] | string[] | string): Promise<void>; |
@@ -1,2 +0,2 @@ | ||
import type { UserEvent } from '../setup'; | ||
import type { Instance } from '../setup'; | ||
import { Config } from '../setup/config'; | ||
@@ -9,2 +9,2 @@ export interface typeOptions { | ||
} | ||
export declare function type(this: UserEvent, element: Element, text: string, { skipClick, skipAutoClose, initialSelectionStart, initialSelectionEnd, }?: typeOptions): Promise<void>; | ||
export declare function type(this: Instance, element: Element, text: string, { skipClick, skipAutoClose, initialSelectionStart, initialSelectionEnd, }?: typeOptions): Promise<void>; |
@@ -1,5 +0,5 @@ | ||
import { UserEvent } from '../setup'; | ||
import { Instance } from '../setup'; | ||
export interface uploadInit { | ||
changeInit?: EventInit; | ||
} | ||
export declare function upload(this: UserEvent, element: HTMLElement, fileOrFiles: File | File[]): Promise<void>; | ||
export declare function upload(this: Instance, element: HTMLElement, fileOrFiles: File | File[]): Promise<void>; |
@@ -37,6 +37,7 @@ export * from './click/isClickableInput'; | ||
export * from './misc/isDisabled'; | ||
export * from './misc/level'; | ||
export * from './misc/wait'; | ||
export * from './misc/hasPointerEvents'; | ||
export * from './misc/hasFormSubmit'; | ||
export * from './pointer/cssPointerEvents'; | ||
export * from './pointer/firePointerEvents'; | ||
export * from './pointer/mouseButtons'; |
{ | ||
"name": "@testing-library/user-event", | ||
"version": "14.0.0-beta.6", | ||
"version": "14.0.0-beta.7", | ||
"description": "Fire events the same way the user does", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
280569
96
6718