Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Nov 14, 2024
1 parent 0c094d0 commit 7659405
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/oruga/src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export type PropBind =
/** Vue native dynamic component 'is' property value type */
export type DynamicComponent = string | object | CallableFunction | Component;

/** Define a property as required */
/** Define a property as required */
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };

/**
* Extract all properties of an object which starts with an `on` prefix.
* Extract all properties of an object which starts with a `on` prefix.
* It also cuts the `on` prefix and lowercase the first char.
*/
type ComponentEmitsByProps<T> = {
Expand All @@ -34,7 +34,7 @@ type ComponentEmitsByProps<T> = {
};

/**
* Custom ComponentEmits helper which defines the emits of an component as object.
* Custom type helper which extracts the `$emits` type of an component as object.
*
* Because the `ComponentEmit` from "vue-component-type-helpers" does not export the emits as an object but as:
* `((event: "close", ...args: any[]) => void) | undefined`
Expand All @@ -46,7 +46,7 @@ type TypeOfKey<T, K extends string> = K extends keyof T ? T[K] : unknown;

/**
* Extracts the type of a deep property `K` within an object `T`.
* `K` can be defined as property path with `.` seperator.
* Property `K` can be defined as a property path with `.` seperator.
*/
export type DeepType<T, K> = T extends object
? K extends string
Expand Down

0 comments on commit 7659405

Please sign in to comment.