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 Jun 20, 2023
1 parent fd7d0b3 commit 7cfacf3
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 7cfacf3

Please sign in to comment.