@soleil-se/app-util 5.12.1 → 5.12.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/CHANGELOG.md +8 -0
- package/client/index.d.ts +3 -3
- package/client/prevent-default/index.d.ts +1 -1
- package/client/svelte/3/index.d.ts +1 -1
- package/client/svelte/4/index.d.ts +21 -21
- package/client/svelte/5/index.d.ts +40 -18
- package/client/svelte/5/index.js +15 -9
- package/client/svelte/index.d.ts +21 -21
- package/common/index.d.ts +81 -81
- package/package.json +2 -2
- package/server/app-data/index.d.ts +84 -84
- package/server/global-app-data/index.d.ts +84 -84
- package/server/index.d.ts +52 -52
- package/server/svelte/3/index.d.ts +1 -1
- package/server/svelte/4/index.d.ts +9 -9
- package/server/svelte/5/index.d.ts +9 -7
- package/server/svelte/5/index.js +3 -2
- package/server/svelte/index.d.ts +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [5.12.3] - 2025-12-03
|
|
11
|
+
|
|
12
|
+
- Even better type definitions for Svelte render functions.
|
|
13
|
+
|
|
14
|
+
## [5.12.2] - 2025-12-03
|
|
15
|
+
|
|
16
|
+
- Better type definitions for Svelte render functions.
|
|
17
|
+
|
|
10
18
|
## [5.12.1] - 2025-10-15
|
|
11
19
|
|
|
12
20
|
- Return identifier for Node instances in `toString` function in `app-data` and `global-app-data`.
|
package/client/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as preventDefault } from "./prevent-default";
|
|
2
|
-
export { getUrlParam, getUrlParams, setUrlParams, updateUrlParams, clearUrlParams } from "./url-params";
|
|
3
|
-
export { default as fetchJson, FetchError } from "./fetch-json";
|
|
1
|
+
export { default as preventDefault } from "./prevent-default";
|
|
2
|
+
export { getUrlParam, getUrlParams, setUrlParams, updateUrlParams, clearUrlParams } from "./url-params";
|
|
3
|
+
export { default as fetchJson, FetchError } from "./fetch-json";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function preventDefault(fn: any): (...args: any[]) => any;
|
|
1
|
+
export default function preventDefault(fn: any): (...args: any[]) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { render } from "../4";
|
|
1
|
+
export { render } from "../4";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/** @typedef {import('svelte').SvelteComponent} Component */
|
|
2
|
-
/**
|
|
3
|
-
* Renders a client side Svelte application.
|
|
4
|
-
* @param {Component<any>} App Svelte app root component.
|
|
5
|
-
* @param {object} [settings={}] Settings object.
|
|
6
|
-
* @param {HTMLElement} [settings.target] Target where app should be mounted.
|
|
7
|
-
* @param {Record<string, any>} [settings.props] Root component props.
|
|
8
|
-
* @param {boolean} [settings.hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing
|
|
9
|
-
* DOM (usually from server-side rendering) rather than creating new elements. By default the app
|
|
10
|
-
* will hydrate when the target has any child nodes.
|
|
11
|
-
* @param {boolean} [settings.intro=false] If true, will play transitions on initial render,
|
|
12
|
-
* rather than waiting for subsequent state changes.
|
|
13
|
-
* @return {Component} Initialized Svelte component.
|
|
14
|
-
*/
|
|
15
|
-
export function render(App: any, { target, props, intro, hydrate, }?: {
|
|
16
|
-
target?: HTMLElement;
|
|
17
|
-
props?: Record<string, any>;
|
|
18
|
-
hydrate?: boolean;
|
|
19
|
-
intro?: boolean;
|
|
20
|
-
}): Component;
|
|
21
|
-
export type Component = import('svelte').SvelteComponent;
|
|
1
|
+
/** @typedef {import('svelte').SvelteComponent} Component */
|
|
2
|
+
/**
|
|
3
|
+
* Renders a client side Svelte application.
|
|
4
|
+
* @param {Component<any>} App Svelte app root component.
|
|
5
|
+
* @param {object} [settings={}] Settings object.
|
|
6
|
+
* @param {HTMLElement} [settings.target] Target where app should be mounted.
|
|
7
|
+
* @param {Record<string, any>} [settings.props] Root component props.
|
|
8
|
+
* @param {boolean} [settings.hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing
|
|
9
|
+
* DOM (usually from server-side rendering) rather than creating new elements. By default the app
|
|
10
|
+
* will hydrate when the target has any child nodes.
|
|
11
|
+
* @param {boolean} [settings.intro=false] If true, will play transitions on initial render,
|
|
12
|
+
* rather than waiting for subsequent state changes.
|
|
13
|
+
* @return {Component} Initialized Svelte component.
|
|
14
|
+
*/
|
|
15
|
+
export function render(App: any, { target, props, intro, hydrate, }?: {
|
|
16
|
+
target?: HTMLElement;
|
|
17
|
+
props?: Record<string, any>;
|
|
18
|
+
hydrate?: boolean;
|
|
19
|
+
intro?: boolean;
|
|
20
|
+
}): Component;
|
|
21
|
+
export type Component = import('svelte').SvelteComponent;
|
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @
|
|
4
|
-
* @
|
|
5
|
-
* @
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
/**
|
|
3
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
4
|
+
* @typedef {object} RenderSettings
|
|
5
|
+
* @property {HTMLElement} [target] Target where app should be mounted.
|
|
6
|
+
* @property {import('svelte').ComponentProps<TComponent>} [props] Root component props.
|
|
7
|
+
* @property {boolean} [hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing DOM
|
|
8
|
+
* (usually from server-side rendering) rather than creating new elements. By default the app will
|
|
9
|
+
* hydrate when the target has any child nodes.
|
|
10
|
+
* @property {boolean} [intro=false] If true, will play transitions on initial render, rather than
|
|
11
|
+
* waiting for subsequent state changes.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Renders a client side Svelte application.
|
|
15
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
16
|
+
* @param {TComponent} App Svelte app root component.
|
|
17
|
+
* @param {RenderSettings<TComponent>} [settings={}] Settings object.
|
|
18
|
+
*/
|
|
19
|
+
export function render<TComponent extends import("svelte").Component<any, any, string>>(App: TComponent, { target, props, hydrate, intro, }?: RenderSettings<TComponent>): void;
|
|
20
|
+
export type RenderSettings<TComponent extends import("svelte").Component<any, any, string>> = {
|
|
21
|
+
/**
|
|
22
|
+
* Target where app should be mounted.
|
|
23
|
+
*/
|
|
24
|
+
target?: HTMLElement;
|
|
25
|
+
/**
|
|
26
|
+
* Root component props.
|
|
27
|
+
*/
|
|
28
|
+
props?: import('svelte').ComponentProps<TComponent>;
|
|
29
|
+
/**
|
|
30
|
+
* Instructs Svelte to upgrade existing DOM
|
|
31
|
+
* (usually from server-side rendering) rather than creating new elements. By default the app will
|
|
32
|
+
* hydrate when the target has any child nodes.
|
|
33
|
+
*/
|
|
34
|
+
hydrate?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If true, will play transitions on initial render, rather than
|
|
37
|
+
* waiting for subsequent state changes.
|
|
38
|
+
*/
|
|
39
|
+
intro?: boolean;
|
|
40
|
+
};
|
package/client/svelte/5/index.js
CHANGED
|
@@ -3,17 +3,23 @@ import { mount as svelteMount, hydrate as svelteHydrate } from 'svelte';
|
|
|
3
3
|
|
|
4
4
|
import { setAppProps } from '../../../common';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
8
|
+
* @typedef {object} RenderSettings
|
|
9
|
+
* @property {HTMLElement} [target] Target where app should be mounted.
|
|
10
|
+
* @property {import('svelte').ComponentProps<TComponent>} [props] Root component props.
|
|
11
|
+
* @property {boolean} [hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing DOM
|
|
12
|
+
* (usually from server-side rendering) rather than creating new elements. By default the app will
|
|
13
|
+
* hydrate when the target has any child nodes.
|
|
14
|
+
* @property {boolean} [intro=false] If true, will play transitions on initial render, rather than
|
|
15
|
+
* waiting for subsequent state changes.
|
|
16
|
+
*/
|
|
17
|
+
|
|
6
18
|
/**
|
|
7
19
|
* Renders a client side Svelte application.
|
|
8
|
-
* @
|
|
9
|
-
* @param {
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {Record<string, any>} [settings.props] Root component props.
|
|
12
|
-
* @param {boolean} [settings.hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing
|
|
13
|
-
* DOM (usually from server-side rendering) rather than creating new elements. By default the app
|
|
14
|
-
* will hydrate when the target has any child nodes.
|
|
15
|
-
* @param {boolean} [settings.intro=false] If true, will play transitions on initial render,
|
|
16
|
-
* rather than waiting for subsequent state changes.
|
|
20
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
21
|
+
* @param {TComponent} App Svelte app root component.
|
|
22
|
+
* @param {RenderSettings<TComponent>} [settings={}] Settings object.
|
|
17
23
|
*/
|
|
18
24
|
export function render(App, {
|
|
19
25
|
target,
|
package/client/svelte/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Renders a client side Svelte 3 or 4 application.
|
|
3
|
-
* @deprecated Use rendering function for specific Svelte version instead.
|
|
4
|
-
* `import { render } from '@soleil-api/webapp-util/client/svelte/{3|4|5}';`
|
|
5
|
-
* @param {import('svelte').SvelteComponent<any>} App Svelte app root component.
|
|
6
|
-
* @param {object} [settings={}] Settings object.
|
|
7
|
-
* @param {string} [settings.target] Target where app should be mounted.
|
|
8
|
-
* @param {string} [settings.props] Root component props.
|
|
9
|
-
* @param {boolean} [settings.hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing
|
|
10
|
-
* DOM (usually from server-side rendering) rather than creating new elements. By default the app
|
|
11
|
-
* will hydrate when the target has any child nodes.
|
|
12
|
-
* @param {boolean} [settings.intro=false] If true, will play transitions on initial render,
|
|
13
|
-
* rather than waiting for subsequent state changes.
|
|
14
|
-
* @return {import('svelte').SvelteComponent} Initialized Svelte component.
|
|
15
|
-
*/
|
|
16
|
-
export function render(App: import('svelte').SvelteComponent<any>, settings?: {
|
|
17
|
-
target?: string;
|
|
18
|
-
props?: string;
|
|
19
|
-
hydrate?: boolean;
|
|
20
|
-
intro?: boolean;
|
|
21
|
-
}): import('svelte').SvelteComponent;
|
|
1
|
+
/**
|
|
2
|
+
* Renders a client side Svelte 3 or 4 application.
|
|
3
|
+
* @deprecated Use rendering function for specific Svelte version instead.
|
|
4
|
+
* `import { render } from '@soleil-api/webapp-util/client/svelte/{3|4|5}';`
|
|
5
|
+
* @param {import('svelte').SvelteComponent<any>} App Svelte app root component.
|
|
6
|
+
* @param {object} [settings={}] Settings object.
|
|
7
|
+
* @param {string} [settings.target] Target where app should be mounted.
|
|
8
|
+
* @param {string} [settings.props] Root component props.
|
|
9
|
+
* @param {boolean} [settings.hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing
|
|
10
|
+
* DOM (usually from server-side rendering) rather than creating new elements. By default the app
|
|
11
|
+
* will hydrate when the target has any child nodes.
|
|
12
|
+
* @param {boolean} [settings.intro=false] If true, will play transitions on initial render,
|
|
13
|
+
* rather than waiting for subsequent state changes.
|
|
14
|
+
* @return {import('svelte').SvelteComponent} Initialized Svelte component.
|
|
15
|
+
*/
|
|
16
|
+
export function render(App: import('svelte').SvelteComponent<any>, settings?: {
|
|
17
|
+
target?: string;
|
|
18
|
+
props?: string;
|
|
19
|
+
hydrate?: boolean;
|
|
20
|
+
intro?: boolean;
|
|
21
|
+
}): import('svelte').SvelteComponent;
|
package/common/index.d.ts
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get a prefixed namespace unique for app.
|
|
3
|
-
* @param {string} [prefix='app']
|
|
4
|
-
* @return {string} - Prefixed namespace.
|
|
5
|
-
*/
|
|
6
|
-
export function getNamespace(prefix?: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* Generate a unique identifier with a random UUID without dashes.
|
|
9
|
-
* @param {string} prefix Prefix for the identifier.
|
|
10
|
-
* @returns {string} Unique identifier.
|
|
11
|
-
*/
|
|
12
|
-
export function generateId(prefix?: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Stringify an object to a query string compatible with Sitevision.
|
|
15
|
-
* @param {Object} params Object with parameters to stringify.
|
|
16
|
-
* @param {Object} [options] Optional options.
|
|
17
|
-
* @param {Boolean} [options.addQueryPrefix = false] If a leading ? should be added to the string.
|
|
18
|
-
* @returns Stringified parameters.
|
|
19
|
-
*/
|
|
20
|
-
export function stringifyParams(params?: any, { addQueryPrefix }?: {
|
|
21
|
-
addQueryPrefix?: boolean;
|
|
22
|
-
}): string;
|
|
23
|
-
/**
|
|
24
|
-
* Parse an URL or URI to an object containing its query parameters.
|
|
25
|
-
* @param {String} url URL or URI to be parsed, must start with or contain "?".
|
|
26
|
-
* @returns Object with parsed parameters.
|
|
27
|
-
*/
|
|
28
|
-
export function parseParams(url?: string): {};
|
|
29
|
-
/**
|
|
30
|
-
* Get URI for a route, same as `getStandaloneUrl` in Sitevision router.
|
|
31
|
-
* @param {string} route A route.
|
|
32
|
-
* @param {object} params Query parameters.
|
|
33
|
-
* @returns {string} URI for route.
|
|
34
|
-
*/
|
|
35
|
-
export function getRouteUri(route?: string, params?: object): string;
|
|
36
|
-
/**
|
|
37
|
-
* Get URI for a view, same as `getUrl` in Sitevision router.
|
|
38
|
-
* @deprecated Not used in WebApps 2.
|
|
39
|
-
* @param {string} route A route.
|
|
40
|
-
* @returns {string} URI for view.
|
|
41
|
-
*/
|
|
42
|
-
export function getViewUri(route?: string, params?: any): string;
|
|
43
|
-
/**
|
|
44
|
-
* Get URI for a resource.
|
|
45
|
-
* @param {string} resource A resource.
|
|
46
|
-
* @returns {string} URI for a resource.
|
|
47
|
-
*/
|
|
48
|
-
export function getResourceUri(resource?: string): string;
|
|
49
|
-
export function setAppProps(data: any): void;
|
|
50
|
-
/**
|
|
51
|
-
* Get appData value or object that is passed to app when rendering.
|
|
52
|
-
* @export
|
|
53
|
-
* @param {string} [key] - Key for value.
|
|
54
|
-
* @return {*|object} - Value or object.
|
|
55
|
-
*/
|
|
56
|
-
export function getAppProps(key?: string): any | object;
|
|
57
|
-
/**
|
|
58
|
-
* If the current code is running on the server.
|
|
59
|
-
* @constant {boolean}
|
|
60
|
-
*/
|
|
61
|
-
export const isServer: any;
|
|
62
|
-
/**
|
|
63
|
-
* If the current code is running in the browser.
|
|
64
|
-
* @constant {boolean}
|
|
65
|
-
*/
|
|
66
|
-
export const isBrowser: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* DOM friendly unique identifier for the WebApp.
|
|
69
|
-
* @constant {string}
|
|
70
|
-
*/
|
|
71
|
-
export const appId: string;
|
|
72
|
-
/**
|
|
73
|
-
* If the WebApp is running in offline mode or not.
|
|
74
|
-
* @constant {boolean}
|
|
75
|
-
*/
|
|
76
|
-
export const isOffline: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* If the WebApp is running in online mode or not.
|
|
79
|
-
* @constant {boolean}
|
|
80
|
-
*/
|
|
81
|
-
export const isOnline: boolean;
|
|
1
|
+
/**
|
|
2
|
+
* Get a prefixed namespace unique for app.
|
|
3
|
+
* @param {string} [prefix='app']
|
|
4
|
+
* @return {string} - Prefixed namespace.
|
|
5
|
+
*/
|
|
6
|
+
export function getNamespace(prefix?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Generate a unique identifier with a random UUID without dashes.
|
|
9
|
+
* @param {string} prefix Prefix for the identifier.
|
|
10
|
+
* @returns {string} Unique identifier.
|
|
11
|
+
*/
|
|
12
|
+
export function generateId(prefix?: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Stringify an object to a query string compatible with Sitevision.
|
|
15
|
+
* @param {Object} params Object with parameters to stringify.
|
|
16
|
+
* @param {Object} [options] Optional options.
|
|
17
|
+
* @param {Boolean} [options.addQueryPrefix = false] If a leading ? should be added to the string.
|
|
18
|
+
* @returns Stringified parameters.
|
|
19
|
+
*/
|
|
20
|
+
export function stringifyParams(params?: any, { addQueryPrefix }?: {
|
|
21
|
+
addQueryPrefix?: boolean;
|
|
22
|
+
}): string;
|
|
23
|
+
/**
|
|
24
|
+
* Parse an URL or URI to an object containing its query parameters.
|
|
25
|
+
* @param {String} url URL or URI to be parsed, must start with or contain "?".
|
|
26
|
+
* @returns Object with parsed parameters.
|
|
27
|
+
*/
|
|
28
|
+
export function parseParams(url?: string): {};
|
|
29
|
+
/**
|
|
30
|
+
* Get URI for a route, same as `getStandaloneUrl` in Sitevision router.
|
|
31
|
+
* @param {string} route A route.
|
|
32
|
+
* @param {object} params Query parameters.
|
|
33
|
+
* @returns {string} URI for route.
|
|
34
|
+
*/
|
|
35
|
+
export function getRouteUri(route?: string, params?: object): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get URI for a view, same as `getUrl` in Sitevision router.
|
|
38
|
+
* @deprecated Not used in WebApps 2.
|
|
39
|
+
* @param {string} route A route.
|
|
40
|
+
* @returns {string} URI for view.
|
|
41
|
+
*/
|
|
42
|
+
export function getViewUri(route?: string, params?: any): string;
|
|
43
|
+
/**
|
|
44
|
+
* Get URI for a resource.
|
|
45
|
+
* @param {string} resource A resource.
|
|
46
|
+
* @returns {string} URI for a resource.
|
|
47
|
+
*/
|
|
48
|
+
export function getResourceUri(resource?: string): string;
|
|
49
|
+
export function setAppProps(data: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* Get appData value or object that is passed to app when rendering.
|
|
52
|
+
* @export
|
|
53
|
+
* @param {string} [key] - Key for value.
|
|
54
|
+
* @return {*|object} - Value or object.
|
|
55
|
+
*/
|
|
56
|
+
export function getAppProps(key?: string): any | object;
|
|
57
|
+
/**
|
|
58
|
+
* If the current code is running on the server.
|
|
59
|
+
* @constant {boolean}
|
|
60
|
+
*/
|
|
61
|
+
export const isServer: any;
|
|
62
|
+
/**
|
|
63
|
+
* If the current code is running in the browser.
|
|
64
|
+
* @constant {boolean}
|
|
65
|
+
*/
|
|
66
|
+
export const isBrowser: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* DOM friendly unique identifier for the WebApp.
|
|
69
|
+
* @constant {string}
|
|
70
|
+
*/
|
|
71
|
+
export const appId: string;
|
|
72
|
+
/**
|
|
73
|
+
* If the WebApp is running in offline mode or not.
|
|
74
|
+
* @constant {boolean}
|
|
75
|
+
*/
|
|
76
|
+
export const isOffline: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* If the WebApp is running in online mode or not.
|
|
79
|
+
* @constant {boolean}
|
|
80
|
+
*/
|
|
81
|
+
export const isOnline: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/app-util",
|
|
3
|
-
"version": "5.12.
|
|
3
|
+
"version": "5.12.3",
|
|
4
4
|
"description": "Utility functions for WebApps, RESTApps and Widgets in Sitevision.",
|
|
5
5
|
"main": "./common/index.js",
|
|
6
6
|
"author": "Soleil AB",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"create-type-definitions": "node ../../utils/createTypeDefinitions.js ./common/index.js ./client/index.js ./client/svelte/index.js ./client/svelte/3/index.js ./client/svelte/4/index.js ./client/svelte/5/index.js ./server/index.js ./server/svelte/index.js ./server/svelte/3/index.js ./server/svelte/4/index.js ./server/svelte/5/index.js ./server/app-data/index.js ./server/global-app-data/index.js"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "9b1f44728b2ba84db68acdad31699822067ced13"
|
|
29
29
|
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
export default appData;
|
|
2
|
-
declare namespace appData {
|
|
3
|
-
/**
|
|
4
|
-
* Get a value from app data, same as get in \@sitevision/api/server/appData.
|
|
5
|
-
* @param {string} key - The key of app data to retrieve.
|
|
6
|
-
* @param {...string} [properties] - The keys of the properties to retrieve from a JCR Node.
|
|
7
|
-
* @returns {unknown} The value of the app data or a properties of a JCR Node.
|
|
8
|
-
*/
|
|
9
|
-
function get(key: string, ...properties?: string[]): unknown;
|
|
10
|
-
/**
|
|
11
|
-
* Get a value from app data as an array, same as getArray in \@sitevision/api/server/appData.
|
|
12
|
-
* @param {string} key - The key of app data to retrieve.
|
|
13
|
-
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[] | string[]} An array of JCR
|
|
14
|
-
* Nodes for list components or value wrapped in an array for single type components.
|
|
15
|
-
*/
|
|
16
|
-
function getArray(key: string): string[] | import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
17
|
-
/**
|
|
18
|
-
* Get a string value from app data.
|
|
19
|
-
* @param {string} key - The key of app data to retrieve.
|
|
20
|
-
* @returns {string | undefined} The string value or undefined if not set.
|
|
21
|
-
*/
|
|
22
|
-
function getString(key: string): string | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Get a boolean value from app data.
|
|
25
|
-
* @param {string} key - The key of app data to retrieve.
|
|
26
|
-
* @returns {boolean | undefined} The boolean value or undefined if not set.
|
|
27
|
-
*/
|
|
28
|
-
function getBoolean(key: string): boolean | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Get a number value from app data.
|
|
31
|
-
* @param {string} key - The key of app data to retrieve.
|
|
32
|
-
* @returns {number | undefined} The number value, undefined if not set or not a number.
|
|
33
|
-
*/
|
|
34
|
-
function getNumber(key: string): number | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Get an array of nodes from app data.
|
|
37
|
-
* @param {string} key - The key of app data to retrieve.
|
|
38
|
-
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[]} The array of nodes or an
|
|
39
|
-
* empty array if not set.
|
|
40
|
-
*/
|
|
41
|
-
function getNodes(key: string): import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
42
|
-
/**
|
|
43
|
-
* Get an array of strings from app data.
|
|
44
|
-
* @param {string} key - The key of app data to retrieve.
|
|
45
|
-
* @returns {string[]} The array of strings or an empty array if not set.
|
|
46
|
-
*/
|
|
47
|
-
function getStrings(key: string): string[];
|
|
48
|
-
/**
|
|
49
|
-
* Get a JCR Node from app data.
|
|
50
|
-
* @param {string} key - The key of the property to retrieve.
|
|
51
|
-
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node | undefined} The JCR Node or
|
|
52
|
-
* undefined if not set.
|
|
53
|
-
*/
|
|
54
|
-
function getNode(key: string): import("@sitevision/api/types/javax/jcr/Node").Node;
|
|
55
|
-
/**
|
|
56
|
-
* Get a string property from a JCR Node referenced in app data.
|
|
57
|
-
* @param {string} key - The key of the app data value.
|
|
58
|
-
* @param {string} property - The property to retrieve from the node.
|
|
59
|
-
* @returns {string | undefined} The string property value or undefined if not set.
|
|
60
|
-
*/
|
|
61
|
-
function getStringProperty(key: string, property: string): string | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Get a string array property or a single string wrapped in an array from a JCR Node referenced
|
|
64
|
-
* in app data.
|
|
65
|
-
* @param {string} key - The key of app data to retrieve.
|
|
66
|
-
* @param {string} property - The property to retrieve from the node.
|
|
67
|
-
* @returns {string[]} The array of strings or an empty array if not set.
|
|
68
|
-
*/
|
|
69
|
-
function getStringsProperty(key: string, property: string): string[];
|
|
70
|
-
/**
|
|
71
|
-
* Get a boolean property from a JCR Node referenced in app data.
|
|
72
|
-
* @param {string} key - The key of the app data value.
|
|
73
|
-
* @param {string} property - The property to retrieve from the node.
|
|
74
|
-
* @returns {boolean | undefined} The boolean property value or undefined if not set.
|
|
75
|
-
*/
|
|
76
|
-
function getBooleanProperty(key: string, property: string): boolean | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Get a number property from a JCR Node referenced in app data.
|
|
79
|
-
* @param {string} key - The key of the app data value.
|
|
80
|
-
* @param {string} property - The property to retrieve from the node.
|
|
81
|
-
* @returns {number | undefined} The number property value, undefined if not set or not a number.
|
|
82
|
-
*/
|
|
83
|
-
function getNumberProperty(key: string, property: string): number | undefined;
|
|
84
|
-
}
|
|
1
|
+
export default appData;
|
|
2
|
+
declare namespace appData {
|
|
3
|
+
/**
|
|
4
|
+
* Get a value from app data, same as get in \@sitevision/api/server/appData.
|
|
5
|
+
* @param {string} key - The key of app data to retrieve.
|
|
6
|
+
* @param {...string} [properties] - The keys of the properties to retrieve from a JCR Node.
|
|
7
|
+
* @returns {unknown} The value of the app data or a properties of a JCR Node.
|
|
8
|
+
*/
|
|
9
|
+
function get(key: string, ...properties?: string[]): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Get a value from app data as an array, same as getArray in \@sitevision/api/server/appData.
|
|
12
|
+
* @param {string} key - The key of app data to retrieve.
|
|
13
|
+
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[] | string[]} An array of JCR
|
|
14
|
+
* Nodes for list components or value wrapped in an array for single type components.
|
|
15
|
+
*/
|
|
16
|
+
function getArray(key: string): string[] | import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
17
|
+
/**
|
|
18
|
+
* Get a string value from app data.
|
|
19
|
+
* @param {string} key - The key of app data to retrieve.
|
|
20
|
+
* @returns {string | undefined} The string value or undefined if not set.
|
|
21
|
+
*/
|
|
22
|
+
function getString(key: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get a boolean value from app data.
|
|
25
|
+
* @param {string} key - The key of app data to retrieve.
|
|
26
|
+
* @returns {boolean | undefined} The boolean value or undefined if not set.
|
|
27
|
+
*/
|
|
28
|
+
function getBoolean(key: string): boolean | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Get a number value from app data.
|
|
31
|
+
* @param {string} key - The key of app data to retrieve.
|
|
32
|
+
* @returns {number | undefined} The number value, undefined if not set or not a number.
|
|
33
|
+
*/
|
|
34
|
+
function getNumber(key: string): number | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Get an array of nodes from app data.
|
|
37
|
+
* @param {string} key - The key of app data to retrieve.
|
|
38
|
+
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[]} The array of nodes or an
|
|
39
|
+
* empty array if not set.
|
|
40
|
+
*/
|
|
41
|
+
function getNodes(key: string): import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
42
|
+
/**
|
|
43
|
+
* Get an array of strings from app data.
|
|
44
|
+
* @param {string} key - The key of app data to retrieve.
|
|
45
|
+
* @returns {string[]} The array of strings or an empty array if not set.
|
|
46
|
+
*/
|
|
47
|
+
function getStrings(key: string): string[];
|
|
48
|
+
/**
|
|
49
|
+
* Get a JCR Node from app data.
|
|
50
|
+
* @param {string} key - The key of the property to retrieve.
|
|
51
|
+
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node | undefined} The JCR Node or
|
|
52
|
+
* undefined if not set.
|
|
53
|
+
*/
|
|
54
|
+
function getNode(key: string): import("@sitevision/api/types/javax/jcr/Node").Node;
|
|
55
|
+
/**
|
|
56
|
+
* Get a string property from a JCR Node referenced in app data.
|
|
57
|
+
* @param {string} key - The key of the app data value.
|
|
58
|
+
* @param {string} property - The property to retrieve from the node.
|
|
59
|
+
* @returns {string | undefined} The string property value or undefined if not set.
|
|
60
|
+
*/
|
|
61
|
+
function getStringProperty(key: string, property: string): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Get a string array property or a single string wrapped in an array from a JCR Node referenced
|
|
64
|
+
* in app data.
|
|
65
|
+
* @param {string} key - The key of app data to retrieve.
|
|
66
|
+
* @param {string} property - The property to retrieve from the node.
|
|
67
|
+
* @returns {string[]} The array of strings or an empty array if not set.
|
|
68
|
+
*/
|
|
69
|
+
function getStringsProperty(key: string, property: string): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Get a boolean property from a JCR Node referenced in app data.
|
|
72
|
+
* @param {string} key - The key of the app data value.
|
|
73
|
+
* @param {string} property - The property to retrieve from the node.
|
|
74
|
+
* @returns {boolean | undefined} The boolean property value or undefined if not set.
|
|
75
|
+
*/
|
|
76
|
+
function getBooleanProperty(key: string, property: string): boolean | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Get a number property from a JCR Node referenced in app data.
|
|
79
|
+
* @param {string} key - The key of the app data value.
|
|
80
|
+
* @param {string} property - The property to retrieve from the node.
|
|
81
|
+
* @returns {number | undefined} The number property value, undefined if not set or not a number.
|
|
82
|
+
*/
|
|
83
|
+
function getNumberProperty(key: string, property: string): number | undefined;
|
|
84
|
+
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
export default globalAppData;
|
|
2
|
-
declare namespace globalAppData {
|
|
3
|
-
/**
|
|
4
|
-
* Get a value from app data, same as get in \@sitevision/api/server/appData.
|
|
5
|
-
* @param {string} key - The key of app data to retrieve.
|
|
6
|
-
* @param {...string} [properties] - The keys of the properties to retrieve from a JCR Node.
|
|
7
|
-
* @returns {unknown} The value of the app data or a properties of a JCR Node.
|
|
8
|
-
*/
|
|
9
|
-
function get(key: string, ...properties?: string[]): unknown;
|
|
10
|
-
/**
|
|
11
|
-
* Get a value from app data as an array, same as getArray in \@sitevision/api/server/appData.
|
|
12
|
-
* @param {string} key - The key of app data to retrieve.
|
|
13
|
-
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[] | string[]} An array of JCR
|
|
14
|
-
* Nodes for list components or value wrapped in an array for single type components.
|
|
15
|
-
*/
|
|
16
|
-
function getArray(key: string): string[] | import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
17
|
-
/**
|
|
18
|
-
* Get a string value from app data.
|
|
19
|
-
* @param {string} key - The key of app data to retrieve.
|
|
20
|
-
* @returns {string | undefined} The string value or undefined if not set.
|
|
21
|
-
*/
|
|
22
|
-
function getString(key: string): string | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Get a boolean value from app data.
|
|
25
|
-
* @param {string} key - The key of app data to retrieve.
|
|
26
|
-
* @returns {boolean | undefined} The boolean value or undefined if not set.
|
|
27
|
-
*/
|
|
28
|
-
function getBoolean(key: string): boolean | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Get a number value from app data.
|
|
31
|
-
* @param {string} key - The key of app data to retrieve.
|
|
32
|
-
* @returns {number | undefined} The number value, undefined if not set or not a number.
|
|
33
|
-
*/
|
|
34
|
-
function getNumber(key: string): number | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Get an array of nodes from app data.
|
|
37
|
-
* @param {string} key - The key of app data to retrieve.
|
|
38
|
-
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[]} The array of nodes or an
|
|
39
|
-
* empty array if not set.
|
|
40
|
-
*/
|
|
41
|
-
function getNodes(key: string): import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
42
|
-
/**
|
|
43
|
-
* Get an array of strings from app data.
|
|
44
|
-
* @param {string} key - The key of app data to retrieve.
|
|
45
|
-
* @returns {string[]} The array of strings or an empty array if not set.
|
|
46
|
-
*/
|
|
47
|
-
function getStrings(key: string): string[];
|
|
48
|
-
/**
|
|
49
|
-
* Get a JCR Node from app data.
|
|
50
|
-
* @param {string} key - The key of the property to retrieve.
|
|
51
|
-
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node | undefined} The JCR Node or
|
|
52
|
-
* undefined if not set.
|
|
53
|
-
*/
|
|
54
|
-
function getNode(key: string): import("@sitevision/api/types/javax/jcr/Node").Node;
|
|
55
|
-
/**
|
|
56
|
-
* Get a string property from a JCR Node referenced in app data.
|
|
57
|
-
* @param {string} key - The key of the app data value.
|
|
58
|
-
* @param {string} property - The property to retrieve from the node.
|
|
59
|
-
* @returns {string | undefined} The string property value or undefined if not set.
|
|
60
|
-
*/
|
|
61
|
-
function getStringProperty(key: string, property: string): string | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Get a string array property or a single string wrapped in an array from a JCR Node referenced
|
|
64
|
-
* in app data.
|
|
65
|
-
* @param {string} key - The key of app data to retrieve.
|
|
66
|
-
* @param {string} property - The property to retrieve from the node.
|
|
67
|
-
* @returns {string[]} The array of strings or an empty array if not set.
|
|
68
|
-
*/
|
|
69
|
-
function getStringsProperty(key: string, property: string): string[];
|
|
70
|
-
/**
|
|
71
|
-
* Get a boolean property from a JCR Node referenced in app data.
|
|
72
|
-
* @param {string} key - The key of the app data value.
|
|
73
|
-
* @param {string} property - The property to retrieve from the node.
|
|
74
|
-
* @returns {boolean | undefined} The boolean property value or undefined if not set.
|
|
75
|
-
*/
|
|
76
|
-
function getBooleanProperty(key: string, property: string): boolean | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Get a number property from a JCR Node referenced in app data.
|
|
79
|
-
* @param {string} key - The key of the app data value.
|
|
80
|
-
* @param {string} property - The property to retrieve from the node.
|
|
81
|
-
* @returns {number | undefined} The number property value, undefined if not set or not a number.
|
|
82
|
-
*/
|
|
83
|
-
function getNumberProperty(key: string, property: string): number | undefined;
|
|
84
|
-
}
|
|
1
|
+
export default globalAppData;
|
|
2
|
+
declare namespace globalAppData {
|
|
3
|
+
/**
|
|
4
|
+
* Get a value from app data, same as get in \@sitevision/api/server/appData.
|
|
5
|
+
* @param {string} key - The key of app data to retrieve.
|
|
6
|
+
* @param {...string} [properties] - The keys of the properties to retrieve from a JCR Node.
|
|
7
|
+
* @returns {unknown} The value of the app data or a properties of a JCR Node.
|
|
8
|
+
*/
|
|
9
|
+
function get(key: string, ...properties?: string[]): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Get a value from app data as an array, same as getArray in \@sitevision/api/server/appData.
|
|
12
|
+
* @param {string} key - The key of app data to retrieve.
|
|
13
|
+
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[] | string[]} An array of JCR
|
|
14
|
+
* Nodes for list components or value wrapped in an array for single type components.
|
|
15
|
+
*/
|
|
16
|
+
function getArray(key: string): string[] | import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
17
|
+
/**
|
|
18
|
+
* Get a string value from app data.
|
|
19
|
+
* @param {string} key - The key of app data to retrieve.
|
|
20
|
+
* @returns {string | undefined} The string value or undefined if not set.
|
|
21
|
+
*/
|
|
22
|
+
function getString(key: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get a boolean value from app data.
|
|
25
|
+
* @param {string} key - The key of app data to retrieve.
|
|
26
|
+
* @returns {boolean | undefined} The boolean value or undefined if not set.
|
|
27
|
+
*/
|
|
28
|
+
function getBoolean(key: string): boolean | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Get a number value from app data.
|
|
31
|
+
* @param {string} key - The key of app data to retrieve.
|
|
32
|
+
* @returns {number | undefined} The number value, undefined if not set or not a number.
|
|
33
|
+
*/
|
|
34
|
+
function getNumber(key: string): number | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Get an array of nodes from app data.
|
|
37
|
+
* @param {string} key - The key of app data to retrieve.
|
|
38
|
+
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node[]} The array of nodes or an
|
|
39
|
+
* empty array if not set.
|
|
40
|
+
*/
|
|
41
|
+
function getNodes(key: string): import("@sitevision/api/types/javax/jcr/Node").Node[];
|
|
42
|
+
/**
|
|
43
|
+
* Get an array of strings from app data.
|
|
44
|
+
* @param {string} key - The key of app data to retrieve.
|
|
45
|
+
* @returns {string[]} The array of strings or an empty array if not set.
|
|
46
|
+
*/
|
|
47
|
+
function getStrings(key: string): string[];
|
|
48
|
+
/**
|
|
49
|
+
* Get a JCR Node from app data.
|
|
50
|
+
* @param {string} key - The key of the property to retrieve.
|
|
51
|
+
* @returns {import('@sitevision/api/types/javax/jcr/Node').Node | undefined} The JCR Node or
|
|
52
|
+
* undefined if not set.
|
|
53
|
+
*/
|
|
54
|
+
function getNode(key: string): import("@sitevision/api/types/javax/jcr/Node").Node;
|
|
55
|
+
/**
|
|
56
|
+
* Get a string property from a JCR Node referenced in app data.
|
|
57
|
+
* @param {string} key - The key of the app data value.
|
|
58
|
+
* @param {string} property - The property to retrieve from the node.
|
|
59
|
+
* @returns {string | undefined} The string property value or undefined if not set.
|
|
60
|
+
*/
|
|
61
|
+
function getStringProperty(key: string, property: string): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Get a string array property or a single string wrapped in an array from a JCR Node referenced
|
|
64
|
+
* in app data.
|
|
65
|
+
* @param {string} key - The key of app data to retrieve.
|
|
66
|
+
* @param {string} property - The property to retrieve from the node.
|
|
67
|
+
* @returns {string[]} The array of strings or an empty array if not set.
|
|
68
|
+
*/
|
|
69
|
+
function getStringsProperty(key: string, property: string): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Get a boolean property from a JCR Node referenced in app data.
|
|
72
|
+
* @param {string} key - The key of the app data value.
|
|
73
|
+
* @param {string} property - The property to retrieve from the node.
|
|
74
|
+
* @returns {boolean | undefined} The boolean property value or undefined if not set.
|
|
75
|
+
*/
|
|
76
|
+
function getBooleanProperty(key: string, property: string): boolean | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Get a number property from a JCR Node referenced in app data.
|
|
79
|
+
* @param {string} key - The key of the app data value.
|
|
80
|
+
* @param {string} property - The property to retrieve from the node.
|
|
81
|
+
* @returns {number | undefined} The number property value, undefined if not set or not a number.
|
|
82
|
+
*/
|
|
83
|
+
function getNumberProperty(key: string, property: string): number | undefined;
|
|
84
|
+
}
|
package/server/index.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Require a module natively, bypassing Webpack bundling.
|
|
3
|
-
* This function behaves like CommonJS require() and is used to import
|
|
4
|
-
* system packages in the Rhino runtime environment where Webpack bundling interferes
|
|
5
|
-
* with native module resolution.
|
|
6
|
-
*
|
|
7
|
-
* @param {string} module - The module identifier
|
|
8
|
-
* @returns {any} The exported module
|
|
9
|
-
* @example
|
|
10
|
-
* // Import a Sitevision API package
|
|
11
|
-
* const PortletContextUtil = nativeRequire('PortletContextUtil');
|
|
12
|
-
*/
|
|
13
|
-
export function nativeRequire(module: string): any;
|
|
14
|
-
/**
|
|
15
|
-
* @typedef {import('@sitevision/api/types/javax/jcr/Node').Node} Node
|
|
16
|
-
* @typedef {import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator} NodeIterator
|
|
17
|
-
* @typedef {import('@sitevision/api/types/java/util/Iterator').Iterator} Iterator
|
|
18
|
-
* @typedef {import('@sitevision/api/types/java/util/List').List} List
|
|
19
|
-
* @typedef {import('@sitevision/api/types/java/util/Set').Set} Set
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* Converts an Iterator to an array
|
|
23
|
-
* @template T
|
|
24
|
-
* @param {Iterator} iterator - The Iterator to convert
|
|
25
|
-
* @returns {T[]} Array containing all items from the iterator
|
|
26
|
-
*/
|
|
27
|
-
export function iteratorToArray<T>(iterator: Iterator): T[];
|
|
28
|
-
/**
|
|
29
|
-
* Converts a NodeIterator to an array of Nodes
|
|
30
|
-
* @param {NodeIterator} nodeIterator - The NodeIterator to convert
|
|
31
|
-
* @returns {Node[]} Array containing all nodes from the iterator
|
|
32
|
-
*/
|
|
33
|
-
export function nodeIteratorToArray(nodeIterator: NodeIterator): Node[];
|
|
34
|
-
/**
|
|
35
|
-
* Converts a List to an array
|
|
36
|
-
* @template T
|
|
37
|
-
* @param {List} list - The List to convert
|
|
38
|
-
* @returns {T[]} Array containing all items from the list
|
|
39
|
-
*/
|
|
40
|
-
export function listToArray<T>(list: List): T[];
|
|
41
|
-
/**
|
|
42
|
-
* Converts a Set to an array
|
|
43
|
-
* @template T
|
|
44
|
-
* @param {Set} set - The Set to convert
|
|
45
|
-
* @returns {T[]} Array containing all items from the set
|
|
46
|
-
*/
|
|
47
|
-
export function setToArray<T>(set: Set): T[];
|
|
48
|
-
export type Node = import('@sitevision/api/types/javax/jcr/Node').Node;
|
|
49
|
-
export type NodeIterator = import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator;
|
|
50
|
-
export type Iterator = import('@sitevision/api/types/java/util/Iterator').Iterator;
|
|
51
|
-
export type List = import('@sitevision/api/types/java/util/List').List;
|
|
52
|
-
export type Set = import('@sitevision/api/types/java/util/Set').Set;
|
|
1
|
+
/**
|
|
2
|
+
* Require a module natively, bypassing Webpack bundling.
|
|
3
|
+
* This function behaves like CommonJS require() and is used to import
|
|
4
|
+
* system packages in the Rhino runtime environment where Webpack bundling interferes
|
|
5
|
+
* with native module resolution.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} module - The module identifier
|
|
8
|
+
* @returns {any} The exported module
|
|
9
|
+
* @example
|
|
10
|
+
* // Import a Sitevision API package
|
|
11
|
+
* const PortletContextUtil = nativeRequire('PortletContextUtil');
|
|
12
|
+
*/
|
|
13
|
+
export function nativeRequire(module: string): any;
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {import('@sitevision/api/types/javax/jcr/Node').Node} Node
|
|
16
|
+
* @typedef {import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator} NodeIterator
|
|
17
|
+
* @typedef {import('@sitevision/api/types/java/util/Iterator').Iterator} Iterator
|
|
18
|
+
* @typedef {import('@sitevision/api/types/java/util/List').List} List
|
|
19
|
+
* @typedef {import('@sitevision/api/types/java/util/Set').Set} Set
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Converts an Iterator to an array
|
|
23
|
+
* @template T
|
|
24
|
+
* @param {Iterator} iterator - The Iterator to convert
|
|
25
|
+
* @returns {T[]} Array containing all items from the iterator
|
|
26
|
+
*/
|
|
27
|
+
export function iteratorToArray<T>(iterator: Iterator): T[];
|
|
28
|
+
/**
|
|
29
|
+
* Converts a NodeIterator to an array of Nodes
|
|
30
|
+
* @param {NodeIterator} nodeIterator - The NodeIterator to convert
|
|
31
|
+
* @returns {Node[]} Array containing all nodes from the iterator
|
|
32
|
+
*/
|
|
33
|
+
export function nodeIteratorToArray(nodeIterator: NodeIterator): Node[];
|
|
34
|
+
/**
|
|
35
|
+
* Converts a List to an array
|
|
36
|
+
* @template T
|
|
37
|
+
* @param {List} list - The List to convert
|
|
38
|
+
* @returns {T[]} Array containing all items from the list
|
|
39
|
+
*/
|
|
40
|
+
export function listToArray<T>(list: List): T[];
|
|
41
|
+
/**
|
|
42
|
+
* Converts a Set to an array
|
|
43
|
+
* @template T
|
|
44
|
+
* @param {Set} set - The Set to convert
|
|
45
|
+
* @returns {T[]} Array containing all items from the set
|
|
46
|
+
*/
|
|
47
|
+
export function setToArray<T>(set: Set): T[];
|
|
48
|
+
export type Node = import('@sitevision/api/types/javax/jcr/Node').Node;
|
|
49
|
+
export type NodeIterator = import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator;
|
|
50
|
+
export type Iterator = import('@sitevision/api/types/java/util/Iterator').Iterator;
|
|
51
|
+
export type List = import('@sitevision/api/types/java/util/List').List;
|
|
52
|
+
export type Set = import('@sitevision/api/types/java/util/Set').Set;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { render } from "../4";
|
|
1
|
+
export { render } from "../4";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** @typedef {import('svelte').SvelteComponent} Component */
|
|
2
|
-
/**
|
|
3
|
-
* Returns HTML for a server rendered Svelte app.
|
|
4
|
-
* @param {Component<any>} App Svelte component that is root of app.
|
|
5
|
-
* @param {Record<string, any>} props Props passed to root component.
|
|
6
|
-
* @return {string} HTML for the server rendered app.
|
|
7
|
-
*/
|
|
8
|
-
export function render(App: any, props: Record<string, any>): string;
|
|
9
|
-
export type Component = import('svelte').SvelteComponent;
|
|
1
|
+
/** @typedef {import('svelte').SvelteComponent} Component */
|
|
2
|
+
/**
|
|
3
|
+
* Returns HTML for a server rendered Svelte app.
|
|
4
|
+
* @param {Component<any>} App Svelte component that is root of app.
|
|
5
|
+
* @param {Record<string, any>} props Props passed to root component.
|
|
6
|
+
* @return {string} HTML for the server rendered app.
|
|
7
|
+
*/
|
|
8
|
+
export function render(App: any, props: Record<string, any>): string;
|
|
9
|
+
export type Component = import('svelte').SvelteComponent;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @
|
|
5
|
-
* @
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
/**
|
|
3
|
+
* Returns HTML for a server rendered Svelte app.
|
|
4
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
5
|
+
* @param {TComponent} App Svelte component that is root of app.
|
|
6
|
+
* @param {import('svelte').ComponentProps<TComponent>} props Props passed to root component.
|
|
7
|
+
* @return {string} HTML for the server rendered app.
|
|
8
|
+
*/
|
|
9
|
+
export function render<TComponent extends import("svelte").Component<any, any, string>>(App: TComponent, props: import("svelte").ComponentProps<TComponent>): string;
|
package/server/svelte/5/index.js
CHANGED
|
@@ -3,8 +3,9 @@ import { appId, setAppProps } from '../../../common';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Returns HTML for a server rendered Svelte app.
|
|
6
|
-
* @
|
|
7
|
-
* @param {
|
|
6
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
7
|
+
* @param {TComponent} App Svelte component that is root of app.
|
|
8
|
+
* @param {import('svelte').ComponentProps<TComponent>} props Props passed to root component.
|
|
8
9
|
* @return {string} HTML for the server rendered app.
|
|
9
10
|
*/
|
|
10
11
|
export function render(App, props) {
|
package/server/svelte/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns HTML for a server rendered Svelte 3 or 4 app.
|
|
3
|
-
* @deprecated Use rendering function for specific Svelte version instead.
|
|
4
|
-
* `import { render } from '@soleil-api/webapp-util/server/svelte/{3|4|5}';`
|
|
5
|
-
* @param {import('svelte').SvelteComponent<any>} App Svelte component that is root of app.
|
|
6
|
-
* @param {object} props Props passed to root component.
|
|
7
|
-
* @return {string} HTML for the server rendered app.
|
|
8
|
-
*/
|
|
9
|
-
export function render(App: import('svelte').SvelteComponent<any>, props: object): string;
|
|
1
|
+
/**
|
|
2
|
+
* Returns HTML for a server rendered Svelte 3 or 4 app.
|
|
3
|
+
* @deprecated Use rendering function for specific Svelte version instead.
|
|
4
|
+
* `import { render } from '@soleil-api/webapp-util/server/svelte/{3|4|5}';`
|
|
5
|
+
* @param {import('svelte').SvelteComponent<any>} App Svelte component that is root of app.
|
|
6
|
+
* @param {object} props Props passed to root component.
|
|
7
|
+
* @return {string} HTML for the server rendered app.
|
|
8
|
+
*/
|
|
9
|
+
export function render(App: import('svelte').SvelteComponent<any>, props: object): string;
|