jest-canvas-mock 2.2.0 → 2.4.0

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/types/index.d.ts CHANGED
@@ -1,86 +1,94 @@
1
- export interface CanvasRenderingContext2DEvent {
2
- /**
3
- * This is the type of canvas event that occured.
4
- */
5
- type: string;
6
- /**
7
- * This is a six element array that contains the current state of the canvas `currentTransform`
8
- * value.
9
- */
10
- transform: [number, number, number, number, number, number];
11
- /**
12
- * These are the relevant properties related to this canvas event.
13
- */
14
- props: {
15
- [key: string]: any;
16
- };
17
- }
18
-
19
- declare global {
20
- interface CanvasRenderingContext2D {
21
- /**
22
- * Get all the events associated with this CanvasRenderingContext2D object.
23
- *
24
- * This method cannot be used in a production environment, only with `jest` using
25
- * `jest-canvas-mock` and should only be used for testing.
26
- *
27
- * @example
28
- * expect(ctx.__getEvents()).toMatchSnapshot();
29
- */
30
- __getEvents(): CanvasRenderingContext2DEvent[];
31
-
32
- /**
33
- * Clear all the events associated with this CanvasRenderingContext2D object.
34
- *
35
- * This method cannot be used in a production environment, only with `jest` using
36
- * `jest-canvas-mock` and should only be used for testing.
37
- *
38
- * @example
39
- * ctx.__clearEvents());
40
- * expect(ctx.__getEvents()).toBe([]);
41
- */
42
- __clearEvents(): void;
43
-
44
- /**
45
- * Get all the successful draw calls associated with this CanvasRenderingContext2D object.
46
- *
47
- * This method cannot be used in a production environment, only with `jest` using
48
- * `jest-canvas-mock` and should only be used for testing.
49
- *
50
- * @example
51
- * expect(ctx.__getDrawCalls()).toMatchSnapshot();
52
- */
53
- __getDrawCalls(): CanvasRenderingContext2DEvent[];
54
-
55
- /**
56
- * Clear all the successful draw calls associated with this CanvasRenderingContext2D object.
57
- *
58
- * This method cannot be used in a production environment, only with `jest` using
59
- * `jest-canvas-mock` and should only be used for testing.
60
- *
61
- * @example
62
- * ctx.__clearDrawCalls());
63
- * expect(ctx.__getDrawCalls()).toBe([]);
64
- */
65
- __clearDrawCalls(): void;
66
-
67
- /**
68
- * Get the current path associated with this CanvasRenderingContext2D object.
69
- *
70
- * This method cannot be used in a production environment, only with `jest` using
71
- * `jest-canvas-mock` and should only be used for testing.
72
- *
73
- * @example
74
- * expect(ctx.__getPath()).toMatchSnapshot();
75
- */
76
- __getPath(): CanvasRenderingContext2DEvent[];
77
-
78
- /**
79
- * Clears the current path associated with this CanvasRenderingContext2D object.
80
- *
81
- * This method cannot be used in a production environment, only with `jest` using
82
- * `jest-canvas-mock` and should be only used for testing.
83
- */
84
- __clearPath(): void;
85
- }
86
- }
1
+ export interface CanvasRenderingContext2DEvent {
2
+ /**
3
+ * This is the type of canvas event that occured.
4
+ */
5
+ type: string;
6
+ /**
7
+ * This is a six element array that contains the current state of the canvas `currentTransform`
8
+ * value.
9
+ */
10
+ transform: [number, number, number, number, number, number];
11
+ /**
12
+ * These are the relevant properties related to this canvas event.
13
+ */
14
+ props: {
15
+ [key: string]: any;
16
+ };
17
+ }
18
+
19
+ declare global {
20
+ interface CanvasRenderingContext2D {
21
+ /**
22
+ * Get all the events associated with this CanvasRenderingContext2D object.
23
+ *
24
+ * This method cannot be used in a production environment, only with `jest` using
25
+ * `jest-canvas-mock` and should only be used for testing.
26
+ *
27
+ * @example
28
+ * expect(ctx.__getEvents()).toMatchSnapshot();
29
+ */
30
+ __getEvents(): CanvasRenderingContext2DEvent[];
31
+
32
+ /**
33
+ * Clear all the events associated with this CanvasRenderingContext2D object.
34
+ *
35
+ * This method cannot be used in a production environment, only with `jest` using
36
+ * `jest-canvas-mock` and should only be used for testing.
37
+ *
38
+ * @example
39
+ * ctx.__clearEvents());
40
+ * expect(ctx.__getEvents()).toBe([]);
41
+ */
42
+ __clearEvents(): void;
43
+
44
+ /**
45
+ * Get all the successful draw calls associated with this CanvasRenderingContext2D object.
46
+ *
47
+ * This method cannot be used in a production environment, only with `jest` using
48
+ * `jest-canvas-mock` and should only be used for testing.
49
+ *
50
+ * @example
51
+ * expect(ctx.__getDrawCalls()).toMatchSnapshot();
52
+ */
53
+ __getDrawCalls(): CanvasRenderingContext2DEvent[];
54
+
55
+ /**
56
+ * Clear all the successful draw calls associated with this CanvasRenderingContext2D object.
57
+ *
58
+ * This method cannot be used in a production environment, only with `jest` using
59
+ * `jest-canvas-mock` and should only be used for testing.
60
+ *
61
+ * @example
62
+ * ctx.__clearDrawCalls());
63
+ * expect(ctx.__getDrawCalls()).toBe([]);
64
+ */
65
+ __clearDrawCalls(): void;
66
+
67
+ /**
68
+ * Get the current path associated with this CanvasRenderingContext2D object.
69
+ *
70
+ * This method cannot be used in a production environment, only with `jest` using
71
+ * `jest-canvas-mock` and should only be used for testing.
72
+ *
73
+ * @example
74
+ * expect(ctx.__getPath()).toMatchSnapshot();
75
+ */
76
+ __getPath(): CanvasRenderingContext2DEvent[];
77
+
78
+ /**
79
+ * Clears the current path associated with this CanvasRenderingContext2D object.
80
+ *
81
+ * This method cannot be used in a production environment, only with `jest` using
82
+ * `jest-canvas-mock` and should be only used for testing.
83
+ */
84
+ __clearPath(): void;
85
+
86
+ /**
87
+ * Obtains the current clipping path.
88
+ *
89
+ * This method cannot be used in a production environment, only with `jest` using
90
+ * `jest-canvas-mock` and should be only used for testing.
91
+ */
92
+ __getClippingRegion(): CanvasRenderingContext2DEvent[];
93
+ }
94
+ }
@@ -1,12 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
- patreon: # Replace with a single Patreon username
5
- open_collective: # Replace with a single Open Collective username
6
- ko_fi: # Replace with a single Ko-fi username
7
- tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
- community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
- liberapay: # Replace with a single Liberapay username
10
- issuehunt: # Replace with a single IssueHunt username
11
- otechie: # Replace with a single Otechie username
12
- custom: ['https://paypal.me/hustcc', 'https://atool.vip']