@hkdigital/lib-core 0.4.30 → 0.4.32
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/dist/auth/jwt/constants.d.ts +1 -1
- package/dist/auth/jwt/errors.d.ts +5 -5
- package/dist/auth/jwt/typedef.d.ts +30 -30
- package/dist/config/generators/imagetools.d.ts +3 -3
- package/dist/config/generators/vite.d.ts +11 -11
- package/dist/config/generators/vite.js +1 -1
- package/dist/design/generators/index.d.ts +9 -9
- package/dist/design/utils/clamp.d.ts +1 -1
- package/dist/design/utils/root-vars.d.ts +1 -1
- package/dist/design/utils/scaling.d.ts +2 -2
- package/dist/generic/data/classes/IterableTree.d.ts +2 -2
- package/dist/generic/data/classes/IterableTree.js +1 -0
- package/dist/generic/data/classes/Selector.d.ts +5 -5
- package/dist/generic/data/classes/Selector.js +53 -60
- package/dist/generic/data/classes/typedef.d.ts +5 -5
- package/dist/generic/errors/generic.d.ts +3 -1
- package/dist/generic/errors/promise.d.ts +2 -2
- package/dist/generic/events/classes/EventEmitter.js +1 -0
- package/dist/generic/promises/classes/HkPromise.js +9 -15
- package/dist/logging/internal/adapters/console.d.ts +5 -5
- package/dist/logging/internal/adapters/pino.d.ts +3 -3
- package/dist/logging/internal/adapters/typedef.d.ts +7 -7
- package/dist/logging/internal/factories/client.d.ts +1 -1
- package/dist/logging/internal/factories/server.d.ts +1 -1
- package/dist/logging/internal/logger/Logger.d.ts +3 -3
- package/dist/logging/internal/transports/pretty-transport.d.ts +3 -3
- package/dist/logging/internal/transports/test-transport.d.ts +5 -5
- package/dist/logging/typedef.d.ts +1 -1
- package/dist/network/cache/IndexedDbCache.d.ts +10 -10
- package/dist/network/cache/MemoryResponseCache.d.ts +3 -3
- package/dist/network/cache/typedef.d.ts +3 -3
- package/dist/network/errors/http.d.ts +2 -2
- package/dist/network/http/caching.d.ts +2 -2
- package/dist/network/http/http-request.d.ts +1 -1
- package/dist/network/http/typedef.d.ts +31 -31
- package/dist/network/loaders/audio/AudioScene.svelte.d.ts +2 -2
- package/dist/network/loaders/base/SceneBase.svelte.d.ts +4 -4
- package/dist/network/loaders/base/SceneBase.svelte.js +1 -1
- package/dist/network/loaders/image/ImageLoader.svelte.d.ts +1 -1
- package/dist/network/loaders/image/ImageVariantsLoader.svelte.d.ts +5 -5
- package/dist/network/loaders/image/utils/index.d.ts +3 -3
- package/dist/services/manager-plugins/ConfigPlugin.d.ts +1 -1
- package/dist/services/service-base/ServiceBase.d.ts +13 -3
- package/dist/services/service-base/ServiceBase.js +27 -9
- package/dist/services/service-base/typedef.d.ts +8 -8
- package/dist/services/service-manager/ServiceManager.d.ts +10 -2
- package/dist/services/service-manager/ServiceManager.js +55 -27
- package/dist/services/service-manager/typedef.d.ts +12 -11
- package/dist/services/service-manager/typedef.js +2 -1
- package/dist/state/machines/finite-state-machine/FiniteStateMachine.svelte.d.ts +1 -1
- package/dist/state/machines/loading-state-machine/LoadingStateMachine.svelte.d.ts +1 -1
- package/dist/state/stores/theme.d.ts +1 -1
- package/dist/ui/components/button-group/ButtonGroup.svelte.d.ts +7 -7
- package/dist/ui/components/button-group/typedef.d.ts +1 -1
- package/dist/ui/components/compare-left-right/CompareLeftRight.svelte.d.ts +5 -5
- package/dist/ui/components/drag-drop/DragController.d.ts +1 -1
- package/dist/ui/components/drag-drop/DragDropContext.svelte.d.ts +3 -3
- package/dist/ui/components/drag-drop/Draggable.svelte.d.ts +20 -20
- package/dist/ui/components/drag-drop/DropZone.svelte.d.ts +27 -27
- package/dist/ui/components/drag-drop/DropZoneArea.svelte.d.ts +26 -26
- package/dist/ui/components/drag-drop/DropZoneList.svelte.d.ts +27 -27
- package/dist/ui/components/drag-drop/drag-state.svelte.d.ts +4 -4
- package/dist/ui/components/drag-drop/typedef/drag.d.ts +1 -1
- package/dist/ui/components/game-box/GameBox.svelte.d.ts +19 -19
- package/dist/ui/components/game-box/gamebox.util.d.ts +2 -2
- package/dist/ui/components/grid-layers/GridLayers.svelte.d.ts +7 -7
- package/dist/ui/components/image-box/ImageBox.svelte.d.ts +14 -14
- package/dist/ui/components/presenter/ImageSlide.svelte.d.ts +8 -8
- package/dist/ui/components/presenter/Presenter.state.svelte.d.ts +1 -1
- package/dist/ui/components/presenter/Presenter.svelte.d.ts +5 -5
- package/dist/ui/components/presenter/typedef.d.ts +13 -13
- package/dist/ui/components/rows/panel-grid-row/PanelGridRow.svelte.d.ts +7 -7
- package/dist/ui/components/rows/panel-row-2/PanelRow2.svelte.d.ts +7 -7
- package/dist/ui/components/tab-bar/HkTabBar.svelte.d.ts +10 -10
- package/dist/ui/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +1 -1
- package/dist/ui/components/tab-bar/HkTabBarSelector.svelte.d.ts +10 -10
- package/dist/ui/components/tab-bar/typedef.d.ts +3 -3
- package/dist/ui/components/virtual-viewport/VirtualViewport.svelte.d.ts +17 -17
- package/dist/ui/dev/blocks/TextBlock.svelte.d.ts +6 -6
- package/dist/ui/dev/buttons/CheckButton.svelte.d.ts +11 -11
- package/dist/ui/primitives/area/HkArea.svelte.d.ts +6 -6
- package/dist/ui/primitives/area/HkGridArea.svelte.d.ts +12 -12
- package/dist/ui/primitives/buttons/button/Button.svelte.d.ts +16 -16
- package/dist/ui/primitives/buttons/button-icon-steeze/SteezeIconButton.svelte.d.ts +2 -2
- package/dist/ui/primitives/buttons/button-submit/SubmitButton.svelte +21 -0
- package/dist/ui/primitives/buttons/button-submit/SubmitButton.svelte.d.ts +12 -0
- package/dist/ui/primitives/buttons/index.d.ts +2 -1
- package/dist/ui/primitives/buttons/index.js +2 -1
- package/dist/ui/primitives/icons/HkIcon.svelte.d.ts +4 -4
- package/dist/ui/primitives/icons/HkTabIcon.svelte.d.ts +13 -13
- package/dist/ui/primitives/icons/SteezeIcon.svelte.d.ts +4 -4
- package/dist/ui/primitives/inputs/text-input/TextInput.svelte.d.ts +22 -22
- package/dist/ui/primitives/inputs/text-input/assets/IconInvalid.svelte.d.ts +1 -1
- package/dist/ui/primitives/inputs/text-input/assets/IconValid.svelte.d.ts +1 -1
- package/dist/ui/primitives/panels/panel/Panel.svelte.d.ts +6 -6
- package/dist/util/array/index.d.ts +17 -17
- package/dist/util/array/index.js +5 -5
- package/dist/util/compare/index.d.ts +2 -1
- package/dist/util/compare/index.js +1 -0
- package/dist/util/exceptions/index.d.ts +3 -2
- package/dist/util/exceptions/index.js +13 -9
- package/dist/util/expect/arrays.d.ts +1 -0
- package/dist/util/expect/arrays.js +1 -0
- package/dist/util/expect/primitives.d.ts +18 -0
- package/dist/util/expect/primitives.js +18 -0
- package/dist/util/function/index.d.ts +14 -1
- package/dist/util/geometry/index.d.ts +2 -2
- package/dist/util/geometry/index.js +1 -1
- package/dist/util/iterate/index.d.ts +7 -7
- package/dist/util/object/index.d.ts +13 -13
- package/dist/util/singleton/index.d.ts +3 -3
- package/dist/util/svelte/loading/loading-tracker.svelte.d.ts +1 -1
- package/dist/util/sveltekit/env/all.d.ts +7 -18
- package/dist/util/sveltekit/env/all.js +4 -22
- package/dist/util/sveltekit/env/parsers.d.ts +23 -37
- package/dist/util/sveltekit/env/parsers.js +15 -15
- package/dist/util/sveltekit/env/private.d.ts +9 -11
- package/dist/util/sveltekit/env/private.js +4 -4
- package/dist/util/sveltekit/env/public.d.ts +9 -11
- package/dist/util/sveltekit/env/public.js +3 -3
- package/dist/util/sveltekit/env-all.d.ts +1 -1
- package/dist/util/sveltekit/env-all.js +2 -4
- package/dist/util/sveltekit/route-folders/index.d.ts +2 -2
- package/dist/util/sveltekit/route-folders.d.ts +1 -0
- package/dist/util/{sveltekit.js → sveltekit/route-folders.js} +1 -1
- package/dist/util/time/index.d.ts +4 -4
- package/dist/valibot/parsers/url.d.ts +3 -3
- package/dist/valibot/parsers/url.js +6 -2
- package/package.json +1 -1
- package/dist/util/sveltekit.d.ts +0 -1
|
@@ -11,23 +11,23 @@ export class ConsoleAdapter {
|
|
|
11
11
|
* Additional context data to include with all logs
|
|
12
12
|
*/
|
|
13
13
|
constructor(options?: {
|
|
14
|
-
level?: string;
|
|
15
|
-
context?:
|
|
14
|
+
level?: string | undefined;
|
|
15
|
+
context?: Object | undefined;
|
|
16
16
|
});
|
|
17
17
|
level: string;
|
|
18
|
-
context:
|
|
18
|
+
context: Object;
|
|
19
19
|
/**
|
|
20
20
|
* Handle log events from Logger
|
|
21
21
|
*
|
|
22
22
|
* @param {Object} logEvent - Log event from Logger
|
|
23
23
|
*/
|
|
24
|
-
handleLog(logEvent:
|
|
24
|
+
handleLog(logEvent: Object): void;
|
|
25
25
|
/**
|
|
26
26
|
* Create a child logger with additional context
|
|
27
27
|
*
|
|
28
28
|
* @param {Object} context - Additional context data
|
|
29
29
|
* @returns {ConsoleAdapter} New adapter instance with context
|
|
30
30
|
*/
|
|
31
|
-
child(context:
|
|
31
|
+
child(context: Object): ConsoleAdapter;
|
|
32
32
|
#private;
|
|
33
33
|
}
|
|
@@ -7,7 +7,7 @@ export class PinoAdapter {
|
|
|
7
7
|
*
|
|
8
8
|
* @param {Object} [options] - Pino configuration options
|
|
9
9
|
*/
|
|
10
|
-
constructor(options?:
|
|
10
|
+
constructor(options?: Object);
|
|
11
11
|
/**
|
|
12
12
|
* Promise that resolves when transport is ready
|
|
13
13
|
*
|
|
@@ -19,13 +19,13 @@ export class PinoAdapter {
|
|
|
19
19
|
*
|
|
20
20
|
* @param {Object} logEvent - Log event from Logger
|
|
21
21
|
*/
|
|
22
|
-
handleLog(logEvent:
|
|
22
|
+
handleLog(logEvent: Object): Promise<void>;
|
|
23
23
|
/**
|
|
24
24
|
* Create a child logger with additional context
|
|
25
25
|
*
|
|
26
26
|
* @param {Object} context - Additional context data
|
|
27
27
|
* @returns {PinoAdapter} New adapter instance with context
|
|
28
28
|
*/
|
|
29
|
-
child(context:
|
|
29
|
+
child(context: Object): PinoAdapter;
|
|
30
30
|
#private;
|
|
31
31
|
}
|
|
@@ -12,11 +12,11 @@ export type ErrorSummaryMeta = {
|
|
|
12
12
|
/**
|
|
13
13
|
* - User function name where error originated
|
|
14
14
|
*/
|
|
15
|
-
origin?: string;
|
|
15
|
+
origin?: string | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* - Index of most relevant stack frame to highlight
|
|
18
18
|
*/
|
|
19
|
-
relevantFrameIndex?: number;
|
|
19
|
+
relevantFrameIndex?: number | undefined;
|
|
20
20
|
};
|
|
21
21
|
export type ErrorSummary = {
|
|
22
22
|
/**
|
|
@@ -30,15 +30,15 @@ export type ErrorSummary = {
|
|
|
30
30
|
/**
|
|
31
31
|
* - Error meta
|
|
32
32
|
*/
|
|
33
|
-
meta?: ErrorSummaryMeta;
|
|
33
|
+
meta?: ErrorSummaryMeta | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* Stack trace (in debug mode for first exception)
|
|
36
36
|
*/
|
|
37
|
-
stack?: string;
|
|
37
|
+
stack?: string | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* - HTTP status code (for HttpError instances)
|
|
40
40
|
*/
|
|
41
|
-
status?: number;
|
|
41
|
+
status?: number | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* - Additional error details (for HttpError instances)
|
|
44
44
|
*/
|
|
@@ -46,9 +46,9 @@ export type ErrorSummary = {
|
|
|
46
46
|
/**
|
|
47
47
|
* - Formatted error type for display
|
|
48
48
|
*/
|
|
49
|
-
errorType?: string;
|
|
49
|
+
errorType?: string | undefined;
|
|
50
50
|
/**
|
|
51
51
|
* - Cleaned stack frames for terminal display
|
|
52
52
|
*/
|
|
53
|
-
stackFrames?: string[];
|
|
53
|
+
stackFrames?: string[] | undefined;
|
|
54
54
|
};
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @param {Object} [consoleOptions] - Additional console options
|
|
7
7
|
* @returns {Logger} Configured logger instance
|
|
8
8
|
*/
|
|
9
|
-
export function createClientLogger(name: string, level?: string, consoleOptions?:
|
|
9
|
+
export function createClientLogger(name: string, level?: string, consoleOptions?: Object): Logger;
|
|
10
10
|
import { Logger } from '../logger/index.js';
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @param {Object} [pinoOptions] - Additional pino options
|
|
7
7
|
* @returns {Logger} Configured logger instance
|
|
8
8
|
*/
|
|
9
|
-
export function createServerLogger(name: string, level?: string, pinoOptions?:
|
|
9
|
+
export function createServerLogger(name: string, level?: string, pinoOptions?: Object): Logger;
|
|
10
10
|
import { Logger } from '../logger/index.js';
|
|
@@ -10,7 +10,7 @@ export default class Logger extends EventEmitter {
|
|
|
10
10
|
* @param {string} [defaultLevel=INFO] - Initial log level threshold
|
|
11
11
|
* @param {Object} [context={}] - Default context data for all logs
|
|
12
12
|
*/
|
|
13
|
-
constructor(name: string, defaultLevel?: string, context?:
|
|
13
|
+
constructor(name: string, defaultLevel?: string, context?: Object);
|
|
14
14
|
name: string;
|
|
15
15
|
level: string;
|
|
16
16
|
/**
|
|
@@ -70,7 +70,7 @@ export default class Logger extends EventEmitter {
|
|
|
70
70
|
*
|
|
71
71
|
* @returns {Logger} New logger instance with merged context
|
|
72
72
|
*/
|
|
73
|
-
context(namespace: string, additionalContext:
|
|
73
|
+
context(namespace: string, additionalContext: Object): Logger;
|
|
74
74
|
/**
|
|
75
75
|
* Log an LogEvent emitted by an event emitter
|
|
76
76
|
*
|
|
@@ -80,7 +80,7 @@ export default class Logger extends EventEmitter {
|
|
|
80
80
|
* @param {string} eventName
|
|
81
81
|
* @param {import('../../typedef.js').LogEventData} eventData
|
|
82
82
|
*/
|
|
83
|
-
logFromEvent(eventName: string, eventData: import("../../typedef.js").LogEventData):
|
|
83
|
+
logFromEvent(eventName: string, eventData: import("../../typedef.js").LogEventData): false | undefined;
|
|
84
84
|
#private;
|
|
85
85
|
}
|
|
86
86
|
export type ErrorDetails = import("../../../generic/typedef.js").ErrorDetails;
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
* @returns {Promise<Object>} Transport-compatible object
|
|
13
13
|
*/
|
|
14
14
|
export default function createPrettyTransport(opts?: {
|
|
15
|
-
colorize?: boolean;
|
|
16
|
-
ignore?: string;
|
|
17
|
-
}): Promise<
|
|
15
|
+
colorize?: boolean | undefined;
|
|
16
|
+
ignore?: string | undefined;
|
|
17
|
+
}): Promise<Object>;
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* @returns {Promise<Object>} Transport-compatible object
|
|
13
13
|
*/
|
|
14
14
|
export default function createTestTransport(opts?: {
|
|
15
|
-
delay?: number;
|
|
16
|
-
shouldFail?: boolean;
|
|
17
|
-
failureMessage?: string;
|
|
18
|
-
shouldFailOnWrite?: boolean;
|
|
19
|
-
}): Promise<
|
|
15
|
+
delay?: number | undefined;
|
|
16
|
+
shouldFail?: boolean | undefined;
|
|
17
|
+
failureMessage?: string | undefined;
|
|
18
|
+
shouldFailOnWrite?: boolean | undefined;
|
|
19
|
+
}): Promise<Object>;
|
|
@@ -16,14 +16,14 @@ export default class IndexedDbCache {
|
|
|
16
16
|
* @param {string} [options.cacheVersion='1.0.0'] - Cache version, used for cache invalidation
|
|
17
17
|
*/
|
|
18
18
|
constructor(options?: {
|
|
19
|
-
dbName?: string;
|
|
20
|
-
storeName?: string;
|
|
21
|
-
maxSize?: number;
|
|
22
|
-
maxAge?: number;
|
|
23
|
-
cleanupBatchSize?: number;
|
|
24
|
-
cleanupInterval?: number;
|
|
25
|
-
cleanupPostponeTimeout?: number;
|
|
26
|
-
cacheVersion?: string;
|
|
19
|
+
dbName?: string | undefined;
|
|
20
|
+
storeName?: string | undefined;
|
|
21
|
+
maxSize?: number | undefined;
|
|
22
|
+
maxAge?: number | undefined;
|
|
23
|
+
cleanupBatchSize?: number | undefined;
|
|
24
|
+
cleanupInterval?: number | undefined;
|
|
25
|
+
cleanupPostponeTimeout?: number | undefined;
|
|
26
|
+
cacheVersion?: string | undefined;
|
|
27
27
|
});
|
|
28
28
|
dbName: string;
|
|
29
29
|
storeName: string;
|
|
@@ -50,7 +50,7 @@ export default class IndexedDbCache {
|
|
|
50
50
|
* @private
|
|
51
51
|
*/
|
|
52
52
|
private cleanupState;
|
|
53
|
-
postponeCleanupTimer: NodeJS.Timeout;
|
|
53
|
+
postponeCleanupTimer: NodeJS.Timeout | null;
|
|
54
54
|
/**
|
|
55
55
|
* Initialize the database connection
|
|
56
56
|
*
|
|
@@ -111,7 +111,7 @@ export default class IndexedDbCache {
|
|
|
111
111
|
* @param {Object} [metadata={}] - Cache metadata
|
|
112
112
|
* @returns {Promise<void>}
|
|
113
113
|
*/
|
|
114
|
-
set(key: string, response: Response, metadata?:
|
|
114
|
+
set(key: string, response: Response, metadata?: Object): Promise<void>;
|
|
115
115
|
/**
|
|
116
116
|
* Update an existing entry in the cache
|
|
117
117
|
*
|
|
@@ -38,7 +38,7 @@ export default class MemoryResponseCache {
|
|
|
38
38
|
* Internal cache storage using Map
|
|
39
39
|
* @type {Map<string, Object>}
|
|
40
40
|
*/
|
|
41
|
-
cache: Map<string,
|
|
41
|
+
cache: Map<string, Object>;
|
|
42
42
|
/**
|
|
43
43
|
* Get a cached response
|
|
44
44
|
*
|
|
@@ -54,7 +54,7 @@ export default class MemoryResponseCache {
|
|
|
54
54
|
* @param {Object} [metadata={}] - Cache metadata
|
|
55
55
|
* @returns {Promise<void>}
|
|
56
56
|
*/
|
|
57
|
-
set(key: string, response: Response, metadata?:
|
|
57
|
+
set(key: string, response: Response, metadata?: Object): Promise<void>;
|
|
58
58
|
/**
|
|
59
59
|
* Delete a cached entry
|
|
60
60
|
*
|
|
@@ -83,7 +83,7 @@ export type CacheEntry = {
|
|
|
83
83
|
/**
|
|
84
84
|
* - Cache entry metadata
|
|
85
85
|
*/
|
|
86
|
-
metadata:
|
|
86
|
+
metadata: Object;
|
|
87
87
|
/**
|
|
88
88
|
* - Original URL
|
|
89
89
|
*/
|
|
@@ -8,7 +8,7 @@ export type CacheEntry = {
|
|
|
8
8
|
/**
|
|
9
9
|
* - Cache entry metadata
|
|
10
10
|
*/
|
|
11
|
-
metadata:
|
|
11
|
+
metadata: Object;
|
|
12
12
|
/**
|
|
13
13
|
* - Original URL
|
|
14
14
|
*/
|
|
@@ -39,7 +39,7 @@ export type CacheStorage = {
|
|
|
39
39
|
/**
|
|
40
40
|
* Store a response in the cache
|
|
41
41
|
*/
|
|
42
|
-
set: (arg0: string, arg1: Response, arg2:
|
|
42
|
+
set: (arg0: string, arg1: Response, arg2: Object) => Promise<void>;
|
|
43
43
|
/**
|
|
44
44
|
* Remove a cached response
|
|
45
45
|
*/
|
|
@@ -63,5 +63,5 @@ export type IDBVersionChangeEvent = {
|
|
|
63
63
|
/**
|
|
64
64
|
* - The transaction for database upgrade
|
|
65
65
|
*/
|
|
66
|
-
transaction?: IDBTransaction;
|
|
66
|
+
transaction?: IDBTransaction | undefined;
|
|
67
67
|
};
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export function storeResponseInCache(cacheKeyParams: {
|
|
12
12
|
url: string | URL;
|
|
13
|
-
headers?: object;
|
|
13
|
+
headers?: object | undefined;
|
|
14
14
|
}, response: Response, metadata: object): Promise<void>;
|
|
15
15
|
/**
|
|
16
16
|
* Get a cached response if available and valid
|
|
@@ -24,5 +24,5 @@ export function storeResponseInCache(cacheKeyParams: {
|
|
|
24
24
|
*/
|
|
25
25
|
export function getCachedResponse(cacheKeyParams: {
|
|
26
26
|
url: string | URL;
|
|
27
|
-
headers?: object;
|
|
27
|
+
headers?: object | undefined;
|
|
28
28
|
}): Promise<Response | import("./typedef").ResponseWithStale | null>;
|
|
@@ -6,11 +6,11 @@ export type HttpRequestOptions = {
|
|
|
6
6
|
/**
|
|
7
7
|
* HTTP method to use (GET, POST, etc.)
|
|
8
8
|
*/
|
|
9
|
-
method?: string;
|
|
9
|
+
method?: string | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* Parameters to add to the URL
|
|
12
12
|
*/
|
|
13
|
-
urlSearchParams?:
|
|
13
|
+
urlSearchParams?: Object | URLSearchParams | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Request body (for POST, PUT, etc.)
|
|
16
16
|
*/
|
|
@@ -18,39 +18,39 @@ export type HttpRequestOptions = {
|
|
|
18
18
|
/**
|
|
19
19
|
* HTTP headers as name-value pairs
|
|
20
20
|
*/
|
|
21
|
-
headers?:
|
|
21
|
+
headers?: Object | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Whether to include credentials
|
|
24
24
|
*/
|
|
25
|
-
withCredentials?: boolean;
|
|
25
|
+
withCredentials?: boolean | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Request timeout in milliseconds
|
|
28
28
|
*/
|
|
29
|
-
timeoutMs?: number;
|
|
29
|
+
timeoutMs?: number | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* Handler for abort/timeout control
|
|
32
32
|
*/
|
|
33
|
-
requestHandler?: Function;
|
|
33
|
+
requestHandler?: Function | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* CORS mode ('cors', 'no-cors', 'same-origin')
|
|
36
36
|
*/
|
|
37
|
-
mode?: string;
|
|
37
|
+
mode?: string | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* Cache mode ('default', 'no-cache', etc.)
|
|
40
40
|
*/
|
|
41
|
-
cache?: string;
|
|
41
|
+
cache?: string | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Redirect mode ('follow', 'error', 'manual')
|
|
44
44
|
*/
|
|
45
|
-
redirect?: string;
|
|
45
|
+
redirect?: string | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Referrer policy
|
|
48
48
|
*/
|
|
49
|
-
referrerPolicy?: string;
|
|
49
|
+
referrerPolicy?: string | undefined;
|
|
50
50
|
/**
|
|
51
51
|
* Enable or disabled automatic caching
|
|
52
52
|
*/
|
|
53
|
-
cacheEnabled?: boolean;
|
|
53
|
+
cacheEnabled?: boolean | undefined;
|
|
54
54
|
};
|
|
55
55
|
export type RequestHandlerParams = {
|
|
56
56
|
/**
|
|
@@ -75,43 +75,43 @@ export type JsonGetOptions = {
|
|
|
75
75
|
/**
|
|
76
76
|
* Parameters to add to the URL
|
|
77
77
|
*/
|
|
78
|
-
urlSearchParams?:
|
|
78
|
+
urlSearchParams?: Object | URLSearchParams | undefined;
|
|
79
79
|
/**
|
|
80
80
|
* HTTP headers as name-value pairs
|
|
81
81
|
*/
|
|
82
|
-
headers?:
|
|
82
|
+
headers?: Object | undefined;
|
|
83
83
|
/**
|
|
84
84
|
* Whether to include credentials
|
|
85
85
|
*/
|
|
86
|
-
withCredentials?: boolean;
|
|
86
|
+
withCredentials?: boolean | undefined;
|
|
87
87
|
/**
|
|
88
88
|
* Request timeout in milliseconds
|
|
89
89
|
*/
|
|
90
|
-
timeoutMs?: number;
|
|
90
|
+
timeoutMs?: number | undefined;
|
|
91
91
|
/**
|
|
92
92
|
* Handler for abort/timeout control
|
|
93
93
|
*/
|
|
94
|
-
requestHandler?: RequestHandler;
|
|
94
|
+
requestHandler?: RequestHandler | undefined;
|
|
95
95
|
/**
|
|
96
96
|
* CORS mode ('cors', 'no-cors', 'same-origin')
|
|
97
97
|
*/
|
|
98
|
-
mode?: string;
|
|
98
|
+
mode?: string | undefined;
|
|
99
99
|
/**
|
|
100
100
|
* Cache mode ('default', 'no-cache', etc.)
|
|
101
101
|
*/
|
|
102
|
-
cache?: string;
|
|
102
|
+
cache?: string | undefined;
|
|
103
103
|
/**
|
|
104
104
|
* Redirect mode ('follow', 'error', 'manual')
|
|
105
105
|
*/
|
|
106
|
-
redirect?: string;
|
|
106
|
+
redirect?: string | undefined;
|
|
107
107
|
/**
|
|
108
108
|
* Referrer policy
|
|
109
109
|
*/
|
|
110
|
-
referrerPolicy?: string;
|
|
110
|
+
referrerPolicy?: string | undefined;
|
|
111
111
|
/**
|
|
112
112
|
* Enable or disabled automatic caching
|
|
113
113
|
*/
|
|
114
|
-
cacheEnabled?: boolean;
|
|
114
|
+
cacheEnabled?: boolean | undefined;
|
|
115
115
|
};
|
|
116
116
|
export type JsonPostOptions = {
|
|
117
117
|
/**
|
|
@@ -125,43 +125,43 @@ export type JsonPostOptions = {
|
|
|
125
125
|
/**
|
|
126
126
|
* Parameters to add to the URL
|
|
127
127
|
*/
|
|
128
|
-
urlSearchParams?:
|
|
128
|
+
urlSearchParams?: Object | URLSearchParams | undefined;
|
|
129
129
|
/**
|
|
130
130
|
* HTTP headers as name-value pairs
|
|
131
131
|
*/
|
|
132
|
-
headers?:
|
|
132
|
+
headers?: Object | undefined;
|
|
133
133
|
/**
|
|
134
134
|
* Whether to include credentials
|
|
135
135
|
*/
|
|
136
|
-
withCredentials?: boolean;
|
|
136
|
+
withCredentials?: boolean | undefined;
|
|
137
137
|
/**
|
|
138
138
|
* Request timeout in milliseconds
|
|
139
139
|
*/
|
|
140
|
-
timeoutMs?: number;
|
|
140
|
+
timeoutMs?: number | undefined;
|
|
141
141
|
/**
|
|
142
142
|
* Handler for abort/timeout control
|
|
143
143
|
*/
|
|
144
|
-
requestHandler?: RequestHandler;
|
|
144
|
+
requestHandler?: RequestHandler | undefined;
|
|
145
145
|
/**
|
|
146
146
|
* CORS mode ('cors', 'no-cors', 'same-origin')
|
|
147
147
|
*/
|
|
148
|
-
mode?: string;
|
|
148
|
+
mode?: string | undefined;
|
|
149
149
|
/**
|
|
150
150
|
* Cache mode ('default', 'no-cache', etc.)
|
|
151
151
|
*/
|
|
152
|
-
cache?: string;
|
|
152
|
+
cache?: string | undefined;
|
|
153
153
|
/**
|
|
154
154
|
* Redirect mode ('follow', 'error', 'manual')
|
|
155
155
|
*/
|
|
156
|
-
redirect?: string;
|
|
156
|
+
redirect?: string | undefined;
|
|
157
157
|
/**
|
|
158
158
|
* Referrer policy
|
|
159
159
|
*/
|
|
160
|
-
referrerPolicy?: string;
|
|
160
|
+
referrerPolicy?: string | undefined;
|
|
161
161
|
/**
|
|
162
162
|
* Enable or disabled automatic caching
|
|
163
163
|
*/
|
|
164
|
-
cacheEnabled?: boolean;
|
|
164
|
+
cacheEnabled?: boolean | undefined;
|
|
165
165
|
};
|
|
166
166
|
export type StaleInfo = {
|
|
167
167
|
/**
|
|
@@ -37,7 +37,7 @@ export default class AudioScene extends SceneBase {
|
|
|
37
37
|
defineMemorySource({ label, url, config }: {
|
|
38
38
|
label: string;
|
|
39
39
|
url: string;
|
|
40
|
-
config?:
|
|
40
|
+
config?: object | undefined;
|
|
41
41
|
}): void;
|
|
42
42
|
/**
|
|
43
43
|
* Get a source that can be used to play the audio once
|
|
@@ -91,7 +91,7 @@ export type SourceConfig = object;
|
|
|
91
91
|
export type MemorySource = {
|
|
92
92
|
label: string;
|
|
93
93
|
audioLoader: AudioLoader;
|
|
94
|
-
config?:
|
|
94
|
+
config?: object | undefined;
|
|
95
95
|
};
|
|
96
96
|
import SceneBase from '../base/SceneBase.svelte.js';
|
|
97
97
|
import AudioLoader from './AudioLoader.svelte.js';
|
|
@@ -7,9 +7,9 @@ export default class SceneBase {
|
|
|
7
7
|
/**
|
|
8
8
|
* Get the array of sources managed by this scene
|
|
9
9
|
*
|
|
10
|
-
* @returns {Array} Array of source objects
|
|
10
|
+
* @returns {Array<object>} Array of source objects
|
|
11
11
|
*/
|
|
12
|
-
get sources():
|
|
12
|
+
get sources(): Array<object>;
|
|
13
13
|
/**
|
|
14
14
|
* Extract the loader from a source object
|
|
15
15
|
*
|
|
@@ -57,8 +57,8 @@ export default class SceneBase {
|
|
|
57
57
|
* @returns {Function} returns.abort - Function to abort preloading
|
|
58
58
|
*/
|
|
59
59
|
preload({ timeoutMs, onProgress }?: {
|
|
60
|
-
timeoutMs?: number;
|
|
61
|
-
onProgress?: Function;
|
|
60
|
+
timeoutMs?: number | undefined;
|
|
61
|
+
onProgress?: Function | undefined;
|
|
62
62
|
}): object;
|
|
63
63
|
destroy(): void;
|
|
64
64
|
#private;
|
|
@@ -121,7 +121,7 @@ export default class SceneBase {
|
|
|
121
121
|
/**
|
|
122
122
|
* Get the array of sources managed by this scene
|
|
123
123
|
*
|
|
124
|
-
* @returns {Array} Array of source objects
|
|
124
|
+
* @returns {Array<object>} Array of source objects
|
|
125
125
|
*/
|
|
126
126
|
get sources() {
|
|
127
127
|
throw new Error('Subclass must implement sources getter');
|
|
@@ -9,7 +9,7 @@ export default class ImageLoader extends NetworkLoader {
|
|
|
9
9
|
*/
|
|
10
10
|
constructor(imageSource: import("../../../config/typedef.js").ImageSource);
|
|
11
11
|
get imageMeta(): import("./typedef.js").ImageMeta;
|
|
12
|
-
get url(): string;
|
|
12
|
+
get url(): string | null;
|
|
13
13
|
#private;
|
|
14
14
|
}
|
|
15
15
|
export type ImageMeta = import("./typedef.js").ImageMeta;
|
|
@@ -4,7 +4,7 @@ export default class ImageVariantsLoader {
|
|
|
4
4
|
* @param {ImageMeta[]} imageSource
|
|
5
5
|
*/
|
|
6
6
|
constructor(imageSource: ImageMeta[], { devicePixelRatio }?: {
|
|
7
|
-
devicePixelRatio?: number;
|
|
7
|
+
devicePixelRatio?: number | undefined;
|
|
8
8
|
});
|
|
9
9
|
/**
|
|
10
10
|
* Set new optimal image variant or keep current
|
|
@@ -15,12 +15,12 @@ export default class ImageVariantsLoader {
|
|
|
15
15
|
* @param {'cover'|'contain'|'fill'} [params.fit='contain'] Fit mode
|
|
16
16
|
*/
|
|
17
17
|
updateOptimalImageMeta({ containerWidth, containerHeight, fit }: {
|
|
18
|
-
containerWidth?: number;
|
|
19
|
-
containerHeight?: number;
|
|
20
|
-
fit?: "cover" | "contain" |
|
|
18
|
+
containerWidth?: number | undefined;
|
|
19
|
+
containerHeight?: number | undefined;
|
|
20
|
+
fit?: "fill" | "cover" | "contain" | undefined;
|
|
21
21
|
}): void;
|
|
22
22
|
get loaded(): boolean;
|
|
23
|
-
get variant(): import("../../../config/typedef.js").ImageMeta;
|
|
23
|
+
get variant(): import("../../../config/typedef.js").ImageMeta | null;
|
|
24
24
|
/**
|
|
25
25
|
* Get object URL that can be used as src parameter of an HTML image
|
|
26
26
|
*
|
|
@@ -18,8 +18,8 @@ export function toSingleImageMeta(imageSource: import("../../../../config/typede
|
|
|
18
18
|
* @returns {number} Effective width needed
|
|
19
19
|
*/
|
|
20
20
|
export function calculateEffectiveWidth({ containerWidth, containerHeight, imageAspectRatio, fit }: {
|
|
21
|
-
containerWidth?: number;
|
|
22
|
-
containerHeight?: number;
|
|
21
|
+
containerWidth?: number | undefined;
|
|
22
|
+
containerHeight?: number | undefined;
|
|
23
23
|
imageAspectRatio: number;
|
|
24
|
-
fit?: "cover" | "contain" |
|
|
24
|
+
fit?: "fill" | "cover" | "contain" | undefined;
|
|
25
25
|
}): number;
|
|
@@ -30,7 +30,7 @@ export default class ConfigPlugin {
|
|
|
30
30
|
* @returns {Promise<Object|undefined>}
|
|
31
31
|
* Resolved config object, or undefined to use currentConfig as-is
|
|
32
32
|
*/
|
|
33
|
-
resolveServiceConfig(serviceName: string, serviceEntry: ServiceEntry, currentConfig: any): Promise<
|
|
33
|
+
resolveServiceConfig(serviceName: string, serviceEntry: ServiceEntry, currentConfig: any): Promise<Object | undefined>;
|
|
34
34
|
/**
|
|
35
35
|
* Replace the entire configuration object and clean up unused configs
|
|
36
36
|
*
|
|
@@ -34,11 +34,21 @@ export class ServiceBase extends EventEmitter {
|
|
|
34
34
|
/**
|
|
35
35
|
* Configure the service with configuration
|
|
36
36
|
*
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {Object<string,any>|null} [config={}]
|
|
38
38
|
*
|
|
39
39
|
* @returns {Promise<boolean>} True if configuration succeeded
|
|
40
40
|
*/
|
|
41
|
-
configure(config?:
|
|
41
|
+
configure(config?: {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
} | null): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Get the last applied config
|
|
46
|
+
*
|
|
47
|
+
* @returns {Object<string,any>} config
|
|
48
|
+
*/
|
|
49
|
+
get lastConfig(): {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
};
|
|
42
52
|
/**
|
|
43
53
|
* Start the service
|
|
44
54
|
*
|
|
@@ -152,7 +162,7 @@ export class ServiceBase extends EventEmitter {
|
|
|
152
162
|
*
|
|
153
163
|
* @returns {Promise<Object>} Additional health information
|
|
154
164
|
*/
|
|
155
|
-
protected _healthCheck(): Promise<
|
|
165
|
+
protected _healthCheck(): Promise<Object>;
|
|
156
166
|
/**
|
|
157
167
|
* Set the service state and emit event
|
|
158
168
|
*
|