vasille-web 4.1.4 → 4.1.6

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.
@@ -98,18 +98,9 @@ export declare function ElseIf(props: { $condition: unknown; slot?: unknown }):
98
98
  export declare function Else(props: { slot?: unknown }): void;
99
99
 
100
100
  /** Renders content several times using a model (array, map or set) */
101
- export declare function For<T>(props: {
102
- of: readonly DeepReadonly<T>[];
103
- slot?: (value: DeepReadonly<T>) => void;
104
- }): void;
105
- export declare function For<T>(props: {
106
- of: ReadonlySet<DeepReadonly<T>>;
107
- slot?: (value: DeepReadonly<T>) => void;
108
- }): void;
109
- export declare function For<K, T>(props: {
110
- of: ReadonlyMap<DeepReadonly<K>, DeepReadonly<T>>;
111
- slot?: (value: DeepReadonly<T>, index: DeepReadonly<K>) => void;
112
- }): void;
101
+ export declare function For<T>(props: { of: readonly T[]; slot?: (value: T) => void }): void;
102
+ export declare function For<T>(props: { of: ReadonlySet<T>; slot?: (value: T) => void }): void;
103
+ export declare function For<K, T>(props: { of: ReadonlyMap<K, T>; slot?: (value: T, index: K) => void }): void;
113
104
 
114
105
  /** Refresh the content each time then the reactive model is updated */
115
106
  export declare function Watch<T>(props: { $model: T; slot?: (value: T) => void }): void;
@@ -120,35 +111,14 @@ export declare function Debug(props: { $model: unknown }): void;
120
111
  /** Render content after a while */
121
112
  export declare function Delay(props: { time?: number; slot?: unknown }): void;
122
113
 
123
- export type DeepReadonly<T> =
124
- T extends Map<infer K, infer V>
125
- ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
126
- : T extends ReadonlyMap<infer K, infer V>
127
- ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
128
- : T extends WeakMap<infer K, infer V>
129
- ? WeakMap<DeepReadonly<K>, DeepReadonly<V>>
130
- : T extends Set<infer U>
131
- ? ReadonlySet<DeepReadonly<U>>
132
- : T extends ReadonlySet<infer U>
133
- ? ReadonlySet<DeepReadonly<U>>
134
- : T extends WeakSet<infer U>
135
- ? WeakSet<DeepReadonly<U>>
136
- : T extends Promise<infer U>
137
- ? Promise<DeepReadonly<U>>
138
- : T extends (...args: unknown[]) => unknown
139
- ? T
140
- : T extends {}
141
- ? { readonly [K in keyof T]: DeepReadonly<T[K]> }
142
- : T;
143
-
144
114
  /** Stores a singleton state to memory */
145
- export declare function store<Return extends object>(fn: () => Return): DeepReadonly<Return>;
115
+ export declare function store<Return extends object>(fn: () => Return): Return;
146
116
 
147
117
  /** Creates a model (state) constructor */
148
- export declare function model<Return extends object>(fn: () => Return): () => DeepReadonly<Return>;
118
+ export declare function model<Return extends object>(fn: () => Return): () => Return;
149
119
  export declare function model<Input extends object, Return extends object>(
150
120
  fn: (input: Input) => Return,
151
- ): (input: Input) => DeepReadonly<Return>;
121
+ ): (input: Input) => Return;
152
122
 
153
123
  export { QueryParams, ScreenProps, RouteParameters } from "vasille-router";
154
124
  export { Router, NavigationMode } from "vasille-router/web-router";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vasille-web",
3
- "version": "4.1.4",
3
+ "version": "4.1.6",
4
4
  "description": "The same framework which is designed to build bulletproof frontends.",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",
package/spec/html.d.ts CHANGED
@@ -292,6 +292,11 @@ interface ButtonAttrs extends TagAttrs {
292
292
  value: string;
293
293
  }
294
294
 
295
+ interface CanvasAttrs extends TagAttrs {
296
+ width: number;
297
+ height: number;
298
+ }
299
+
295
300
  interface SelectAttrs extends TagAttrs {
296
301
  autocomplete: boolean;
297
302
  disabled: boolean;
@@ -376,7 +381,7 @@ export interface HtmlTagMap {
376
381
  body: Tag<TagAttrs, BodyEvents, TagProps<HTMLBodyElement>>;
377
382
  br: Tag<TagAttrs, TagEvents, TagProps<HTMLBRElement>>;
378
383
  button: Tag<ButtonAttrs, TagEvents, ButtonProps>;
379
- canvas: Tag<TagAttrs, TagEvents, CanvasProps>;
384
+ canvas: Tag<CanvasAttrs, TagEvents, CanvasProps>;
380
385
  caption: Tag<TagAttrs, TagEvents, TagProps<HTMLElement>>;
381
386
  cite: Tag<TagAttrs, TagEvents, TagProps<HTMLElement>>;
382
387
  code: Tag<TagAttrs, TagEvents, TagProps<HTMLElement>>;
@@ -14,7 +14,7 @@ type HtmlInput<K extends keyof HTMLElementTagNameMap & keyof HtmlTagMap> = {
14
14
  slot?: unknown;
15
15
  } & Partial<HtmlTagMap[K]["attrs"]> & prefixedObject<EventHandlers<HtmlTagMap[K]["events"]>, "on"> & Partial<prefixedObject<HtmlTagMap[K]["props"], "bind:">>;
16
16
  export declare namespace JSX {
17
- type ElementType = keyof IntrinsicElements | ((props: object) => void);
17
+ type ElementType = keyof IntrinsicElements | ((props: any) => void);
18
18
  type Element = never;
19
19
  type ElementClass = never;
20
20
  interface ElementChildrenAttribute {