-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
path-object.ts
69 lines (62 loc) · 1.16 KB
/
path-object.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* @file Interfaces - PathObject
* @module pathe/interfaces/PathObject
*/
import type { Optional } from '@flex-development/tutils'
/**
* Object representing a path.
*/
interface PathObject {
/**
* File name including extension (if any).
*
* **Note**: Takes precedence over {@linkcode ext} and {@linkcode name}.
*
* @example
* 'index.html'
*/
base?: Optional<string>
/**
* Directory name or full directory path.
*
* **Note**: Takes precedence over {@linkcode root}.
*
* @example
* 'c:\\path\\dir'
* @example
* '/home/user/dir'
*/
dir?: Optional<string>
/**
* File extension (if any).
*
* **Note**: Ignored if {@linkcode base} exists.
*
* @example
* '.html'
* @example
* 'ts'
*/
ext?: Optional<string>
/**
* File name without extension (if any).
*
* **Note**: Ignored if {@linkcode base} exists.
*
* @example
* 'index'
*/
name?: Optional<string>
/**
* Root of path.
*
* **Note**: Ignored if {@linkcode dir} is provided.
*
* @example
* '/'
* @example
* 'c:\\'
*/
root?: Optional<string>
}
export type { PathObject as default }