@hkdigital/lib-sveltekit 0.1.68 → 0.1.70

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.
@@ -0,0 +1,93 @@
1
+ /**
2
+ * @typedef {Object} HttpRequestOptions
3
+ * @property {string|URL} url URL string or URL object for the request
4
+ * @property {string} [method] HTTP method to use (GET, POST, etc.)
5
+ *
6
+ * @property {Object|URLSearchParams} [urlSearchParams]
7
+ * Parameters to add to the URL
8
+ *
9
+ * @property {*} [body] Request body (for POST, PUT, etc.)
10
+ * @property {Object} [headers] HTTP headers as name-value pairs
11
+ * @property {boolean} [withCredentials] Whether to include credentials
12
+ * @property {number} [timeoutMs] Request timeout in milliseconds
13
+ * @property {Function} [requestHandler] Handler for abort/timeout control
14
+ * @property {string} [mode] CORS mode ('cors', 'no-cors', 'same-origin')
15
+ * @property {string} [cache] Cache mode ('default', 'no-cache', etc.)
16
+ * @property {string} [redirect] Redirect mode ('follow', 'error', 'manual')
17
+ * @property {string} [referrerPolicy] Referrer policy
18
+ * @property {boolean} [cacheEnabled] Enable or disabled automatic caching
19
+ */
20
+
21
+ /**
22
+ * @typedef {Object} RequestHandlerParams
23
+ *
24
+ * @property {AbortController} controller
25
+ * The AbortController instance for this request
26
+ *
27
+ * @property {(reason?: Error) => void} abort Function to abort the request
28
+ * @property {(delayMs: number) => void} timeout Function to set a timeout
29
+ */
30
+
31
+ /**
32
+ * @callback RequestHandler
33
+ * @param {RequestHandlerParams} params Parameters for controlling the request
34
+ * @returns {void}
35
+ */
36
+
37
+ /**
38
+ * @typedef {Object} JsonGetOptions
39
+ * @property {string|URL} url URL string or URL object for the request
40
+ *
41
+ * @property {Object|URLSearchParams} [urlSearchParams]
42
+ * Parameters to add to the URL
43
+ *
44
+ * @property {Object} [headers] HTTP headers as name-value pairs
45
+ * @property {boolean} [withCredentials] Whether to include credentials
46
+ * @property {number} [timeoutMs] Request timeout in milliseconds
47
+ * @property {RequestHandler} [requestHandler] Handler for abort/timeout control
48
+ * @property {string} [mode] CORS mode ('cors', 'no-cors', 'same-origin')
49
+ * @property {string} [cache] Cache mode ('default', 'no-cache', etc.)
50
+ * @property {string} [redirect] Redirect mode ('follow', 'error', 'manual')
51
+ * @property {string} [referrerPolicy] Referrer policy
52
+ * @property {boolean} [cacheEnabled] Enable or disabled automatic caching
53
+ */
54
+
55
+ /**
56
+ * @typedef {Object} JsonPostOptions
57
+ * @property {string|URL} url URL string or URL object for the request
58
+ * @property {*} body Request body (will be sent as JSON)
59
+ *
60
+ * @property {Object|URLSearchParams} [urlSearchParams]
61
+ * Parameters to add to the URL
62
+ *
63
+ * @property {Object} [headers] HTTP headers as name-value pairs
64
+ * @property {boolean} [withCredentials] Whether to include credentials
65
+ * @property {number} [timeoutMs] Request timeout in milliseconds
66
+ * @property {RequestHandler} [requestHandler] Handler for abort/timeout control
67
+ * @property {string} [mode] CORS mode ('cors', 'no-cors', 'same-origin')
68
+ * @property {string} [cache] Cache mode ('default', 'no-cache', etc.)
69
+ * @property {string} [redirect] Redirect mode ('follow', 'error', 'manual')
70
+ * @property {string} [referrerPolicy] Referrer policy
71
+ * @property {boolean} [cacheEnabled] Enable or disabled automatic caching
72
+ */
73
+
74
+ /**
75
+ * @typedef {Object} StaleInfo
76
+ * @property {boolean} isStale Whether the response contains stale data
77
+ *
78
+ * @property {Promise<Response>|null} fresh
79
+ * Promise that resolves to fresh data (if available)
80
+ *
81
+ * @property {number} timestamp When the response was originally cached
82
+ * @property {number|null} expires When the response expires
83
+ */
84
+
85
+ /**
86
+ * @typedef {Response} ResponseWithStale
87
+ * @property {boolean} isStale Whether this response contains stale data
88
+ *
89
+ * @property {Promise<Response>|null} fresh
90
+ * Promise for fresh data if this is stale
91
+ */
92
+
93
+ export {};
@@ -6,8 +6,8 @@
6
6
  getGameWidthOnPortrait
7
7
  } from './gamebox.util.js';
8
8
 
9
- //import { enableContainerScaling } from '../../util/design-system/index.js';
10
- import { enableContainerScaling } from '@hkdigital/lib-sveltekit/util/design-system/index.js';
9
+ import { enableContainerScaling } from '../../util/design-system/index.js';
10
+ // import { enableContainerScaling } from '@hkdigital/lib-sveltekit/util/design-system/index.js';
11
11
 
12
12
  /**
13
13
  * @typedef {{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-sveltekit",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"