typecomposer 0.0.75 → 0.0.76
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/cjs/core/ref/Ref.d.ts +3 -3
- package/dist/cjs/styles/index.d.ts +4 -1
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/esm/core/ref/Ref.d.ts +3 -3
- package/dist/esm/styles/index.d.ts +4 -1
- package/dist/esm/styles/index.js.map +1 -1
- package/package.json +1 -1
- package/typings/index.d.ts +41 -5
|
@@ -3,7 +3,7 @@ export declare function isRef(obj: any): boolean;
|
|
|
3
3
|
export type ref<T> = {
|
|
4
4
|
value: T;
|
|
5
5
|
subscribe: (target: any, prop: string | symbol | ((value: any) => void), refPropertyKey?: string | symbol | undefined) => subscribeRef<any> | undefined;
|
|
6
|
-
onChange:
|
|
6
|
+
onChange: (fun: (value: T) => void, target?: {} | undefined) => void;
|
|
7
7
|
toString: () => string;
|
|
8
8
|
toJSON: () => object;
|
|
9
9
|
};
|
|
@@ -12,14 +12,14 @@ export type isRef = typeof isRef;
|
|
|
12
12
|
export declare function refType<T>(base: any): {
|
|
13
13
|
value: T;
|
|
14
14
|
subscribe: (target: any, prop: string | symbol | ((value: any) => void), refPropertyKey?: string | symbol | undefined) => subscribeRef<any> | undefined;
|
|
15
|
-
onChange:
|
|
15
|
+
onChange: (fun: (value: T) => void, target?: {} | undefined) => void;
|
|
16
16
|
toString: () => string;
|
|
17
17
|
toJSON: () => object;
|
|
18
18
|
};
|
|
19
19
|
export declare function ref<T>(value: T): {
|
|
20
20
|
value: T;
|
|
21
21
|
subscribe: (target: any, prop: string | symbol | ((value: any) => void), refPropertyKey?: string | symbol | undefined) => subscribeRef<any> | undefined;
|
|
22
|
-
onChange:
|
|
22
|
+
onChange: (fun: (value: T) => void, target?: {} | undefined) => void;
|
|
23
23
|
toString: () => string;
|
|
24
24
|
toJSON: () => object;
|
|
25
25
|
};
|
|
@@ -15,6 +15,8 @@ interface ComponentPropsMethods {
|
|
|
15
15
|
variant?: string | ref<string>;
|
|
16
16
|
disabled?: boolean | ref<boolean>;
|
|
17
17
|
children?: IComponent[];
|
|
18
|
+
innerHTML?: string | ref<string>;
|
|
19
|
+
innerText?: string | ref<string>;
|
|
18
20
|
onclick?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
19
21
|
onchange?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
20
22
|
oninput?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -26,7 +28,7 @@ interface ComponentPropsMethods {
|
|
|
26
28
|
onmouseleave?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
27
29
|
}
|
|
28
30
|
export type ComponentProps = StyleProperties & ComponentPropsMethods;
|
|
29
|
-
|
|
31
|
+
interface StylePropertiesMethods {
|
|
30
32
|
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority) */
|
|
31
33
|
getPropertyPriority(property: string): string | ref<string>;
|
|
32
34
|
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue) */
|
|
@@ -40,4 +42,5 @@ export interface CSSStyleDeclarationRef extends StyleProperties {
|
|
|
40
42
|
[index: number]: string | ref<string>;
|
|
41
43
|
hasOwnProperty(key: string): boolean;
|
|
42
44
|
}
|
|
45
|
+
export type CSSStyleDeclarationRef = StyleProperties & StylePropertiesMethods;
|
|
43
46
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":";;AAAA,0BAA8C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":";;AAAA,0BAA8C;AAqD9C,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,SAAS,CAAC,cAAc,CAAC;AAE5E,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,S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K,EAAE;YAC9C,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;gBAC3B,MAAM,OAAO,GAAG,IAAA,WAAO,EAAC,KAAK,CAAC,CAAC;gBAC/B,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU;oBAAE,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;;oBAC1F,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;gBAC1B,OAAO,IAAI,CAAC;YACd,CAAC;YACD,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;gBACpB,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;SACF,CAAC,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE;YACtC,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;SAChC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@ export declare function isRef(obj: any): boolean;
|
|
|
3
3
|
export type ref<T> = {
|
|
4
4
|
value: T;
|
|
5
5
|
subscribe: (target: any, prop: string | symbol | ((value: any) => void), refPropertyKey?: string | symbol | undefined) => subscribeRef<any> | undefined;
|
|
6
|
-
onChange:
|
|
6
|
+
onChange: (fun: (value: T) => void, target?: {} | undefined) => void;
|
|
7
7
|
toString: () => string;
|
|
8
8
|
toJSON: () => object;
|
|
9
9
|
};
|
|
@@ -12,14 +12,14 @@ export type isRef = typeof isRef;
|
|
|
12
12
|
export declare function refType<T>(base: any): {
|
|
13
13
|
value: T;
|
|
14
14
|
subscribe: (target: any, prop: string | symbol | ((value: any) => void), refPropertyKey?: string | symbol | undefined) => subscribeRef<any> | undefined;
|
|
15
|
-
onChange:
|
|
15
|
+
onChange: (fun: (value: T) => void, target?: {} | undefined) => void;
|
|
16
16
|
toString: () => string;
|
|
17
17
|
toJSON: () => object;
|
|
18
18
|
};
|
|
19
19
|
export declare function ref<T>(value: T): {
|
|
20
20
|
value: T;
|
|
21
21
|
subscribe: (target: any, prop: string | symbol | ((value: any) => void), refPropertyKey?: string | symbol | undefined) => subscribeRef<any> | undefined;
|
|
22
|
-
onChange:
|
|
22
|
+
onChange: (fun: (value: T) => void, target?: {} | undefined) => void;
|
|
23
23
|
toString: () => string;
|
|
24
24
|
toJSON: () => object;
|
|
25
25
|
};
|
|
@@ -15,6 +15,8 @@ interface ComponentPropsMethods {
|
|
|
15
15
|
variant?: string | ref<string>;
|
|
16
16
|
disabled?: boolean | ref<boolean>;
|
|
17
17
|
children?: IComponent[];
|
|
18
|
+
innerHTML?: string | ref<string>;
|
|
19
|
+
innerText?: string | ref<string>;
|
|
18
20
|
onclick?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
19
21
|
onchange?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
20
22
|
oninput?: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -26,7 +28,7 @@ interface ComponentPropsMethods {
|
|
|
26
28
|
onmouseleave?: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
27
29
|
}
|
|
28
30
|
export type ComponentProps = StyleProperties & ComponentPropsMethods;
|
|
29
|
-
|
|
31
|
+
interface StylePropertiesMethods {
|
|
30
32
|
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority) */
|
|
31
33
|
getPropertyPriority(property: string): string | ref<string>;
|
|
32
34
|
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue) */
|
|
@@ -40,4 +42,5 @@ export interface CSSStyleDeclarationRef extends StyleProperties {
|
|
|
40
42
|
[index: number]: string | ref<string>;
|
|
41
43
|
hasOwnProperty(key: string): boolean;
|
|
42
44
|
}
|
|
45
|
+
export type CSSStyleDeclarationRef = StyleProperties & StylePropertiesMethods;
|
|
43
46
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,OAAO,EAAE,MAAM,IAAI,CAAC;AAqD9C,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,SAAS,CAAC,cAAc,CAAC;AAE5E,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,EAAE;IACrE,KAAK,EAAE,UAAU,QAAgB;QAC/B,sBAAsB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACD,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,WAAW,CAAC;AAEtE,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE;IAClE,KAAK,EAAE,UAAU,QAAgB,EAAE,KAAkC,EAAE,QAAiB;QACtF,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,IAAI,OAAO;YAAE,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;;YAC1C,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;IACD,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,EAAE;IACrE,KAAK,EAAE,UAAU,GAAW;QAC1B,OAAO,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T;
|
|
5
|
+
subscribe: (target: any, prop: string | symbol | ((value: any) => void), refPropertyKey?: string | symbol | undefined) => subscribeRef<any> | undefined;
|
|
6
|
+
onChange: (fun: (value: T) => void, target?: {} | undefined) => void;
|
|
7
|
+
toString: () => string;
|
|
8
|
+
toJSON: () => object;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type StyleProperties = {
|
|
12
|
+
[K in keyof CSS.Properties]?: CSS.Properties[K] | Ref<CSS.Properties[K]>;
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof CSS.PropertiesHyphen]?: CSS.PropertiesHyphen[K] | Ref<CSS.PropertiesHyphen[K]>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
interface StylePropertiesMethods {
|
|
18
|
+
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority) */
|
|
19
|
+
getPropertyPriority(property: string): string | ref<string>;
|
|
20
|
+
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue) */
|
|
21
|
+
getPropertyValue(property: string): string | ref<string>;
|
|
22
|
+
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item) */
|
|
23
|
+
item(index: number): string | ref<string>;
|
|
24
|
+
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty) */
|
|
25
|
+
removeProperty(property: string): string | ref<string>;
|
|
26
|
+
/** [MDN reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/setProperty) */
|
|
27
|
+
setProperty(property: string, value: string | ref<string> | null, priority?: string): void;
|
|
28
|
+
[index: number]: string | ref<string>;
|
|
29
|
+
|
|
30
|
+
hasOwnProperty(key: string): boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
1
33
|
declare module '*.html' {
|
|
2
34
|
const content: string;
|
|
3
35
|
export default content;
|
|
4
36
|
}
|
|
5
37
|
|
|
6
38
|
declare global {
|
|
39
|
+
|
|
40
|
+
type CSSStyleDeclarationRef = StyleProperties & StylePropertiesMethods;
|
|
41
|
+
|
|
7
42
|
var CSSStyleDeclarationRef: {
|
|
8
|
-
prototype:
|
|
9
|
-
new():
|
|
43
|
+
prototype: CSSStyleDeclarationRef;
|
|
44
|
+
new(): CSSStyleDeclarationRef;
|
|
10
45
|
};
|
|
11
|
-
|
|
46
|
+
|
|
47
|
+
|
|
12
48
|
interface Array<T> {
|
|
13
49
|
clear(): void;
|
|
14
50
|
}
|
|
@@ -26,7 +62,7 @@ declare global {
|
|
|
26
62
|
|
|
27
63
|
interface Element {
|
|
28
64
|
innerHTML: string | ref<string>;
|
|
29
|
-
style:
|
|
65
|
+
style: CSSStyleDeclarationRef;
|
|
30
66
|
variant: string | ref<string> | undefined;
|
|
31
67
|
disabled: boolean | ref<boolean>;
|
|
32
68
|
onInit(): void;
|
|
@@ -40,7 +76,7 @@ declare global {
|
|
|
40
76
|
|
|
41
77
|
interface HTMLElement {
|
|
42
78
|
innerHTML: string | ref<string>;
|
|
43
|
-
style:
|
|
79
|
+
style: CSSStyleDeclarationRef;
|
|
44
80
|
disabled: boolean | ref<boolean>;
|
|
45
81
|
onInit(): void;
|
|
46
82
|
unmount(): void;
|