Skip to content

Commit

Permalink
feat: create PropsOf type
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga committed May 12, 2023
1 parent 1cf9032 commit 692cf09
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/types/util.d.ts
@@ -0,0 +1,12 @@
import { VNodeProps, AllowedComponentProps } from 'vue';

/**
* Extract the type of a component's props in a usable format for defineProps
*/
export type PropsOf<T extends { $props: Record<string, never> }> = Omit<
T['$props'],
| keyof VNodeProps
| keyof AllowedComponentProps
| `$${string}`
| `v-slot${string}`
>;

0 comments on commit 692cf09

Please sign in to comment.