@manyducks.co/dolla-styled 0.0.3 → 0.0.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/dist/styled.d.ts +8 -3
- package/package.json +1 -1
package/dist/styled.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type View } from "@manyducks.co/dolla";
|
|
2
|
+
export type CoreCSSSyntax = "*" | "<length>" | "<percentage>" | "<length-percentage>" | "<color>" | "<image>" | "<url>" | "<integer>" | "<number>" | "<angle>" | "<time>" | "<resolution>" | "<transform-function>" | "<transform-list>" | "<custom-ident>";
|
|
3
|
+
export type CSSSyntaxDescriptor = CoreCSSSyntax | (string & {});
|
|
4
|
+
export type InterpolationValue = string | number | null | undefined;
|
|
5
|
+
export type InterpolationFn<Props> = (props: Props) => InterpolationValue;
|
|
6
|
+
export type Interpolation<Props> = InterpolationValue | InterpolationFn<Props> | [InterpolationFn<Props>, CSSSyntaxDescriptor, InterpolationValue];
|
|
2
7
|
type StyledProps = {
|
|
3
8
|
as?: keyof JSX.IntrinsicElements | string;
|
|
4
9
|
};
|
|
@@ -8,7 +13,7 @@ type Flatten<T> = {
|
|
|
8
13
|
[K in keyof T]: T[K];
|
|
9
14
|
} & {};
|
|
10
15
|
interface TypedTemplateFn<Props> {
|
|
11
|
-
(strings: TemplateStringsArray, ...interpolations:
|
|
16
|
+
(strings: TemplateStringsArray, ...interpolations: Interpolation<Props>[]): StyledView<Props>;
|
|
12
17
|
/**
|
|
13
18
|
* Provides a name for the underlying view.
|
|
14
19
|
*/
|
|
@@ -16,10 +21,10 @@ interface TypedTemplateFn<Props> {
|
|
|
16
21
|
/**
|
|
17
22
|
* Provides default props that are passed to all instances unless overridden.
|
|
18
23
|
*/
|
|
19
|
-
defaults<D extends Partial<Props>>(defaultProps: D): (strings: TemplateStringsArray, ...interpolations:
|
|
24
|
+
defaults<D extends Partial<Props>>(defaultProps: D): (strings: TemplateStringsArray, ...interpolations: Interpolation<Props>[]) => StyledView<Flatten<ApplyDefaults<Props, D>>>;
|
|
20
25
|
}
|
|
21
26
|
interface TemplateFn<BaseProps = {}> {
|
|
22
|
-
(strings: TemplateStringsArray, ...interpolations:
|
|
27
|
+
(strings: TemplateStringsArray, ...interpolations: Interpolation<BaseProps>[]): StyledView<BaseProps>;
|
|
23
28
|
/**
|
|
24
29
|
* Provides a name for the underlying view.
|
|
25
30
|
*/
|