obi-sdk 0.1.4 → 0.1.5
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/obi-sdk.d.ts +1 -0
- package/package.json +6 -4
- package/src/index.d.ts +38 -0
package/obi-sdk.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index"
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obi-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "JavaScript SDK for Obi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/obi-sdk.umd.js",
|
|
7
7
|
"module": "dist/obi-sdk.es.js",
|
|
8
|
-
"types": "
|
|
8
|
+
"types": "obi-sdk.d.ts",
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"obi-sdk.d.ts",
|
|
12
|
+
"src/index.d.ts"
|
|
11
13
|
],
|
|
12
14
|
"scripts": {
|
|
13
15
|
"dev": "vite",
|
|
14
|
-
"build": "tsc && vite build
|
|
16
|
+
"build": "tsc --noEmit && vite build",
|
|
15
17
|
"build:loader": "vite build --config vite.loader.config.js",
|
|
16
18
|
"build:standalone": "vite build --config vite.standalone.config.js",
|
|
17
19
|
"build:modular": "vite build --config vite.modular.config.js",
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ObiAssistantConfig {
|
|
2
|
+
apiKey: string
|
|
3
|
+
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left"
|
|
4
|
+
user?: {
|
|
5
|
+
id: string
|
|
6
|
+
email?: string
|
|
7
|
+
metadata?: Record<string, any>
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class ObiAssistant {
|
|
12
|
+
static init(config: ObiAssistantConfig): HTMLElement
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class ObiSDK {
|
|
16
|
+
// Core SDK methods
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class ObiWidget extends HTMLElement {
|
|
20
|
+
apiKey: string
|
|
21
|
+
position?: string
|
|
22
|
+
user?: {
|
|
23
|
+
id: string
|
|
24
|
+
email?: string
|
|
25
|
+
metadata?: Record<string, any>
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum EventType {}
|
|
30
|
+
// Event types
|
|
31
|
+
|
|
32
|
+
export enum SDKState {}
|
|
33
|
+
// SDK states
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Initialize the Obi Assistant widget with the latest SDK version
|
|
37
|
+
*/
|
|
38
|
+
export function initObi(config: ObiAssistantConfig): Promise<HTMLElement>
|