Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ubugeeei committed Sep 18, 2024
1 parent 4a4556e commit 6d5e647
Show file tree
Hide file tree
Showing 36 changed files with 640 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export type EmitsOptions = ObjectEmitsOptions | string[]
export type EmitFn<
Options = ObjectEmitsOptions,
Event extends keyof Options = keyof Options,
> = Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>
> =
Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>

export function emit(
instance: ComponentInternalInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export type EmitsOptions = ObjectEmitsOptions | string[]
export type EmitFn<
Options = ObjectEmitsOptions,
Event extends keyof Options = keyof Options,
> = Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>
> =
Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>

export function emit(
instance: ComponentInternalInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export type EmitsOptions = ObjectEmitsOptions | string[]
export type EmitFn<
Options = ObjectEmitsOptions,
Event extends keyof Options = keyof Options,
> = Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>
> =
Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>

export function emit(
instance: ComponentInternalInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export type EmitsOptions = ObjectEmitsOptions | string[]
export type EmitFn<
Options = ObjectEmitsOptions,
Event extends keyof Options = keyof Options,
> = Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>
> =
Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>

export function emit(
instance: ComponentInternalInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export type EmitsOptions = ObjectEmitsOptions | string[]
export type EmitFn<
Options = ObjectEmitsOptions,
Event extends keyof Options = keyof Options,
> = Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>
> =
Options extends Array<infer V>
? (event: V, ...args: any[]) => void
: {} extends Options // if the emit is empty object (usually the default value for emit) should be converted to function
? (event: string, ...args: any[]) => void
: UnionToIntersection<
{
[key in Event]: Options[key] extends (...args: infer Args) => any
? (event: key, ...args: Args) => void
: (event: key, ...args: any[]) => void
}[Event]
>

export function emit(
instance: ComponentInternalInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ class ObjectRefImpl<T extends object, K extends keyof T> {
type BaseTypes = string | number | boolean
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
export type UnwrapRef<T> =
T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand Down
Loading

0 comments on commit 6d5e647

Please sign in to comment.