tosijs 1.1.0 → 1.1.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/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "1.1.0";
1
+ export declare const version = "1.1.1";
@@ -11,7 +11,26 @@ export type XinProxyTarget = XinObject | XinArray;
11
11
  export type XinValue = XinObject | XinArray | XinScalar | null | undefined;
12
12
  type ProxyObserveFunc = ((path: string) => void);
13
13
  type ProxyBindFunc<T extends Element = Element> = (element: T, binding: XinBinding<T>, options?: XinObject) => VoidFunction;
14
+ /**
15
+ * XinProps provides the reactive API for boxed objects and arrays.
16
+ * As of 1.1.1, this matches the BoxedScalar API for consistency.
17
+ * Note: These properties are only available when using `boxed`/`tosi()`,
18
+ * and only when the property name doesn't shadow an actual property on the object.
19
+ */
14
20
  export interface XinProps<T = any> {
21
+ path: string;
22
+ value: T;
23
+ observe: ProxyObserveFunc;
24
+ bind: ProxyBindFunc;
25
+ on: (element: HTMLElement, eventType: keyof HTMLElementEventMap) => VoidFunction;
26
+ binding: (binding: XinBinding) => {
27
+ bind: {
28
+ value: string;
29
+ binding: XinBinding;
30
+ };
31
+ };
32
+ valueOf: () => T;
33
+ toJSON: () => T;
15
34
  [XIN_PATH]: string;
16
35
  tosiPath: string;
17
36
  [XIN_VALUE]: T;
@@ -24,8 +43,8 @@ export interface XinProps<T = any> {
24
43
  type ListTemplateBuilder<U = any> = (elements: ElementsProxy, item: U) => HTMLElement;
25
44
  type ListBinding = [ElementProps, HTMLTemplateElement];
26
45
  export interface BoxedArrayProps<U = any> {
27
- tosiListBinding: (templateBuilder: ListTemplateBuilder<U>, options?: ListBindingOptions) => ListBinding;
28
46
  listBinding: (templateBuilder: ListTemplateBuilder<U>, options?: ListBindingOptions) => ListBinding;
47
+ tosiListBinding: (templateBuilder: ListTemplateBuilder<U>, options?: ListBindingOptions) => ListBinding;
29
48
  }
30
49
  /**
31
50
  * BoxedScalar represents a boxed primitive value (string, number, boolean, null, undefined).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tosijs",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "path-based state management for web apps",
5
5
  "source": "src/index.ts",
6
6
  "types": "dist/index.d.ts",