motion-v 0.11.0-beta.2 → 0.11.0-beta.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.
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { DefineComponent, ExtractPropTypes, ExtractPublicPropTypes, IntrinsicElementAttributes } from 'vue';
|
|
2
2
|
import { MotionProps } from './Motion';
|
|
3
|
+
import { MotionHTMLAttributes } from '../../types';
|
|
3
4
|
type ComponentProps<T> = T extends DefineComponent<ExtractPropTypes<infer Props>, any, any> ? ExtractPublicPropTypes<Props> : never;
|
|
4
5
|
type MotionComponentProps = {
|
|
5
6
|
create: <T extends DefineComponent>(T: any) => DefineComponent<MotionProps<any, unknown> & ComponentProps<T>>;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
type MotionNameSpace = {
|
|
9
|
+
[K in keyof IntrinsicElementAttributes]: DefineComponent<MotionProps<K, unknown> & MotionHTMLAttributes<K>>;
|
|
10
|
+
} & {
|
|
8
11
|
create: MotionComponentProps['create'];
|
|
9
|
-
}
|
|
12
|
+
};
|
|
10
13
|
export declare const motion: MotionNameSpace;
|
|
11
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MotionValue } from 'framer-motion/dom';
|
|
2
|
-
import { Options } from './state';
|
|
3
|
-
import { AriaAttributes, Events, SVGAttributes } from 'vue';
|
|
2
|
+
import { ElementType, Options } from './state';
|
|
3
|
+
import { AriaAttributes, Events, IntrinsicElementAttributes, SVGAttributes } from 'vue';
|
|
4
4
|
type EventHandlers<E> = {
|
|
5
5
|
[K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void;
|
|
6
6
|
};
|
|
@@ -88,4 +88,6 @@ export interface SVGAttributesWithMotionValues {
|
|
|
88
88
|
export type SetMotionValueType<T, Keys extends keyof T> = {
|
|
89
89
|
[K in keyof T]: K extends Keys ? SVGAttributesAsMotionValues : T[K];
|
|
90
90
|
};
|
|
91
|
+
type IntrinsicElementAttributesAsMotionValues = SetMotionValueType<IntrinsicElementAttributes, keyof SVGAttributesWithMotionValues>;
|
|
92
|
+
export type MotionHTMLAttributes<C extends ElementType> = Omit<IntrinsicElementAttributesAsMotionValues[C], keyof Options | 'style' | 'as' | 'asChild'>;
|
|
91
93
|
export {};
|