platformdirs 4.3.7 → 4.3.8-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts DELETED
@@ -1,238 +0,0 @@
1
- /**
2
- * @module
3
- *
4
- * platformdirs is a library to determine platform-specific system directories. This includes directories where to place cache files, user data, configuration, etc.
5
- *
6
- * The source code and issue tracker are both hosted on [GitHub](https://github.com/jcbhmr/platformdirs.js).
7
- *
8
- * Utilities for determining application-specific dirs.
9
- *
10
- * See https://github.com/platformdirs/platformdirs for details and usage.
11
- */
12
- import type { Android } from "./android.js";
13
- import type { MacOS } from "./macos.js";
14
- import type { Unix } from "./unix.js";
15
- import type { Windows } from "./windows.js";
16
- export type PlatformDirs = Windows | MacOS | Unix | Android;
17
- export declare const PlatformDirs: typeof Windows | typeof MacOS | typeof Unix | typeof Android;
18
- export declare const AppDirs: typeof Windows | typeof MacOS | typeof Unix | typeof Android;
19
- /**
20
- *
21
- * @param appname See {@link PlatformDirs.appname}
22
- * @param appauthor See {@link PlatformDirs.appauthor}
23
- * @param version See {@link PlatformDirs.version}
24
- * @param roaming See {@link PlatformDirs.roaming}
25
- * @param ensureExists See {@link PlatformDirs.ensureExists}
26
- * @returns data directory tied to the user
27
- */
28
- export declare function userDataDir(appname?: string, appauthor?: string | false, version?: string, roaming?: boolean, ensureExists?: boolean): string;
29
- /**
30
- *
31
- * @param appname See {@link PlatformDirs.appname}
32
- * @param appauthor See {@link PlatformDirs.appauthor}
33
- * @param version See {@link PlatformDirs.version}
34
- * @param multipath See {@link PlatformDirs.multipath}
35
- * @param ensureExists See {@link PlatformDirs.ensureExists}
36
- * @returns data directory shared by users
37
- */
38
- export declare function siteDataDir(appname?: string, appauthor?: string | false, version?: string, multipath?: boolean, ensureExists?: boolean): string;
39
- /**
40
- * @param appname See {@link PlatformDirs.appname}
41
- * @param appauthor See {@link PlatformDirs.appauthor}
42
- * @param version See {@link PlatformDirs.version}
43
- * @param roaming See {@link PlatformDirs.roaming}
44
- * @param ensureExists See {@link PlatformDirs.ensureExists}
45
- * @returns config directory tied to the user
46
- */
47
- export declare function userConfigDir(appname?: string, appauthor?: string | false, version?: string, roaming?: boolean, ensureExists?: boolean): string;
48
- /**
49
- * @param appname See {@link PlatformDirs.appname}
50
- * @param appauthor See {@link PlatformDirs.appauthor}
51
- * @param version See {@link PlatformDirs.version}
52
- * @param multipath See {@link PlatformDirs.multipath}
53
- * @param ensureExists See {@link PlatformDirs.ensureExists}
54
- * @returns config directory shared by users
55
- */
56
- export declare function siteConfigDir(appname?: string, appauthor?: string | false, version?: string, multipath?: boolean, ensureExists?: boolean): string;
57
- /**
58
- * @param appname See {@link PlatformDirs.appname}
59
- * @param appauthor See {@link PlatformDirs.appauthor}
60
- * @param version See {@link PlatformDirs.version}
61
- * @param opinion See {@link PlatformDirs.opinion}
62
- * @param ensureExists See {@link PlatformDirs.ensureExists}
63
- * @returns cache directory tied to the user
64
- */
65
- export declare function userCacheDir(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
66
- /**
67
- * @param appname See {@link PlatformDirs.appname}
68
- * @param appauthor See {@link PlatformDirs.appauthor}
69
- * @param version See {@link PlatformDirs.version}
70
- * @param opinion See {@link PlatformDirs.opinion}
71
- * @param ensureExists See {@link PlatformDirs.ensureExists}
72
- * @returns cache directory tied to the user
73
- */
74
- export declare function siteCacheDir(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
75
- /**
76
- * @param appname See {@link PlatformDirs.appname}
77
- * @param appauthor See {@link PlatformDirs.appauthor}
78
- * @param version See {@link PlatformDirs.version}
79
- * @param roaming See {@link PlatformDirs.roaming}
80
- * @param ensureExists See {@link PlatformDirs.ensureExists}
81
- * @returns state directory tied to the user
82
- */
83
- export declare function userStateDir(appname?: string, appauthor?: string | false, version?: string, roaming?: boolean, ensureExists?: boolean): string;
84
- /**
85
- * @param appname See {@link PlatformDirs.appname}
86
- * @param appauthor See {@link PlatformDirs.appauthor}
87
- * @param version See {@link PlatformDirs.version}
88
- * @param opinion See {@link PlatformDirs.opinion}
89
- * @param ensureExists See {@link PlatformDirs.ensureExists}
90
- * @returns log directory tied to the user
91
- */
92
- export declare function userLogDir(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
93
- /**
94
- * @returns documents directory tied to the user
95
- */
96
- export declare function userDocumentsDir(): string;
97
- /**
98
- * @returns downloads directory tied to the user
99
- */
100
- export declare function userDownloadsDir(): string;
101
- /**
102
- * @returns pictures directory tied to the user
103
- */
104
- export declare function userPicturesDir(): string;
105
- /**
106
- * @returns videos directory tied to the user
107
- */
108
- export declare function userVideosDir(): string;
109
- /**
110
- * @returns music directory tied to the user
111
- */
112
- export declare function userMusicDir(): string;
113
- /**
114
- * @returns desktop directory tied to the user
115
- */
116
- export declare function userDesktopDir(): string;
117
- /**
118
- * @param appname See {@link PlatformDirs.appname}
119
- * @param appauthor See {@link PlatformDirs.appauthor}
120
- * @param version See {@link PlatformDirs.version}
121
- * @param opinion See {@link PlatformDirs.opinion}
122
- * @param ensureExists See {@link PlatformDirs.ensureExists}
123
- * @returns runtime directory tied to the user
124
- */
125
- export declare function userRuntimeDir(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
126
- /**
127
- * @param appname See {@link PlatformDirs.appname}
128
- * @param appauthor See {@link PlatformDirs.appauthor}
129
- * @param version See {@link PlatformDirs.version}
130
- * @param opinion See {@link PlatformDirs.opinion}
131
- * @param ensureExists See {@link PlatformDirs.ensureExists}
132
- * @returns runtime directory shared by users
133
- */
134
- export declare function siteRuntimeDir(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
135
- /**
136
- * @param appname See {@link PlatformDirs.appname}
137
- * @param appauthor See {@link PlatformDirs.appauthor}
138
- * @param version See {@link PlatformDirs.version}
139
- * @param roaming See {@link PlatformDirs.roaming}
140
- * @param ensureExists See {@link PlatformDirs.ensureExists}
141
- * @returns data path tied to the user
142
- */
143
- export declare function userDataPath(appname?: string, appauthor?: string | false, version?: string, roaming?: boolean, ensureExists?: boolean): string;
144
- /**
145
- * @param appname See {@link PlatformDirs.appname}
146
- * @param appauthor See {@link PlatformDirs.appauthor}
147
- * @param version See {@link PlatformDirs.version}
148
- * @param multipath See {@link PlatformDirs.multipath}
149
- * @param ensureExists See {@link PlatformDirs.ensureExists}
150
- * @returns data path shared by users
151
- */
152
- export declare function siteDataPath(appname?: string, appauthor?: string | false, version?: string, multipath?: boolean, ensureExists?: boolean): string;
153
- /**
154
- * @param appname See {@link PlatformDirs.appname}
155
- * @param appauthor See {@link PlatformDirs.appauthor}
156
- * @param version See {@link PlatformDirs.version}
157
- * @param roaming See {@link PlatformDirs.roaming}
158
- * @param ensureExists See {@link PlatformDirs.ensureExists}
159
- * @returns config path tied to the user
160
- */
161
- export declare function userConfigPath(appname?: string, appauthor?: string | false, version?: string, roaming?: boolean, ensureExists?: boolean): string;
162
- /**
163
- * @param appname See {@link PlatformDirs.appname}
164
- * @param appauthor See {@link PlatformDirs.appauthor}
165
- * @param version See {@link PlatformDirs.version}
166
- * @param multipath See {@link PlatformDirs.multipath}
167
- * @param ensureExists See {@link PlatformDirs.ensureExists}
168
- * @returns config path shared by the users
169
- */
170
- export declare function siteConfigPath(appname?: string, appauthor?: string | false, version?: string, multipath?: boolean, ensureExists?: boolean): string;
171
- /**
172
- * @param appname See {@link PlatformDirs.appname}
173
- * @param appauthor See {@link PlatformDirs.appauthor}
174
- * @param version See {@link PlatformDirs.version}
175
- * @param opinion See {@link PlatformDirs.opinion}
176
- * @param ensureExists See {@link PlatformDirs.ensureExists}
177
- * @returns cache path shared by users
178
- */
179
- export declare function siteCachePath(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
180
- /**
181
- * @param appname See {@link PlatformDirs.appname}
182
- * @param appauthor See {@link PlatformDirs.appauthor}
183
- * @param version See {@link PlatformDirs.version}
184
- * @param opinion See {@link PlatformDirs.opinion}
185
- * @param ensureExists See {@link PlatformDirs.ensureExists}
186
- * @returns cache path tied to the user
187
- */
188
- export declare function userCachePath(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
189
- /**
190
- * @param appname See {@link PlatformDirs.appname}
191
- * @param appauthor See {@link PlatformDirs.appauthor}
192
- * @param version See {@link PlatformDirs.version}
193
- * @param roaming See {@link PlatformDirs.roaming}
194
- * @param ensureExists See {@link PlatformDirs.ensureExists}
195
- * @returns state path tied to the user
196
- */
197
- export declare function userStatePath(appname?: string, appauthor?: string | false, version?: string, roaming?: boolean, ensureExists?: boolean): string;
198
- /**
199
- * @param appname See {@link PlatformDirs.appname}
200
- * @param appauthor See {@link PlatformDirs.appauthor}
201
- * @param version See {@link PlatformDirs.version}
202
- * @param opinion See {@link PlatformDirs.opinion}
203
- * @param ensureExists See {@link PlatformDirs.ensureExists}
204
- * @returns log path tied to the user
205
- */
206
- export declare function userLogPath(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
207
- /** @returns documents path tied to the user */
208
- export declare function userDocumentsPath(): string;
209
- /** @returns downloads path tied to the user */
210
- export declare function userDownloadsPath(): string;
211
- /** @returns pictures path tied to the user */
212
- export declare function userPicturesPath(): string;
213
- /** @returns videos path tied to the user */
214
- export declare function userVideosPath(): string;
215
- /** @returns music path tied to the user */
216
- export declare function userMusicPath(): string;
217
- /** @returns desktop path tied to the user */
218
- export declare function userDesktopPath(): string;
219
- /**
220
- * @param appname See {@link PlatformDirs.appname}
221
- * @param appauthor See {@link PlatformDirs.appauthor}
222
- * @param version See {@link PlatformDirs.version}
223
- * @param opinion See {@link PlatformDirs.opinion}
224
- * @param ensureExists See {@link PlatformDirs.ensureExists}
225
- * @returns runtime path tied to the user
226
- */
227
- export declare function userRuntimePath(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
228
- /**
229
- * @param appname See {@link PlatformDirs.appname}
230
- * @param appauthor See {@link PlatformDirs.appauthor}
231
- * @param version See {@link PlatformDirs.version}
232
- * @param opinion See {@link PlatformDirs.opinion}
233
- * @param ensureExists See {@link PlatformDirs.ensureExists}
234
- * @returns runtime path shared by users
235
- */
236
- export declare function siteRuntimePath(appname?: string, appauthor?: string | false, version?: string, opinion?: boolean, ensureExists?: boolean): string;
237
- export { PlatformDirsABC } from "./api.js";
238
- export { version, versionTuple as versionInfo } from "./version.js";
package/dist/index.js DELETED
@@ -1,322 +0,0 @@
1
- /**
2
- * @module
3
- *
4
- * platformdirs is a library to determine platform-specific system directories. This includes directories where to place cache files, user data, configuration, etc.
5
- *
6
- * The source code and issue tracker are both hosted on [GitHub](https://github.com/jcbhmr/platformdirs.js).
7
- *
8
- * Utilities for determining application-specific dirs.
9
- *
10
- * See https://github.com/platformdirs/platformdirs for details and usage.
11
- */
12
- import process from "node:process";
13
- let Result;
14
- if (process.platform === "win32") {
15
- ({ Windows: Result } = await import("./windows.js"));
16
- }
17
- else if (process.platform === "darwin") {
18
- ({ MacOS: Result } = await import("./macos.js"));
19
- }
20
- else {
21
- ({ Unix: Result } = await import("./unix.js"));
22
- }
23
- async function setPlatformDirClass() {
24
- if (process.env.ANDROID_DATA === "/data" &&
25
- process.env.ANDROID_ROOT === "/system") {
26
- if (process.env.SHELL || process.env.PREFIX) {
27
- return Result;
28
- }
29
- const { _androidFolder } = await import("./android.js");
30
- if (_androidFolder() != null) {
31
- const { Android } = await import("./android.js");
32
- return Android;
33
- }
34
- }
35
- return Result;
36
- }
37
- export const PlatformDirs = (await setPlatformDirClass());
38
- export const AppDirs = PlatformDirs;
39
- /**
40
- *
41
- * @param appname See {@link PlatformDirs.appname}
42
- * @param appauthor See {@link PlatformDirs.appauthor}
43
- * @param version See {@link PlatformDirs.version}
44
- * @param roaming See {@link PlatformDirs.roaming}
45
- * @param ensureExists See {@link PlatformDirs.ensureExists}
46
- * @returns data directory tied to the user
47
- */
48
- export function userDataDir(appname, appauthor, version, roaming = false, ensureExists = false) {
49
- return new PlatformDirs(appname, appauthor, version, roaming, undefined, undefined, ensureExists).userDataDir;
50
- }
51
- /**
52
- *
53
- * @param appname See {@link PlatformDirs.appname}
54
- * @param appauthor See {@link PlatformDirs.appauthor}
55
- * @param version See {@link PlatformDirs.version}
56
- * @param multipath See {@link PlatformDirs.multipath}
57
- * @param ensureExists See {@link PlatformDirs.ensureExists}
58
- * @returns data directory shared by users
59
- */
60
- export function siteDataDir(appname, appauthor, version, multipath = false, ensureExists = false) {
61
- return new PlatformDirs(appname, appauthor, version, undefined, multipath, undefined, ensureExists).siteDataDir;
62
- }
63
- /**
64
- * @param appname See {@link PlatformDirs.appname}
65
- * @param appauthor See {@link PlatformDirs.appauthor}
66
- * @param version See {@link PlatformDirs.version}
67
- * @param roaming See {@link PlatformDirs.roaming}
68
- * @param ensureExists See {@link PlatformDirs.ensureExists}
69
- * @returns config directory tied to the user
70
- */
71
- export function userConfigDir(appname, appauthor, version, roaming = false, ensureExists = false) {
72
- return new PlatformDirs(appname, appauthor, version, roaming, undefined, undefined, ensureExists).userConfigDir;
73
- }
74
- /**
75
- * @param appname See {@link PlatformDirs.appname}
76
- * @param appauthor See {@link PlatformDirs.appauthor}
77
- * @param version See {@link PlatformDirs.version}
78
- * @param multipath See {@link PlatformDirs.multipath}
79
- * @param ensureExists See {@link PlatformDirs.ensureExists}
80
- * @returns config directory shared by users
81
- */
82
- export function siteConfigDir(appname, appauthor, version, multipath = false, ensureExists = false) {
83
- return new PlatformDirs(appname, appauthor, version, undefined, multipath, undefined, ensureExists).siteConfigDir;
84
- }
85
- /**
86
- * @param appname See {@link PlatformDirs.appname}
87
- * @param appauthor See {@link PlatformDirs.appauthor}
88
- * @param version See {@link PlatformDirs.version}
89
- * @param opinion See {@link PlatformDirs.opinion}
90
- * @param ensureExists See {@link PlatformDirs.ensureExists}
91
- * @returns cache directory tied to the user
92
- */
93
- export function userCacheDir(appname, appauthor, version, opinion = true, ensureExists = false) {
94
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).userCacheDir;
95
- }
96
- /**
97
- * @param appname See {@link PlatformDirs.appname}
98
- * @param appauthor See {@link PlatformDirs.appauthor}
99
- * @param version See {@link PlatformDirs.version}
100
- * @param opinion See {@link PlatformDirs.opinion}
101
- * @param ensureExists See {@link PlatformDirs.ensureExists}
102
- * @returns cache directory tied to the user
103
- */
104
- export function siteCacheDir(appname, appauthor, version, opinion = true, ensureExists = false) {
105
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).siteCacheDir;
106
- }
107
- /**
108
- * @param appname See {@link PlatformDirs.appname}
109
- * @param appauthor See {@link PlatformDirs.appauthor}
110
- * @param version See {@link PlatformDirs.version}
111
- * @param roaming See {@link PlatformDirs.roaming}
112
- * @param ensureExists See {@link PlatformDirs.ensureExists}
113
- * @returns state directory tied to the user
114
- */
115
- export function userStateDir(appname, appauthor, version, roaming = false, ensureExists = false) {
116
- return new PlatformDirs(appname, appauthor, version, roaming, undefined, undefined, ensureExists).userStateDir;
117
- }
118
- /**
119
- * @param appname See {@link PlatformDirs.appname}
120
- * @param appauthor See {@link PlatformDirs.appauthor}
121
- * @param version See {@link PlatformDirs.version}
122
- * @param opinion See {@link PlatformDirs.opinion}
123
- * @param ensureExists See {@link PlatformDirs.ensureExists}
124
- * @returns log directory tied to the user
125
- */
126
- export function userLogDir(appname, appauthor, version, opinion = true, ensureExists = false) {
127
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).userLogDir;
128
- }
129
- /**
130
- * @returns documents directory tied to the user
131
- */
132
- export function userDocumentsDir() {
133
- return new PlatformDirs().userDocumentsDir;
134
- }
135
- /**
136
- * @returns downloads directory tied to the user
137
- */
138
- export function userDownloadsDir() {
139
- return new PlatformDirs().userDownloadsDir;
140
- }
141
- /**
142
- * @returns pictures directory tied to the user
143
- */
144
- export function userPicturesDir() {
145
- return new PlatformDirs().userPicturesDir;
146
- }
147
- /**
148
- * @returns videos directory tied to the user
149
- */
150
- export function userVideosDir() {
151
- return new PlatformDirs().userVideosDir;
152
- }
153
- /**
154
- * @returns music directory tied to the user
155
- */
156
- export function userMusicDir() {
157
- return new PlatformDirs().userMusicDir;
158
- }
159
- /**
160
- * @returns desktop directory tied to the user
161
- */
162
- export function userDesktopDir() {
163
- return new PlatformDirs().userDesktopDir;
164
- }
165
- /**
166
- * @param appname See {@link PlatformDirs.appname}
167
- * @param appauthor See {@link PlatformDirs.appauthor}
168
- * @param version See {@link PlatformDirs.version}
169
- * @param opinion See {@link PlatformDirs.opinion}
170
- * @param ensureExists See {@link PlatformDirs.ensureExists}
171
- * @returns runtime directory tied to the user
172
- */
173
- export function userRuntimeDir(appname, appauthor, version, opinion = true, ensureExists = false) {
174
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).userRuntimeDir;
175
- }
176
- /**
177
- * @param appname See {@link PlatformDirs.appname}
178
- * @param appauthor See {@link PlatformDirs.appauthor}
179
- * @param version See {@link PlatformDirs.version}
180
- * @param opinion See {@link PlatformDirs.opinion}
181
- * @param ensureExists See {@link PlatformDirs.ensureExists}
182
- * @returns runtime directory shared by users
183
- */
184
- export function siteRuntimeDir(appname, appauthor, version, opinion = true, ensureExists = false) {
185
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).siteRuntimeDir;
186
- }
187
- /**
188
- * @param appname See {@link PlatformDirs.appname}
189
- * @param appauthor See {@link PlatformDirs.appauthor}
190
- * @param version See {@link PlatformDirs.version}
191
- * @param roaming See {@link PlatformDirs.roaming}
192
- * @param ensureExists See {@link PlatformDirs.ensureExists}
193
- * @returns data path tied to the user
194
- */
195
- export function userDataPath(appname, appauthor, version, roaming = false, ensureExists = false) {
196
- return new PlatformDirs(appname, appauthor, version, roaming, undefined, undefined, ensureExists).userDataPath;
197
- }
198
- /**
199
- * @param appname See {@link PlatformDirs.appname}
200
- * @param appauthor See {@link PlatformDirs.appauthor}
201
- * @param version See {@link PlatformDirs.version}
202
- * @param multipath See {@link PlatformDirs.multipath}
203
- * @param ensureExists See {@link PlatformDirs.ensureExists}
204
- * @returns data path shared by users
205
- */
206
- export function siteDataPath(appname, appauthor, version, multipath = false, ensureExists = false) {
207
- return new PlatformDirs(appname, appauthor, version, undefined, multipath, undefined, ensureExists).siteDataPath;
208
- }
209
- /**
210
- * @param appname See {@link PlatformDirs.appname}
211
- * @param appauthor See {@link PlatformDirs.appauthor}
212
- * @param version See {@link PlatformDirs.version}
213
- * @param roaming See {@link PlatformDirs.roaming}
214
- * @param ensureExists See {@link PlatformDirs.ensureExists}
215
- * @returns config path tied to the user
216
- */
217
- export function userConfigPath(appname, appauthor, version, roaming = false, ensureExists = false) {
218
- return new PlatformDirs(appname, appauthor, version, roaming, undefined, undefined, ensureExists).userConfigPath;
219
- }
220
- /**
221
- * @param appname See {@link PlatformDirs.appname}
222
- * @param appauthor See {@link PlatformDirs.appauthor}
223
- * @param version See {@link PlatformDirs.version}
224
- * @param multipath See {@link PlatformDirs.multipath}
225
- * @param ensureExists See {@link PlatformDirs.ensureExists}
226
- * @returns config path shared by the users
227
- */
228
- export function siteConfigPath(appname, appauthor, version, multipath = false, ensureExists = false) {
229
- return new PlatformDirs(appname, appauthor, version, undefined, multipath, undefined, ensureExists).siteConfigPath;
230
- }
231
- /**
232
- * @param appname See {@link PlatformDirs.appname}
233
- * @param appauthor See {@link PlatformDirs.appauthor}
234
- * @param version See {@link PlatformDirs.version}
235
- * @param opinion See {@link PlatformDirs.opinion}
236
- * @param ensureExists See {@link PlatformDirs.ensureExists}
237
- * @returns cache path shared by users
238
- */
239
- export function siteCachePath(appname, appauthor, version, opinion = true, ensureExists = false) {
240
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).siteCachePath;
241
- }
242
- /**
243
- * @param appname See {@link PlatformDirs.appname}
244
- * @param appauthor See {@link PlatformDirs.appauthor}
245
- * @param version See {@link PlatformDirs.version}
246
- * @param opinion See {@link PlatformDirs.opinion}
247
- * @param ensureExists See {@link PlatformDirs.ensureExists}
248
- * @returns cache path tied to the user
249
- */
250
- export function userCachePath(appname, appauthor, version, opinion = true, ensureExists = false) {
251
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).userCachePath;
252
- }
253
- /**
254
- * @param appname See {@link PlatformDirs.appname}
255
- * @param appauthor See {@link PlatformDirs.appauthor}
256
- * @param version See {@link PlatformDirs.version}
257
- * @param roaming See {@link PlatformDirs.roaming}
258
- * @param ensureExists See {@link PlatformDirs.ensureExists}
259
- * @returns state path tied to the user
260
- */
261
- export function userStatePath(appname, appauthor, version, roaming = false, ensureExists = false) {
262
- return new PlatformDirs(appname, appauthor, version, roaming, undefined, undefined, ensureExists).userStatePath;
263
- }
264
- /**
265
- * @param appname See {@link PlatformDirs.appname}
266
- * @param appauthor See {@link PlatformDirs.appauthor}
267
- * @param version See {@link PlatformDirs.version}
268
- * @param opinion See {@link PlatformDirs.opinion}
269
- * @param ensureExists See {@link PlatformDirs.ensureExists}
270
- * @returns log path tied to the user
271
- */
272
- export function userLogPath(appname, appauthor, version, opinion = true, ensureExists = false) {
273
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).userLogPath;
274
- }
275
- /** @returns documents path tied to the user */
276
- export function userDocumentsPath() {
277
- return new PlatformDirs().userDocumentsPath;
278
- }
279
- /** @returns downloads path tied to the user */
280
- export function userDownloadsPath() {
281
- return new PlatformDirs().userDownloadsPath;
282
- }
283
- /** @returns pictures path tied to the user */
284
- export function userPicturesPath() {
285
- return new PlatformDirs().userPicturesPath;
286
- }
287
- /** @returns videos path tied to the user */
288
- export function userVideosPath() {
289
- return new PlatformDirs().userVideosPath;
290
- }
291
- /** @returns music path tied to the user */
292
- export function userMusicPath() {
293
- return new PlatformDirs().userMusicPath;
294
- }
295
- /** @returns desktop path tied to the user */
296
- export function userDesktopPath() {
297
- return new PlatformDirs().userDesktopPath;
298
- }
299
- /**
300
- * @param appname See {@link PlatformDirs.appname}
301
- * @param appauthor See {@link PlatformDirs.appauthor}
302
- * @param version See {@link PlatformDirs.version}
303
- * @param opinion See {@link PlatformDirs.opinion}
304
- * @param ensureExists See {@link PlatformDirs.ensureExists}
305
- * @returns runtime path tied to the user
306
- */
307
- export function userRuntimePath(appname, appauthor, version, opinion = true, ensureExists = false) {
308
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).userRuntimePath;
309
- }
310
- /**
311
- * @param appname See {@link PlatformDirs.appname}
312
- * @param appauthor See {@link PlatformDirs.appauthor}
313
- * @param version See {@link PlatformDirs.version}
314
- * @param opinion See {@link PlatformDirs.opinion}
315
- * @param ensureExists See {@link PlatformDirs.ensureExists}
316
- * @returns runtime path shared by users
317
- */
318
- export function siteRuntimePath(appname, appauthor, version, opinion = true, ensureExists = false) {
319
- return new PlatformDirs(appname, appauthor, version, undefined, undefined, opinion, ensureExists).siteRuntimePath;
320
- }
321
- export { PlatformDirsABC } from "./api.js";
322
- export { version, versionTuple as versionInfo } from "./version.js";
package/dist/macos.d.ts DELETED
@@ -1,97 +0,0 @@
1
- /**
2
- * @module
3
- * macOS.
4
- */
5
- import { PlatformDirsABC } from "./api.js";
6
- /**
7
- * Platform directories for the macOS operating system.
8
- *
9
- * Follows the guidance from [Apple documentation](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html). Makes use of the {@link PlatformDirsABC.appname}, {@link PlatformDirsABC.version}, {@link PlatformDirsABC.ensureExists}.
10
- */
11
- export declare class MacOS extends PlatformDirsABC {
12
- /**
13
- * @return data directory tied to the user, e.g. `~/Library/Application Support/$appname/$version`
14
- */
15
- get userDataDir(): string;
16
- /**
17
- * @return data directory shared by users, e.g. `/Library/Application
18
- * Support/$appname/$version`. If we're using a Node.js, Deno, or Bun binary
19
- * managed by [Homebrew](https://brew.sh), the directory will be under the
20
- * Homebrew prefix, e.g. `/opt/homebrew/share/$appname/$version`. If
21
- * {@link PlatformDirsABC.multipath} is enabled, and we're in Homebrew, the
22
- * response is a multi-path string separated by ":", e.g.
23
- * `/opt/homebrew/share/$appname/$version:/Library/Application
24
- * Support/$appname/$version`.
25
- */
26
- get siteDataDir(): string;
27
- /**
28
- * @return data path shared by users. Only return the first item, even if
29
- * `multipath` is enabled is set to `true`.
30
- */
31
- get siteDataPath(): string;
32
- /**
33
- * @return config directory tied to the user, same as `userDataDir`
34
- */
35
- get userConfigDir(): string;
36
- /**
37
- * @return config directory shared by users, same as `siteDataDir`
38
- */
39
- get siteConfigDir(): string;
40
- /**
41
- * @return cache directory tied to the user, e.g. `~/Library/Caches/$appname/$version`
42
- */
43
- get userCacheDir(): string;
44
- /**
45
- * @return cache directory shared by users, e.g. `/Library/Caches/$appname/$version`.
46
- * If we're using a Node.js, Deno, or Bun binary managed by [Homebrew](https://brew.sh),
47
- * the directory will be under the Homebrew prefix, e.g. `/opt/homebrew/var/cache/$appname/$version`.
48
- * If {@link PlatformDirsABC.multipath} is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g.
49
- * `/opt/homebrew/var/cache/$appname/$version:/Library/Caches/$appname/$version`.
50
- */
51
- get siteCacheDir(): string;
52
- /**
53
- * @return cache path shared by users. Only return the first item, even if
54
- * `multipath` is enabled is set to `true`.
55
- */
56
- get siteCachePath(): string;
57
- /**
58
- * @return state directory tied to the user, e.g. `~/Library/Application Support/$appname/$version`
59
- */
60
- get userStateDir(): string;
61
- /**
62
- * @return log directory tied to the user, e.g. `~/Library/Logs/$appname/$version`
63
- */
64
- get userLogDir(): string;
65
- /**
66
- * @return documents directory tied to the user, e.g. `~/Documents`
67
- */
68
- get userDocumentsDir(): string;
69
- /**
70
- * @return downloads directory tied to the user, e.g. `~/Downloads`
71
- */
72
- get userDownloadsDir(): string;
73
- /**
74
- * @return pictures directory tied to the user, e.g. `~/Pictures`
75
- */
76
- get userPicturesDir(): string;
77
- /**
78
- * @return videos directory tied to the user, e.g. `~/Movies`
79
- */
80
- get userVideosDir(): string;
81
- /**
82
- * @return music directory tied to the user, e.g. `~/Music`
83
- */
84
- get userMusicDir(): string;
85
- /**
86
- * @return desktop directory tied to the user, e.g. `~/Desktop`
87
- */
88
- get userDesktopDir(): string;
89
- /**
90
- * @return runtime directory tied to the user, e.g. `~/Library/Caches/TemporaryItems`
91
- */
92
- get userRuntimeDir(): string;
93
- /**
94
- * @return runtime directory shared by users, same as `userRuntimeDir`
95
- */
96
- get siteRuntimeDir(): string;
97
- }