@atlaspack/types-internal 2.14.1-canary.51 → 2.14.1-canary.511
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/CHANGELOG.md +442 -0
- package/dist/Cache.js +2 -0
- package/dist/DependencySpecifier.js +2 -0
- package/dist/FileCreateInvalidation.js +2 -0
- package/dist/FilePath.js +2 -0
- package/dist/FileSystem.js +2 -0
- package/dist/Glob.js +2 -0
- package/dist/NapiWorkerPool.js +2 -0
- package/dist/PackageManager.js +2 -0
- package/dist/PackageName.js +2 -0
- package/dist/SemverRange.js +2 -0
- package/dist/index.js +2 -0
- package/dist/unsafe.js +2 -0
- package/lib/Cache.js +1 -0
- package/lib/DependencySpecifier.js +1 -0
- package/lib/FileCreateInvalidation.js +1 -0
- package/lib/FilePath.js +1 -0
- package/lib/FileSystem.js +1 -0
- package/lib/Glob.js +1 -0
- package/lib/NapiWorkerPool.js +1 -0
- package/lib/PackageManager.js +1 -0
- package/lib/PackageName.js +1 -0
- package/lib/SemverRange.js +1 -0
- package/lib/index.js +1 -0
- package/lib/types/Cache.d.ts +24 -0
- package/lib/{FileCreateInvalidation.d.ts → types/FileCreateInvalidation.d.ts} +6 -6
- package/lib/types/FileSystem.d.ts +90 -0
- package/lib/types/NapiWorkerPool.d.ts +5 -0
- package/lib/types/PackageManager.d.ts +50 -0
- package/lib/types/index.d.ts +1974 -0
- package/lib/types/unsafe.d.ts +6 -0
- package/lib/unsafe.js +1 -0
- package/package.json +10 -10
- package/{lib/Cache.d.ts → src/Cache.ts} +9 -5
- package/src/{DependencySpecifier.js → DependencySpecifier.ts} +0 -2
- package/src/FileCreateInvalidation.ts +20 -0
- package/src/{FilePath.js → FilePath.ts} +0 -2
- package/src/{FileSystem.js → FileSystem.ts} +47 -17
- package/src/{Glob.js → Glob.ts} +0 -2
- package/{lib/NapiWorkerPool.d.ts → src/NapiWorkerPool.ts} +2 -1
- package/{lib/PackageManager.d.ts → src/PackageManager.ts} +36 -15
- package/src/{PackageName.js → PackageName.ts} +0 -2
- package/src/{SemverRange.js → SemverRange.ts} +0 -2
- package/{lib/index.d.ts → src/index.ts} +765 -533
- package/{lib/unsafe.d.ts → src/unsafe.ts} +1 -0
- package/tsconfig.json +18 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/lib/FileSystem.d.ts +0 -91
- package/src/Cache.js +0 -29
- package/src/FileCreateInvalidation.js +0 -22
- package/src/NapiWorkerPool.js +0 -8
- package/src/PackageManager.js +0 -60
- package/src/index.js +0 -2159
- package/src/unsafe.js +0 -9
- /package/lib/{DependencySpecifier.d.ts → types/DependencySpecifier.d.ts} +0 -0
- /package/lib/{FilePath.d.ts → types/FilePath.d.ts} +0 -0
- /package/lib/{Glob.d.ts → types/Glob.d.ts} +0 -0
- /package/lib/{PackageName.d.ts → types/PackageName.d.ts} +0 -0
- /package/lib/{SemverRange.d.ts → types/SemverRange.d.ts} +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { FilePath } from './FilePath';
|
|
2
|
+
import type { Readable, Writable } from 'stream';
|
|
3
|
+
import type { Event, Options as WatcherOptions, AsyncSubscription } from '@parcel/watcher';
|
|
4
|
+
export type FileOptions = {
|
|
5
|
+
mode?: number;
|
|
6
|
+
};
|
|
7
|
+
export type ReaddirOptions = {
|
|
8
|
+
withFileTypes?: false;
|
|
9
|
+
} | {
|
|
10
|
+
withFileTypes: true;
|
|
11
|
+
};
|
|
12
|
+
export interface Stats {
|
|
13
|
+
dev: number;
|
|
14
|
+
ino: number;
|
|
15
|
+
mode: number;
|
|
16
|
+
nlink: number;
|
|
17
|
+
uid: number;
|
|
18
|
+
gid: number;
|
|
19
|
+
rdev: number;
|
|
20
|
+
size: number;
|
|
21
|
+
blksize: number;
|
|
22
|
+
blocks: number;
|
|
23
|
+
atimeMs: number;
|
|
24
|
+
mtimeMs: number;
|
|
25
|
+
ctimeMs: number;
|
|
26
|
+
birthtimeMs: number;
|
|
27
|
+
atime: Date;
|
|
28
|
+
mtime: Date;
|
|
29
|
+
ctime: Date;
|
|
30
|
+
birthtime: Date;
|
|
31
|
+
isFile(): boolean;
|
|
32
|
+
isDirectory(): boolean;
|
|
33
|
+
isBlockDevice(): boolean;
|
|
34
|
+
isCharacterDevice(): boolean;
|
|
35
|
+
isSymbolicLink(): boolean;
|
|
36
|
+
isFIFO(): boolean;
|
|
37
|
+
isSocket(): boolean;
|
|
38
|
+
}
|
|
39
|
+
export type Encoding = 'hex' | 'utf8' | 'utf-8' | 'ascii' | 'binary' | 'base64' | 'ucs2' | 'ucs-2' | 'utf16le' | 'latin1';
|
|
40
|
+
export interface FileSystem {
|
|
41
|
+
readFile(filePath: FilePath): Promise<Buffer>;
|
|
42
|
+
readFile(filePath: FilePath, encoding: Encoding): Promise<string>;
|
|
43
|
+
readFileSync(filePath: FilePath): Buffer;
|
|
44
|
+
readFileSync(filePath: FilePath, encoding: Encoding): string;
|
|
45
|
+
writeFile(filePath: FilePath, contents: Buffer | string, options?: FileOptions | null | undefined): Promise<void>;
|
|
46
|
+
copyFile(source: FilePath, destination: FilePath, flags?: number): Promise<void>;
|
|
47
|
+
stat(filePath: FilePath): Promise<Stats>;
|
|
48
|
+
statSync(filePath: FilePath): Stats;
|
|
49
|
+
readdir(path: FilePath, opts?: {
|
|
50
|
+
withFileTypes?: false;
|
|
51
|
+
}): Promise<FilePath[]>;
|
|
52
|
+
readdir(path: FilePath, opts: {
|
|
53
|
+
withFileTypes: true;
|
|
54
|
+
}): Promise<Dirent[]>;
|
|
55
|
+
readdirSync(path: FilePath, opts?: {
|
|
56
|
+
withFileTypes?: false;
|
|
57
|
+
}): FilePath[];
|
|
58
|
+
readdirSync(path: FilePath, opts: {
|
|
59
|
+
withFileTypes: true;
|
|
60
|
+
}): Dirent[];
|
|
61
|
+
symlink(target: FilePath, path: FilePath): Promise<void>;
|
|
62
|
+
unlink(path: FilePath): Promise<void>;
|
|
63
|
+
realpath(path: FilePath): Promise<FilePath>;
|
|
64
|
+
realpathSync(path: FilePath): FilePath;
|
|
65
|
+
exists(path: FilePath): Promise<boolean>;
|
|
66
|
+
existsSync(path: FilePath): boolean;
|
|
67
|
+
mkdirp(path: FilePath): Promise<void>;
|
|
68
|
+
rimraf(path: FilePath): Promise<void>;
|
|
69
|
+
ncp(source: FilePath, destination: FilePath): Promise<void>;
|
|
70
|
+
createReadStream(path: FilePath, options?: FileOptions | null | undefined): Readable;
|
|
71
|
+
createWriteStream(path: FilePath, options?: FileOptions | null | undefined): Writable;
|
|
72
|
+
cwd(): FilePath;
|
|
73
|
+
chdir(dir: FilePath): void;
|
|
74
|
+
watch(dir: FilePath, fn: (err: Error | null | undefined, events: Array<Event>) => unknown, opts: WatcherOptions): Promise<AsyncSubscription>;
|
|
75
|
+
getEventsSince(dir: FilePath, snapshot: FilePath, opts: WatcherOptions): Promise<Array<Event>>;
|
|
76
|
+
writeSnapshot(dir: FilePath, snapshot: FilePath, opts: WatcherOptions): Promise<void>;
|
|
77
|
+
findAncestorFile(fileNames: Array<string>, fromDir: FilePath, root: FilePath): FilePath | null | undefined;
|
|
78
|
+
findNodeModule(moduleName: string, fromDir: FilePath): FilePath | null | undefined;
|
|
79
|
+
findFirstFile(filePaths: Array<FilePath>): FilePath | null | undefined;
|
|
80
|
+
}
|
|
81
|
+
export interface Dirent {
|
|
82
|
+
readonly name: string;
|
|
83
|
+
isBlockDevice(): boolean;
|
|
84
|
+
isCharacterDevice(): boolean;
|
|
85
|
+
isDirectory(): boolean;
|
|
86
|
+
isFIFO(): boolean;
|
|
87
|
+
isFile(): boolean;
|
|
88
|
+
isSocket(): boolean;
|
|
89
|
+
isSymbolicLink(): boolean;
|
|
90
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { FileCreateInvalidation, PackageJSON } from './index';
|
|
2
|
+
import type { SemverRange } from './SemverRange';
|
|
3
|
+
import type { DependencySpecifier } from './DependencySpecifier';
|
|
4
|
+
import type { FileSystem } from './FileSystem';
|
|
5
|
+
import type { FilePath } from './FilePath';
|
|
6
|
+
export type PackageManagerResolveResult = {
|
|
7
|
+
resolved: FilePath | DependencySpecifier;
|
|
8
|
+
pkg?: PackageJSON | null | undefined;
|
|
9
|
+
invalidateOnFileCreate: Array<FileCreateInvalidation>;
|
|
10
|
+
invalidateOnFileChange: Set<FilePath>;
|
|
11
|
+
type: number;
|
|
12
|
+
};
|
|
13
|
+
export type InstallOptions = {
|
|
14
|
+
installPeers?: boolean;
|
|
15
|
+
saveDev?: boolean;
|
|
16
|
+
packageInstaller?: PackageInstaller | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type InstallerOptions = {
|
|
19
|
+
modules: Array<ModuleRequest>;
|
|
20
|
+
fs: FileSystem;
|
|
21
|
+
cwd: FilePath;
|
|
22
|
+
packagePath?: FilePath | null | undefined;
|
|
23
|
+
saveDev?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export interface PackageInstaller {
|
|
26
|
+
install(opts: InstallerOptions): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export type Invalidations = {
|
|
29
|
+
invalidateOnFileCreate: Array<FileCreateInvalidation>;
|
|
30
|
+
invalidateOnFileChange: Set<FilePath>;
|
|
31
|
+
invalidateOnStartup: boolean;
|
|
32
|
+
};
|
|
33
|
+
export interface PackageManager {
|
|
34
|
+
require(id: DependencySpecifier, from: FilePath, arg3?: {
|
|
35
|
+
range?: SemverRange | null | undefined;
|
|
36
|
+
shouldAutoInstall?: boolean;
|
|
37
|
+
saveDev?: boolean;
|
|
38
|
+
} | null | undefined): Promise<any>;
|
|
39
|
+
resolve(id: DependencySpecifier, from: FilePath, arg3?: {
|
|
40
|
+
range?: SemverRange | null | undefined;
|
|
41
|
+
shouldAutoInstall?: boolean;
|
|
42
|
+
saveDev?: boolean;
|
|
43
|
+
} | null | undefined): Promise<PackageManagerResolveResult>;
|
|
44
|
+
getInvalidations(id: DependencySpecifier, from: FilePath): Invalidations;
|
|
45
|
+
invalidate(id: DependencySpecifier, from: FilePath): void;
|
|
46
|
+
}
|
|
47
|
+
export type ModuleRequest = {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly range: SemverRange | null | undefined;
|
|
50
|
+
};
|