Skip to content

Commit 5c3e745

Browse files
committed
chore: mark type as internal
1 parent 261c527 commit 5c3e745

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/core/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import type { RouteRecordOverride, TreeRouteParam } from './treeNodeValue'
33
import { pascalCase } from 'scule'
44
import { ResolvedOptions, RoutesFolderOption } from '../options'
55

6-
export type Awaitable<T> = T | PromiseLike<T>
6+
/**
7+
* Maybe a promise maybe not
8+
* @internal
9+
*/
10+
export type _Awaitable<T> = T | PromiseLike<T>
711

812
export type LiteralStringUnion<LiteralType, BaseType extends string = string> =
913
| LiteralType

src/data-fetching/dataFetchingGuard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DataLoader, isDataLoader } from './defineLoader'
22
import type { RouteLocationNormalized, Router } from 'vue-router'
3-
import { Awaitable } from '../core/utils'
3+
import { _Awaitable } from '../core/utils'
44

55
// Symbol used to detect if a route has loaders
66
export const HasDataLoaderMeta = Symbol()
@@ -40,7 +40,7 @@ export interface SetupDataFetchingGuardOptions {
4040
*/
4141
selectNavigationResult?: (
4242
results: NavigationResult[]
43-
) => Awaitable<NavigationResult | undefined | void>
43+
) => _Awaitable<NavigationResult | undefined | void>
4444
}
4545

4646
export function setupDataFetchingGuard(

src/options.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isPackageExists } from 'local-pkg'
2-
import { Awaitable, getFileBasedRouteName, isArray, warn } from './core/utils'
2+
import { _Awaitable, getFileBasedRouteName, isArray, warn } from './core/utils'
33
import type { TreeNode } from './core/tree'
44
import { resolve } from 'pathe'
55
import { EditableTreeNode } from './core/extendRoutes'
@@ -121,7 +121,7 @@ export interface ResolvedOptions {
121121
*
122122
* @param route - {@link EditableTreeNode} of the route to extend
123123
*/
124-
extendRoute?: (route: EditableTreeNode) => Awaitable<void>
124+
extendRoute?: (route: EditableTreeNode) => _Awaitable<void>
125125

126126
/**
127127
* Allows to do some changes before writing the files. This will be invoked **every time** the files need to be written.
@@ -130,7 +130,7 @@ export interface ResolvedOptions {
130130
*
131131
* @param rootRoute - {@link EditableTreeNode} of the root route
132132
*/
133-
beforeWriteFiles?: (rootRoute: EditableTreeNode) => Awaitable<void>
133+
beforeWriteFiles?: (rootRoute: EditableTreeNode) => _Awaitable<void>
134134

135135
/**
136136
* Enables EXPERIMENTAL data fetching. See https://github.com/posva/unplugin-vue-router/tree/main/src/data-fetching

0 commit comments

Comments
 (0)