@rokkit/helpers 1.0.0-next.108 → 1.0.0-next.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/spec/mocks/resize-observer.spec.js +1 -1
- package/dist/src/components/index.d.ts +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/matchers/action.d.ts +0 -27
- package/dist/src/matchers/array.d.ts +0 -10
- package/dist/src/matchers/dataset.d.ts +0 -10
- package/dist/src/matchers/event.d.ts +0 -10
- package/dist/src/matchers/index.d.ts +0 -4
- package/dist/src/matchers/internal.d.ts +0 -1
- package/dist/src/mocks/animate.d.ts +0 -1
- package/dist/src/mocks/element.d.ts +0 -56
- package/dist/src/mocks/index.d.ts +0 -2
- package/dist/src/mocks/match-media.d.ts +0 -30
- package/dist/src/mocks/resize-observer.d.ts +0 -9
- package/dist/src/simulators/touch.d.ts +0 -16
- package/dist/vitest.config.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./simulators/touch";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if all the given events are registered by the action and cleaned up on destroy.
|
|
3
|
-
*
|
|
4
|
-
* @param {*} action
|
|
5
|
-
* @param {Object<string,any>} options
|
|
6
|
-
* @param {string|Array<string>} events
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export function toUseHandlersFor(action: any, options: {
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
}, events: string | Array<string>): {
|
|
12
|
-
message: () => string;
|
|
13
|
-
pass: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Verifies that only the specified events are triggered. Expects an object of spies with key as event names.
|
|
17
|
-
*
|
|
18
|
-
* @param {Object<string,any>} handler : Object with keys as event names and values as spies
|
|
19
|
-
* @param {string|Array<string>} events : An event name or an array of event names
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
export function toOnlyTrigger(handler: {
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
}, events: string | Array<string>): {
|
|
25
|
-
message: () => string;
|
|
26
|
-
pass: boolean;
|
|
27
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Verify that an array contains all of the expected values
|
|
3
|
-
*
|
|
4
|
-
* @param {Array} received - the array to inspect
|
|
5
|
-
* @param {Array} expected - the values to check for
|
|
6
|
-
*/
|
|
7
|
-
export function toIncludeAll(received: any[], expected: any[]): {
|
|
8
|
-
message: () => string;
|
|
9
|
-
pass: boolean;
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if the element has valid data attributes
|
|
3
|
-
*
|
|
4
|
-
* @param {HTMLElement} received - HTML element to be checked
|
|
5
|
-
* @param {Object} expected - data to be compared
|
|
6
|
-
*/
|
|
7
|
-
export function toHaveValidData(received: HTMLElement, expected: Object): {
|
|
8
|
-
message: () => string;
|
|
9
|
-
pass: any;
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Verify that a spy event has been dispatched with data in event detail
|
|
3
|
-
*
|
|
4
|
-
* @param {Function} spy - the event handler to inspect
|
|
5
|
-
* @param {Object} data - data expected inthe event detail
|
|
6
|
-
*/
|
|
7
|
-
export function toHaveBeenDispatchedWith(spy: Function, data: Object): {
|
|
8
|
-
message: () => string;
|
|
9
|
-
pass: boolean;
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getMessage(actual: any, expected: any, pass: any, condition?: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates an array of elements with the specified size
|
|
3
|
-
*
|
|
4
|
-
* @param {number} count
|
|
5
|
-
* @param {number} size
|
|
6
|
-
* @param {string} [prop='offsetHeight']
|
|
7
|
-
* @returns {Array<Object<string, number>>}
|
|
8
|
-
*/
|
|
9
|
-
export function elementsWithSize(count: number, size: number, prop?: string): Array<{
|
|
10
|
-
[x: string]: number;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* Creates an array of elements with mixed sizes
|
|
14
|
-
*
|
|
15
|
-
* @param {Array<{count: number, size: number}>} data
|
|
16
|
-
* @param {string} prop
|
|
17
|
-
* @returns {Array<Object<string, number>>}
|
|
18
|
-
*/
|
|
19
|
-
export function mixedSizeElements(data: Array<{
|
|
20
|
-
count: number;
|
|
21
|
-
size: number;
|
|
22
|
-
}>, prop: string): Array<{
|
|
23
|
-
[x: string]: number;
|
|
24
|
-
}>;
|
|
25
|
-
/**
|
|
26
|
-
* Creates a mock node with functions to add and remove event handlers
|
|
27
|
-
*
|
|
28
|
-
* @param {Array<string} events
|
|
29
|
-
* @returns {{node: HTMLElement, listeners: Object<string, integer>}}
|
|
30
|
-
*/
|
|
31
|
-
export function getMockNode(events: Array<string>): {
|
|
32
|
-
node: HTMLElement;
|
|
33
|
-
listeners: {
|
|
34
|
-
[x: string]: integer;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* @typedef {Object} NestedItem
|
|
39
|
-
* @property {string} name
|
|
40
|
-
* @property {string} [dataPath]
|
|
41
|
-
* @property {string} [id]
|
|
42
|
-
* @property {Array<NestedItem>} [children]
|
|
43
|
-
*/
|
|
44
|
-
/**
|
|
45
|
-
* Creates a nested HTML element structure using the provided data
|
|
46
|
-
*
|
|
47
|
-
* @param {NestedItem} item
|
|
48
|
-
* @returns {HTMLElement}
|
|
49
|
-
*/
|
|
50
|
-
export function createNestedElement(item: NestedItem): HTMLElement;
|
|
51
|
-
export type NestedItem = {
|
|
52
|
-
name: string;
|
|
53
|
-
dataPath?: string | undefined;
|
|
54
|
-
id?: string | undefined;
|
|
55
|
-
children?: NestedItem[] | undefined;
|
|
56
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Updates the media query matches
|
|
3
|
-
* @returns {void}
|
|
4
|
-
*/
|
|
5
|
-
export function updateMedia(): void;
|
|
6
|
-
/**
|
|
7
|
-
* Mocks the window.matchMedia function
|
|
8
|
-
* @param {string} query
|
|
9
|
-
* @returns {Object}
|
|
10
|
-
*/
|
|
11
|
-
export const matchMediaMock: import("vitest").Mock<(...args: any[]) => any>;
|
|
12
|
-
export type MediaQuery = {
|
|
13
|
-
"min-width"?: integer;
|
|
14
|
-
"max-width"?: integer;
|
|
15
|
-
"min-height"?: integer;
|
|
16
|
-
"max-height"?: integer;
|
|
17
|
-
width?: integer;
|
|
18
|
-
height?: integer;
|
|
19
|
-
orientation?: integer;
|
|
20
|
-
"aspect-ratio"?: integer;
|
|
21
|
-
"min-aspect-ratio"?: integer;
|
|
22
|
-
"max-aspect-ratio"?: integer;
|
|
23
|
-
resolution?: integer;
|
|
24
|
-
"min-resolution"?: integer;
|
|
25
|
-
"max-resolution"?: integer;
|
|
26
|
-
scan?: integer;
|
|
27
|
-
grid?: integer;
|
|
28
|
-
update?: integer;
|
|
29
|
-
"overflow-block"?: integer;
|
|
30
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export function simulateMouseEvent(x: any, y: any): {
|
|
2
|
-
clientX: any;
|
|
3
|
-
clientY: any;
|
|
4
|
-
stopPropagation: import("vitest").Mock<(...args: any[]) => any>;
|
|
5
|
-
preventDefault: import("vitest").Mock<(...args: any[]) => any>;
|
|
6
|
-
};
|
|
7
|
-
export function simulateTouchEvent(clientX: any, clientY: any): {
|
|
8
|
-
touches: {
|
|
9
|
-
clientX: any;
|
|
10
|
-
clientY: any;
|
|
11
|
-
}[];
|
|
12
|
-
preventDefault: import("vitest").Mock<(...args: any[]) => any>;
|
|
13
|
-
stopPropagation: import("vitest").Mock<(...args: any[]) => any>;
|
|
14
|
-
};
|
|
15
|
-
export function simulateTouchSwipe(node: any, distance: any, delay?: number): void;
|
|
16
|
-
export function simulateMouseSwipe(node: any, distance: any, delay?: number): void;
|
package/dist/vitest.config.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default defineConfig;
|