@@ -6,22 +6,60 @@ const VERSION = Symbol.for('msw-integration-layer::version');
6
6
* and it's import should be pure and non-sideeffectful.
7
7
*/
8
8
export const http = {
9
+ /**
10
+ * @param {string } endpoint
11
+ * @param {import('./types.js').handler } handler
12
+ * @returns {import('./types.js').Mock }
13
+ */
9
14
get : ( endpoint , handler ) => {
10
15
return { [ VERSION ] : '1.x.x' , method : 'get' , endpoint, handler } ;
11
16
} ,
17
+ /**
18
+ * @param {string } endpoint
19
+ * @param {import('./types.js').handler } handler
20
+ * @returns {import('./types.js').Mock }
21
+ */
12
22
post : ( endpoint , handler ) => {
13
23
return { [ VERSION ] : '1.x.x' , method : 'post' , endpoint, handler } ;
14
24
} ,
25
+ /**
26
+ * @param {string } endpoint
27
+ * @param {import('./types.js').handler } handler
28
+ * @returns {import('./types.js').Mock }
29
+ */
15
30
put : ( endpoint , handler ) => {
16
31
return { [ VERSION ] : '1.x.x' , method : 'put' , endpoint, handler } ;
17
32
} ,
33
+ /**
34
+ * @param {string } endpoint
35
+ * @param {import('./types.js').handler } handler
36
+ * @returns {import('./types.js').Mock }
37
+ */
18
38
patch : ( endpoint , handler ) => {
19
39
return { [ VERSION ] : '1.x.x' , method : 'patch' , endpoint, handler } ;
20
40
} ,
41
+ /**
42
+ * @param {string } endpoint
43
+ * @param {import('./types.js').handler } handler
44
+ * @returns {import('./types.js').Mock }
45
+ */
21
46
delete : ( endpoint , handler ) => {
22
47
return { [ VERSION ] : '1.x.x' , method : 'delete' , endpoint, handler } ;
23
48
} ,
49
+ /**
50
+ * @param {string } endpoint
51
+ * @param {import('./types.js').handler } handler
52
+ * @returns {import('./types.js').Mock }
53
+ */
24
54
options : ( endpoint , handler ) => {
25
55
return { [ VERSION ] : '1.x.x' , method : 'options' , endpoint, handler } ;
26
56
} ,
57
+ /**
58
+ * @param {string } endpoint
59
+ * @param {import('./types.js').handler } handler
60
+ * @returns {import('./types.js').Mock }
61
+ */
62
+ head : ( endpoint , handler ) => {
63
+ return { [ VERSION ] : '1.x.x' , method : 'head' , endpoint, handler } ;
64
+ } ,
27
65
} ;
0 commit comments