mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
⚙️ Add utility types for component props handling
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export type WithoutChild<T> = T extends { child?: unknown }
|
||||
? Omit<T, "child">
|
||||
: T;
|
||||
|
||||
export type WithoutChildren<T> = T extends { children?: unknown }
|
||||
? Omit<T, "children">
|
||||
: T;
|
||||
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
|
||||
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
|
||||
ref?: U | null;
|
||||
};
|
||||
Reference in New Issue
Block a user