leaner 0.4.0 → 0.4.1
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 +4 -4
- package/types/web.d.ts +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leaner",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Thin, reactive wrapper for DOM",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"csstype": "^3.2.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"jsdom": "^
|
|
59
|
-
"rollup": "^4.
|
|
60
|
-
"vitest": "^
|
|
58
|
+
"jsdom": "^31.0.1",
|
|
59
|
+
"rollup": "^4.68.3",
|
|
60
|
+
"vitest": "^5.1.0"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/types/web.d.ts
CHANGED
|
@@ -6,17 +6,17 @@ export type LeanerNode = LeanerElement | Node | null | string | number | ( () =>
|
|
|
6
6
|
|
|
7
7
|
export type Component = ( props: any, children: any[] ) => LeanerNode;
|
|
8
8
|
|
|
9
|
+
interface InjectionConstraint<T> {}
|
|
10
|
+
|
|
11
|
+
export type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
12
|
+
|
|
9
13
|
export interface App {
|
|
10
14
|
mount( target: HTMLElement ): void;
|
|
11
15
|
destroy(): void;
|
|
12
|
-
provide
|
|
16
|
+
provide<T, K = string | InjectionKey<T>>( key: K, value: K extends InjectionKey<infer V> ? V : T ): void;
|
|
13
17
|
use( callback: () => void ): void;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
interface InjectionConstraint<T> {}
|
|
17
|
-
|
|
18
|
-
export type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
19
|
-
|
|
20
20
|
export declare function createApp( component: Component ): App;
|
|
21
21
|
|
|
22
22
|
export declare function inject<T>( key: string | InjectionKey<T> ): T | undefined;
|