tosijs 1.0.8 → 1.0.10
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/README.md +22 -10
- package/dist/blueprint-loader.d.ts +2 -2
- package/dist/component.d.ts +5 -4
- package/dist/elements-types.d.ts +129 -0
- package/dist/elements.d.ts +1 -126
- package/dist/index.d.ts +3 -2
- package/dist/index.js +8 -8
- package/dist/index.js.map +19 -18
- package/dist/list-binding.d.ts +11 -19
- package/dist/main.js +8 -8
- package/dist/main.js.map +19 -18
- package/dist/make-component.d.ts +2 -1
- package/dist/metadata.d.ts +2 -3
- package/dist/module.js +8 -8
- package/dist/module.js.map +19 -18
- package/dist/version.d.ts +1 -1
- package/dist/xin-types.d.ts +27 -4
- package/package.json +1 -1
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.10";
|
package/dist/xin-types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { XIN_PATH, XIN_VALUE,
|
|
1
|
+
import { XIN_PATH, XIN_VALUE, XIN_OBSERVE, XIN_BIND } from './metadata';
|
|
2
2
|
import { XinStyleRule } from './css-types';
|
|
3
|
+
import { ElementsProxy } from './elements-types';
|
|
3
4
|
export type AnyFunction = (...args: any[]) => any | Promise<any>;
|
|
4
5
|
export type XinScalar = string | boolean | number | symbol | AnyFunction;
|
|
5
6
|
export type XinArray = any[];
|
|
@@ -12,14 +13,22 @@ type ProxyObserveFunc = ((path: string) => void);
|
|
|
12
13
|
type ProxyBindFunc<T extends Element = Element> = (element: T, binding: XinBinding<T>, options?: XinObject) => VoidFunction;
|
|
13
14
|
export interface XinProps<T = any> {
|
|
14
15
|
[XIN_PATH]: string;
|
|
16
|
+
tosiPath: string;
|
|
15
17
|
[XIN_VALUE]: T;
|
|
16
|
-
|
|
18
|
+
tosiValue: T;
|
|
17
19
|
[XIN_OBSERVE]: ProxyObserveFunc;
|
|
20
|
+
tosiObserve: ProxyObserveFunc;
|
|
18
21
|
[XIN_BIND]: ProxyBindFunc;
|
|
22
|
+
tosiBind: ProxyBindFunc;
|
|
19
23
|
}
|
|
20
|
-
|
|
24
|
+
type ListTemplateBuilder<U = any> = (elements: ElementsProxy, item: U) => HTMLElement;
|
|
25
|
+
type ListBinding = [ElementProps, HTMLTemplateElement];
|
|
26
|
+
export interface BoxedArrayProps<U = any> {
|
|
27
|
+
tosiListBinding: (templateBuilder: ListTemplateBuilder<U>, options?: ListBindingOptions) => ListBinding;
|
|
28
|
+
}
|
|
29
|
+
export type BoxedProxy<T = any> = T extends Array<infer U> ? Array<BoxedProxy<U>> & XinProps<T> & BoxedArrayProps<U> : T extends Function ? T & XinProps<Function> : T extends object ? {
|
|
21
30
|
[K in keyof T]: BoxedProxy<T[K]>;
|
|
22
|
-
} & XinProps<T> : T extends string ? String & XinProps<string> : T extends number ? Number & XinProps<number> : T extends boolean ? Boolean & XinProps<boolean> : T;
|
|
31
|
+
} & XinProps<T> : T extends string ? String & XinProps<string> : T extends number ? Number & XinProps<number> : T extends boolean ? Boolean & XinProps<boolean> : T extends undefined | null ? {} & XinProps<T> : T;
|
|
23
32
|
export type Unboxed<T = any> = T extends String ? string : T extends Number ? number : T extends Boolean ? boolean : T;
|
|
24
33
|
export type XinProxy<T = any> = T extends Array<infer U> ? Array<XinProxy<U>> : T extends Function ? T : T extends object ? {
|
|
25
34
|
[K in keyof T]: T[K] extends object ? XinProxy<T[K]> : T[K];
|
|
@@ -103,4 +112,18 @@ export type FragmentCreator = (...contents: ElementPart<Element>[]) => DocumentF
|
|
|
103
112
|
export type ElementCreator<T = Element> = (...contents: ElementPart<T>[]) => T;
|
|
104
113
|
export type ContentPart = Element | DocumentFragment | string;
|
|
105
114
|
export type ContentType = ContentPart | ContentPart[];
|
|
115
|
+
export type ListFilter = (array: any[], needle: any) => any[];
|
|
116
|
+
export interface ListBindingOptions {
|
|
117
|
+
idPath?: string;
|
|
118
|
+
virtual?: {
|
|
119
|
+
height: number;
|
|
120
|
+
width?: number;
|
|
121
|
+
visibleColumns?: number;
|
|
122
|
+
rowChunkSize?: number;
|
|
123
|
+
};
|
|
124
|
+
hiddenProp?: symbol | string;
|
|
125
|
+
visibleProp?: symbol | string;
|
|
126
|
+
filter?: ListFilter;
|
|
127
|
+
needle?: XinTouchableType;
|
|
128
|
+
}
|
|
106
129
|
export {};
|