📄 utils/types¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 📦 Imports | 7 |
| 🔄 Re-exports | 1 |
| 📐 Interfaces | 4 |
| 📑 Type Aliases | 21 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/shared/utils/types.ts
📦 Imports¶
| Name | Source |
|---|---|
ComputedRef |
vue |
getCurrentInstance |
vue |
MaybeRef |
vue |
Ref |
vue |
ShallowRef |
vue |
WatchOptions |
vue |
WatchSource |
vue |
Re-exports¶
| Type | Source | Exported Names |
|---|---|---|
| named | vue |
MultiWatchSources |
Interfaces¶
Pausable¶
Interface Code
Properties¶
| Name | Type | Optional | Description |
|---|---|---|---|
isActive |
Readonly<ShallowRef<boolean>> |
✗ | not shown |
pause |
Fn |
✗ | not shown |
resume |
Fn |
✗ | not shown |
Stoppable<StartFnArgs extends any[] = any[]>¶
Interface Code
Properties¶
| Name | Type | Optional | Description |
|---|---|---|---|
isPending |
Readonly<Ref<boolean>> |
✗ | not shown |
stop |
Fn |
✗ | not shown |
start |
(...args: StartFnArgs) => void |
✗ | not shown |
ConfigurableFlush¶
Interface Code
Properties¶
| Name | Type | Optional | Description |
|---|---|---|---|
flush |
WatchOptionFlush |
✓ | not shown |
ConfigurableFlushSync¶
Interface Code
Properties¶
| Name | Type | Optional | Description |
|---|---|---|---|
flush |
WatchOptionFlush |
✓ | not shown |
Type Aliases¶
Fn¶
/* * Void function /
AnyFn¶
/* * Any function /
RemovableRef<T>¶
/* * A ref that allow to set null or undefined /
ReadonlyRefOrGetter<T>¶
/* * Maybe it's a computed ref, or a readonly value, or a getter function /
DeepMaybeRef<T>¶
/*
* Make all the nested attributes of an object or array to MaybeRefreactive or ref
*
* ts
* UnwrapRef<DeepMaybeRef<T>> === T
*
type DeepMaybeRef<T> = T extends Ref<infer V>
? MaybeRef<V>
: T extends Array<any> | object
? { [K in keyof T]: DeepMaybeRef<T[K]> }
: MaybeRef<T>;
Arrayable<T>¶
ElementOf<T>¶
/* * Infers the element type of an array /
ShallowUnwrapRef<T>¶
Awaitable<T>¶
ArgumentsType<T>¶
Awaited<T>¶
/* * Compatible with versions below TypeScript 4.5 Awaited /
type Awaited<T> = T extends null | undefined ? T // special case for `null | undefined` when not in `--strictNullChecks` mode
: T extends object & { then: (onfulfilled: infer F, ...args: infer _) => any } // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
? F extends ((value: infer V, ...args: infer _) => any) // if the argument to `then` is callable, extracts the first argument
? Awaited<V> // recursively unwrap the value
: never // the argument to `then` was not callable
: T;
Promisify<T>¶
PromisifyFn<T extends AnyFn>¶
WatchOptionFlush¶
MapSources<T>¶
MapOldSources<T, Immediate>¶
type MapOldSources<T, Immediate> = {
[K in keyof T]: T[K] extends WatchSource<infer V> ? Immediate extends true ? V | undefined : V : never;
};
Mutable<T>¶
IfAny<T, Y, N>¶
IsAny<T>¶
/*
* will return true if T is any, or false otherwise
/
TimerHandle¶
/* * Universal timer handle that works in both browser and Node.js environments /
InstanceProxy¶
Generated by Syntax Scribe