@salla.sa/twilight 2.0.242 → 2.0.243
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/dist/@salla.sa/twilight.min.js +1 -1
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/types/api/comment.d.ts +8 -2
- package/types/event/comment.d.ts +4 -4
package/package.json
CHANGED
package/types/api/comment.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import {SuccessResponse} from "../common";
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface AddCommentResponse extends SuccessResponse {
|
|
4
4
|
data: {
|
|
5
5
|
case: 'success' | 'error';
|
|
6
6
|
message: string;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export interface AddCommentPayload {
|
|
11
|
+
id: number;
|
|
12
|
+
comment: string;
|
|
13
|
+
type: 'product' | 'page';
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
export default interface CommentApi {
|
|
11
|
-
|
|
17
|
+
add: (data: AddCommentPayload) => Promise<AddCommentResponse>;
|
|
12
18
|
}
|
package/types/event/comment.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {RequestErrorEventWithData} from "../common";
|
|
2
|
+
import {AddCommentResponse} from "../api/comment";
|
|
3
3
|
|
|
4
4
|
export default interface CommentEvent {
|
|
5
|
-
onAdded: (callback: (response:
|
|
6
|
-
onAdditionFailed:
|
|
5
|
+
onAdded: (callback: (response: AddCommentResponse) => void, /*product/page id*/ id:number) => void;
|
|
6
|
+
onAdditionFailed: RequestErrorEventWithData</*product/page id*/number>;
|
|
7
7
|
}
|