@product7/feedback-sdk 1.0.1 → 1.0.2
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 +3 -1
- package/types/index.d.ts +42 -0
- package/src/types/index.d.ts +0 -12
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@product7/feedback-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "JavaScript SDK for integrating Product7 feedback widgets into any website",
|
|
5
5
|
"main": "dist/feedback-sdk.js",
|
|
6
6
|
"module": "src/index.js",
|
|
7
7
|
"browser": "dist/feedback-sdk.min.js",
|
|
8
|
+
"types": "types/index.d.ts",
|
|
8
9
|
"files": [
|
|
9
10
|
"dist/",
|
|
10
11
|
"src/",
|
|
12
|
+
"types/",
|
|
11
13
|
"README.md"
|
|
12
14
|
],
|
|
13
15
|
"scripts": {
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '@product7/feedback-sdk' {
|
|
2
|
+
export interface FeedbackConfig {
|
|
3
|
+
workspace: string;
|
|
4
|
+
debug?: boolean;
|
|
5
|
+
boardId?: string;
|
|
6
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ButtonWidget {
|
|
10
|
+
mount(container?: string | HTMLElement): this;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
show(): this;
|
|
13
|
+
hide(): this;
|
|
14
|
+
openModal(): void;
|
|
15
|
+
closeModal(): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class FeedbackSDK {
|
|
19
|
+
constructor(config: FeedbackConfig);
|
|
20
|
+
init(): Promise<any>;
|
|
21
|
+
createWidget(
|
|
22
|
+
type: 'button',
|
|
23
|
+
options?: Partial<FeedbackConfig>
|
|
24
|
+
): ButtonWidget;
|
|
25
|
+
readonly initialized: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface FeedbackSDKExport {
|
|
29
|
+
FeedbackSDK: typeof FeedbackSDK;
|
|
30
|
+
ButtonWidget: any;
|
|
31
|
+
create: (config: FeedbackConfig) => FeedbackSDK;
|
|
32
|
+
getInstance: () => FeedbackSDK | null;
|
|
33
|
+
isReady: () => boolean;
|
|
34
|
+
version: string;
|
|
35
|
+
instance: FeedbackSDK | null;
|
|
36
|
+
onReady: (callback: (sdk: FeedbackSDK) => void) => void;
|
|
37
|
+
onError: (callback: (error: Error) => void) => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const FeedbackSDKDefault: FeedbackSDKExport;
|
|
41
|
+
export default FeedbackSDKDefault;
|
|
42
|
+
}
|
package/src/types/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare module '@product7/feedback-sdk' {
|
|
2
|
-
export class FeedbackSDK {
|
|
3
|
-
constructor(config: any);
|
|
4
|
-
init(): Promise<any>;
|
|
5
|
-
createWidget(type: string, options?: any): any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class ButtonWidget {
|
|
9
|
-
mount(container?: string | HTMLElement): this;
|
|
10
|
-
destroy(): void;
|
|
11
|
-
}
|
|
12
|
-
}
|