@tempots/dom 26.7.1 → 26.7.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
CHANGED
package/renderable/element.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { TNode, Renderable } from '../types/domain';
|
|
2
|
+
import { DOMContext } from '../dom/dom-context';
|
|
2
3
|
/**
|
|
3
4
|
* Converts a TNode into a Renderable.
|
|
4
5
|
* @param child - The TNode to convert.
|
|
5
6
|
* @returns The corresponding Renderable.
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
|
-
export declare const renderableOfTNode: (child: TNode) => Renderable
|
|
9
|
+
export declare const renderableOfTNode: <T extends DOMContext>(child: TNode<T>) => Renderable<T>;
|
|
9
10
|
/**
|
|
10
11
|
* Creates a Renderable that represents an HTML element.
|
|
11
12
|
*
|
package/renderable/fragment.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TNode, Renderable } from '../types/domain';
|
|
2
|
+
import { DOMContext } from '../dom/dom-context';
|
|
2
3
|
/**
|
|
3
4
|
* Creates a fragment renderable that represents a collection of child renderables.
|
|
4
5
|
*
|
|
@@ -10,4 +11,4 @@ import { TNode, Renderable } from '../types/domain';
|
|
|
10
11
|
* @returns A renderable function that renders the child renderables in the given DOM context.
|
|
11
12
|
* @public
|
|
12
13
|
*/
|
|
13
|
-
export declare const Fragment: (...children: TNode[]) => Renderable
|
|
14
|
+
export declare const Fragment: <T extends DOMContext>(...children: TNode<T>[]) => Renderable<T>;
|
package/renderable/provider.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type ToProviderTypes<T extends unknown[]> = T extends [] ? [] : T extends
|
|
|
9
9
|
* Represents a provider for a specific type `T`.
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
export type Provider<T, O =
|
|
12
|
+
export type Provider<T, O = any> = {
|
|
13
13
|
/** The provider mark. */
|
|
14
14
|
mark: ProviderMark<T>;
|
|
15
15
|
/** The function to create the provider. */
|
|
@@ -25,9 +25,9 @@ export type Provider<T, O = unknown> = {
|
|
|
25
25
|
*/
|
|
26
26
|
export type ProviderOptions = {
|
|
27
27
|
/** The function to use a provider. */
|
|
28
|
-
use: <T, O =
|
|
28
|
+
use: <T, O = any>(provider: Provider<T, O>) => T;
|
|
29
29
|
/** The function to set a provider. */
|
|
30
|
-
set: <T, O =
|
|
30
|
+
set: <T, O = any>(provider: Provider<T, O>, options?: O) => void;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Returns a renderable function that executes the given function with the
|