@patientprism/snippet-sdk 1.1.1 → 1.1.3
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 +4 -1
- package/types/index.d.ts +82 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@patientprism/snippet-sdk",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"types": "types/index.d.ts",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.3",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "vitest run",
|
|
8
8
|
"test:watch": "vitest watch",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"build": "vite build",
|
|
11
11
|
"build:types": "sh ./build-type-declarations.sh"
|
|
12
12
|
},
|
|
13
|
+
"files": [
|
|
14
|
+
"types/"
|
|
15
|
+
],
|
|
13
16
|
"dependencies": {},
|
|
14
17
|
"devDependencies": {}
|
|
15
18
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} SubmissionField
|
|
3
|
+
*
|
|
4
|
+
* @property {string} type
|
|
5
|
+
* @property {string|number} value
|
|
6
|
+
* @property {string} label
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Record<string, string|number|null>} SubmissionOptions
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {Record<string, SubmissionField>} Submission
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {Object} SwapSDK
|
|
16
|
+
*
|
|
17
|
+
* Object containing methods related to Swap functionality.
|
|
18
|
+
*
|
|
19
|
+
* @property {() => Promise<void>} init Initializes the Swap functionality.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} SubmissionSDK
|
|
23
|
+
*
|
|
24
|
+
* Object containing methods related to Submission functionality.
|
|
25
|
+
*
|
|
26
|
+
* @property {boolean} captureHiddenFields Indicates whether hidden fields should be captured in submissions.
|
|
27
|
+
* @property {() => Promise<void>} init Initialize the Submission functionality.
|
|
28
|
+
* @property {(data: Submission, elementID: string|HTMLElement, options?: SubmissionOptions) => Promise<void>} send Send the form submission.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {Object} CustomFieldSDK
|
|
32
|
+
*
|
|
33
|
+
* Object containing methods related to the Custom Field functionality.
|
|
34
|
+
*
|
|
35
|
+
* @property {(keys?: string|string[]|Set<string>) => Promise<void>} recapture Recapture some or all of the custom fields.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* @typedef {Object} CustomFieldSDK
|
|
39
|
+
*
|
|
40
|
+
* Object containing methods related to the Custom Field functionality.
|
|
41
|
+
*
|
|
42
|
+
* @property {(keys?: string|string[]|Set<string>) => Promise<void>} recapture Recapture some or all of the custom fields.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {Object} BookingSDK
|
|
46
|
+
*
|
|
47
|
+
* Object containing methods related to Online Booking functionality.
|
|
48
|
+
*
|
|
49
|
+
* @property {(source: string, options?: Object) => Object} create Create a booking session
|
|
50
|
+
* @property {(formElement: HTMLElement, source: string, options?: Object) => Object} track Track a form for booking lifecycle (convenience method)
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* @typedef {Object} PrismSDK
|
|
54
|
+
*
|
|
55
|
+
* The global `$prism` object for managing Prism-related functionality.
|
|
56
|
+
*
|
|
57
|
+
* @property {boolean} loaded Indicates whether Prism has been loaded or not.
|
|
58
|
+
* @property {boolean} debug Indicates whether Prism is in debug mode or not.
|
|
59
|
+
* @property {(message: string) => void} log Logs a message to the console if debug mode is enabled.
|
|
60
|
+
* @property {SwapSDK} swap Object containing methods related to Swap functionality.
|
|
61
|
+
* @property {SubmissionSDK} submission Object containing methods related to Submission functionality.
|
|
62
|
+
* @property {CustomFieldSDK} custom_fields Object containing methods related to the Custom Field functionality.
|
|
63
|
+
* @property {BookingSDK} bookings Object containing methods related to Online Booking functionality.
|
|
64
|
+
*/
|
|
65
|
+
export default function handle(): void;
|
|
1
66
|
export type SubmissionField = {
|
|
2
67
|
type: string;
|
|
3
68
|
value: string | number;
|
|
@@ -40,6 +105,19 @@ export type CustomFieldSDK = {
|
|
|
40
105
|
*/
|
|
41
106
|
recapture: (keys?: string | string[] | Set<string>) => Promise<void>;
|
|
42
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* Object containing methods related to Online Booking functionality.
|
|
110
|
+
*/
|
|
111
|
+
export type BookingSDK = {
|
|
112
|
+
/**
|
|
113
|
+
* Create a booking session
|
|
114
|
+
*/
|
|
115
|
+
create: (source: string, options?: any) => any;
|
|
116
|
+
/**
|
|
117
|
+
* Track a form for booking lifecycle (convenience method)
|
|
118
|
+
*/
|
|
119
|
+
track: (formElement: HTMLElement, source: string, options?: any) => any;
|
|
120
|
+
};
|
|
43
121
|
/**
|
|
44
122
|
* The global `$prism` object for managing Prism-related functionality.
|
|
45
123
|
*/
|
|
@@ -68,6 +146,10 @@ export type PrismSDK = {
|
|
|
68
146
|
* Object containing methods related to the Custom Field functionality.
|
|
69
147
|
*/
|
|
70
148
|
custom_fields: CustomFieldSDK;
|
|
149
|
+
/**
|
|
150
|
+
* Object containing methods related to Online Booking functionality.
|
|
151
|
+
*/
|
|
152
|
+
bookings: BookingSDK;
|
|
71
153
|
};
|
|
72
154
|
|
|
73
155
|
declare global {
|