routie dev init since i didn't adhere to any proper guidance up until now
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
import type { PropType, StyleValue } from 'vue';
|
||||
export type ClassValue = any;
|
||||
export interface ComponentProps {
|
||||
class: ClassValue;
|
||||
style: StyleValue | undefined;
|
||||
}
|
||||
export declare const makeComponentProps: <Defaults extends {
|
||||
class?: unknown;
|
||||
style?: unknown;
|
||||
} = {}>(defaults?: Defaults | undefined) => {
|
||||
class: unknown extends Defaults["class"] ? PropType<any> : {
|
||||
type: PropType<unknown extends Defaults["class"] ? any : any>;
|
||||
default: unknown extends Defaults["class"] ? any : any;
|
||||
};
|
||||
style: unknown extends Defaults["style"] ? {
|
||||
type: PropType<StyleValue>;
|
||||
default: null;
|
||||
} : Omit<{
|
||||
type: PropType<StyleValue>;
|
||||
default: null;
|
||||
}, "default" | "type"> & {
|
||||
type: PropType<unknown extends Defaults["style"] ? StyleValue : Defaults["style"] | StyleValue>;
|
||||
default: unknown extends Defaults["style"] ? StyleValue : Defaults["style"] | NonNullable<StyleValue>;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user