dothtml-interfaces 0.3.2 → 0.3.4
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
CHANGED
package/src/i-dot.d.ts
CHANGED
|
@@ -382,7 +382,7 @@ export interface IDotCore extends IDotDocument {
|
|
|
382
382
|
// Works but doesn't infer types from the component.
|
|
383
383
|
// There's room for improvement here but it's not clear to me how to do it.
|
|
384
384
|
// What I'd like to do is have the types tied to the IComponent interface rather than the component factory function.
|
|
385
|
-
component<TProps extends string[] = [], TEvents extends string[] = []>(Base: new () => IComponent)
|
|
385
|
+
component<TProps extends string[] = [], TEvents extends string[] = []>(Base: new () => IComponent, styles?: string|IDotcssProp|Array<string|IDotcssProp>)
|
|
386
386
|
: new (attrs?: ComponentArgs<TProps, TEvents>) => IComponent & { new (attrs?: ComponentArgs<TProps, TEvents>): IComponent };
|
|
387
387
|
|
|
388
388
|
useStyles(document: Document, styles: Styles): HTMLStyleElement;
|
|
@@ -4,9 +4,9 @@ import { GKV } from "../css-types";
|
|
|
4
4
|
|
|
5
5
|
type LengthUnitSuffix = "" | "Cm" | "Ch" | "Em" | "Ex" | "In" | "Mm" | "P" | "Pc" | "Pt" | "Px" | "Rem" | "Vh" | "Vw" | "VMax" | "VMin";
|
|
6
6
|
|
|
7
|
-
type V<S> = IReactive<
|
|
7
|
+
type V<S> = IReactive<any> | number | S;
|
|
8
8
|
|
|
9
|
-
type LengthProp<Prefix extends string, Qty extends 1|2|3|4 = 1, S extends string|IReactive<
|
|
9
|
+
type LengthProp<Prefix extends string, Qty extends 1|2|3|4 = 1, S extends string|IReactive<any> = GKV> = {
|
|
10
10
|
[Key in LengthUnitSuffix as `${Prefix}${Key}`]?: (
|
|
11
11
|
(Qty extends 1 ? V<S>|[V<S>] : void) |
|
|
12
12
|
(Qty extends 2 ? [V<S>, V<S>] : void) |
|