@soleil-se/app-util 5.12.2 → 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
CHANGED
|
@@ -7,6 +7,10 @@ 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
|
+
|
|
10
14
|
## [5.12.2] - 2025-12-03
|
|
11
15
|
|
|
12
16
|
- Better type definitions for Svelte render functions.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="svelte" />
|
|
2
2
|
/**
|
|
3
|
-
* @template {
|
|
3
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
4
4
|
* @typedef {object} RenderSettings
|
|
5
5
|
* @property {HTMLElement} [target] Target where app should be mounted.
|
|
6
|
-
* @property {
|
|
6
|
+
* @property {import('svelte').ComponentProps<TComponent>} [props] Root component props.
|
|
7
7
|
* @property {boolean} [hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing DOM
|
|
8
8
|
* (usually from server-side rendering) rather than creating new elements. By default the app will
|
|
9
9
|
* hydrate when the target has any child nodes.
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
*/
|
|
13
13
|
/**
|
|
14
14
|
* Renders a client side Svelte application.
|
|
15
|
-
* @template {
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {RenderSettings<
|
|
15
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
16
|
+
* @param {TComponent} App Svelte app root component.
|
|
17
|
+
* @param {RenderSettings<TComponent>} [settings={}] Settings object.
|
|
18
18
|
*/
|
|
19
|
-
export function render<
|
|
20
|
-
export type RenderSettings<
|
|
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
21
|
/**
|
|
22
22
|
* Target where app should be mounted.
|
|
23
23
|
*/
|
|
@@ -25,7 +25,7 @@ export type RenderSettings<TProps extends Record<string, unknown>> = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Root component props.
|
|
27
27
|
*/
|
|
28
|
-
props?:
|
|
28
|
+
props?: import('svelte').ComponentProps<TComponent>;
|
|
29
29
|
/**
|
|
30
30
|
* Instructs Svelte to upgrade existing DOM
|
|
31
31
|
* (usually from server-side rendering) rather than creating new elements. By default the app will
|
package/client/svelte/5/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import { mount as svelteMount, hydrate as svelteHydrate } from 'svelte';
|
|
|
4
4
|
import { setAppProps } from '../../../common';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @template {
|
|
7
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
8
8
|
* @typedef {object} RenderSettings
|
|
9
9
|
* @property {HTMLElement} [target] Target where app should be mounted.
|
|
10
|
-
* @property {
|
|
10
|
+
* @property {import('svelte').ComponentProps<TComponent>} [props] Root component props.
|
|
11
11
|
* @property {boolean} [hydrate=target.hasChildNodes()] Instructs Svelte to upgrade existing DOM
|
|
12
12
|
* (usually from server-side rendering) rather than creating new elements. By default the app will
|
|
13
13
|
* hydrate when the target has any child nodes.
|
|
@@ -17,9 +17,9 @@ import { setAppProps } from '../../../common';
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Renders a client side Svelte application.
|
|
20
|
-
* @template {
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {RenderSettings<
|
|
20
|
+
* @template {import('svelte').Component<any, any>} TComponent
|
|
21
|
+
* @param {TComponent} App Svelte app root component.
|
|
22
|
+
* @param {RenderSettings<TComponent>} [settings={}] Settings object.
|
|
23
23
|
*/
|
|
24
24
|
export function render(App, {
|
|
25
25
|
target,
|
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,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="svelte" />
|
|
2
2
|
/**
|
|
3
3
|
* Returns HTML for a server rendered Svelte app.
|
|
4
|
-
* @template {
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {
|
|
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
7
|
* @return {string} HTML for the server rendered app.
|
|
8
8
|
*/
|
|
9
|
-
export function render<
|
|
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,9 +3,9 @@ import { appId, setAppProps } from '../../../common';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Returns HTML for a server rendered Svelte app.
|
|
6
|
-
* @template {
|
|
7
|
-
* @param {
|
|
8
|
-
* @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.
|
|
9
9
|
* @return {string} HTML for the server rendered app.
|
|
10
10
|
*/
|
|
11
11
|
export function render(App, props) {
|