@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight",
3
- "version": "2.0.242",
3
+ "version": "2.0.243",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,12 +1,18 @@
1
1
  import {SuccessResponse} from "../common";
2
2
 
3
- export interface SendCommentResponse extends SuccessResponse {
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
- send: (data: { id: number, comment: string, type: 'product' | 'page' }) => Promise<SendCommentResponse>;
17
+ add: (data: AddCommentPayload) => Promise<AddCommentResponse>;
12
18
  }
@@ -1,7 +1,7 @@
1
- import {RequestError} from "../common";
2
- import {SendCommentResponse} from "../api/comment";
1
+ import {RequestErrorEventWithData} from "../common";
2
+ import {AddCommentResponse} from "../api/comment";
3
3
 
4
4
  export default interface CommentEvent {
5
- onAdded: (callback: (response: SendCommentResponse) => void) => void;
6
- onAdditionFailed: (callback: (error: RequestError) => void) => void;
5
+ onAdded: (callback: (response: AddCommentResponse) => void, /*product/page id*/ id:number) => void;
6
+ onAdditionFailed: RequestErrorEventWithData</*product/page id*/number>;
7
7
  }