Skip to content

Commit

Permalink
Merge pull request #49 from GaoNeng-wWw/feat/props-type-utils
Browse files Browse the repository at this point in the history
feat(tools): props type tools
  • Loading branch information
GaoNeng-wWw authored Nov 15, 2024
2 parents 3a3b33f + 981d77b commit 9cf072d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/slimy-buckets-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@qwqui/tools": major
---

Add props type
3 changes: 2 additions & 1 deletion packages/tools/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './factory';
export * from './resolveCssVar';
export * from './resolveCssVar';
export * from './props-type';
13 changes: 13 additions & 0 deletions packages/tools/props-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { CSSProperties, ReactNode } from "react";

export type DefaultPropType = {
w: number;
h: number;
className: string;
style: CSSProperties;
children: ReactNode;
} & {}

export type PropsType<T = unknown> = T & DefaultPropType
export type PropsTypeOptional<T = unknown> = Partial<T & DefaultPropType>
export type PropsTypePartialDefault<T = unknown> = T & Partial<DefaultPropType>;

0 comments on commit 9cf072d

Please sign in to comment.