@atlaspack/types-internal 2.14.15-typescript-e769947a5.0 → 2.14.15-typescript-6de04fbae.0

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.
Files changed (64) hide show
  1. package/lib/Cache.d.mts +24 -0
  2. package/lib/Cache.js +4 -0
  3. package/lib/Cache.mjs +1 -0
  4. package/lib/DependencySpecifier.js +4 -0
  5. package/lib/DependencySpecifier.mjs +1 -0
  6. package/lib/FileCreateInvalidation.d.mts +13 -0
  7. package/lib/FileCreateInvalidation.js +4 -0
  8. package/lib/FileCreateInvalidation.mjs +1 -0
  9. package/lib/FilePath.js +4 -0
  10. package/lib/FilePath.mjs +1 -0
  11. package/lib/FileSystem.d.mts +90 -0
  12. package/lib/FileSystem.js +4 -0
  13. package/lib/FileSystem.mjs +1 -0
  14. package/lib/Glob.js +4 -0
  15. package/lib/Glob.mjs +1 -0
  16. package/lib/NapiWorkerPool.d.mts +5 -0
  17. package/lib/NapiWorkerPool.js +4 -0
  18. package/lib/NapiWorkerPool.mjs +1 -0
  19. package/lib/PackageManager.d.mts +50 -0
  20. package/lib/PackageManager.js +4 -0
  21. package/lib/PackageManager.mjs +1 -0
  22. package/lib/PackageName.js +4 -0
  23. package/lib/PackageName.mjs +1 -0
  24. package/lib/SemverRange.js +4 -0
  25. package/lib/SemverRange.mjs +1 -0
  26. package/lib/index.d.mts +1855 -0
  27. package/lib/index.js +4 -1
  28. package/lib/index.mjs +1 -0
  29. package/lib/unsafe.d.mts +6 -0
  30. package/lib/unsafe.js +4 -0
  31. package/lib/unsafe.mjs +1 -0
  32. package/package.json +27 -15
  33. package/{lib/Cache.d.ts → src/Cache.mts} +1 -0
  34. package/src/DependencySpecifier.mts +2 -0
  35. package/{lib/FileCreateInvalidation.d.ts → src/FileCreateInvalidation.mts} +6 -2
  36. package/src/FilePath.mts +1 -0
  37. package/{lib/FileSystem.d.ts → src/FileSystem.mts} +7 -1
  38. package/src/Glob.mts +1 -0
  39. package/{lib/NapiWorkerPool.d.ts → src/NapiWorkerPool.mts} +1 -0
  40. package/{lib/PackageManager.d.ts → src/PackageManager.mts} +12 -5
  41. package/src/PackageName.mts +1 -0
  42. package/src/SemverRange.mts +1 -0
  43. package/{lib/index.d.ts → src/index.mts} +29 -22
  44. package/{lib/unsafe.d.ts → src/unsafe.mts} +1 -0
  45. package/tsconfig.json +4 -0
  46. package/scripts/build-ts.js +0 -16
  47. package/scripts/build-ts.sh +0 -11
  48. /package/{src/Cache.js → lib/Cache.js.flow} +0 -0
  49. /package/lib/{DependencySpecifier.d.ts → DependencySpecifier.d.mts} +0 -0
  50. /package/{src/DependencySpecifier.js → lib/DependencySpecifier.js.flow} +0 -0
  51. /package/{src/FileCreateInvalidation.js → lib/FileCreateInvalidation.js.flow} +0 -0
  52. /package/lib/{FilePath.d.ts → FilePath.d.mts} +0 -0
  53. /package/{src/FilePath.js → lib/FilePath.js.flow} +0 -0
  54. /package/{src/FileSystem.js → lib/FileSystem.js.flow} +0 -0
  55. /package/lib/{Glob.d.ts → Glob.d.mts} +0 -0
  56. /package/{src/Glob.js → lib/Glob.js.flow} +0 -0
  57. /package/{src/NapiWorkerPool.js → lib/NapiWorkerPool.js.flow} +0 -0
  58. /package/{src/PackageManager.js → lib/PackageManager.js.flow} +0 -0
  59. /package/lib/{PackageName.d.ts → PackageName.d.mts} +0 -0
  60. /package/{src/PackageName.js → lib/PackageName.js.flow} +0 -0
  61. /package/lib/{SemverRange.d.ts → SemverRange.d.mts} +0 -0
  62. /package/{src/SemverRange.js → lib/SemverRange.js.flow} +0 -0
  63. /package/{src/index.js → lib/index.js.flow} +0 -0
  64. /package/{src/unsafe.js → lib/unsafe.js.flow} +0 -0
@@ -0,0 +1,24 @@
1
+ import type { Readable } from "stream";
2
+ export interface Cache {
3
+ ensure(): Promise<void>;
4
+ has(key: string): Promise<boolean>;
5
+ get<T>(key: string): Promise<T | null | undefined>;
6
+ set(key: string, value: unknown): Promise<void>;
7
+ getStream(key: string): Readable;
8
+ setStream(key: string, stream: Readable): Promise<void>;
9
+ getBlob(key: string): Promise<Buffer>;
10
+ setBlob(key: string, contents: Buffer | string): Promise<void>;
11
+ hasLargeBlob(key: string): Promise<boolean>;
12
+ getLargeBlob(key: string): Promise<Buffer>;
13
+ setLargeBlob(key: string, contents: Buffer | string, options?: {
14
+ signal?: AbortSignal;
15
+ }): Promise<void>;
16
+ deleteLargeBlob(key: string): Promise<void>;
17
+ getBuffer(key: string): Promise<Buffer | null | undefined>;
18
+ /**
19
+ * In a multi-threaded environment, where there are potentially multiple Cache
20
+ * instances writing to the cache, ensure that this instance has the latest view
21
+ * of the changes that may have been written to the cache in other threads.
22
+ */
23
+ refresh(): void;
24
+ }
package/lib/Cache.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
package/lib/Cache.mjs ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { Glob } from "./Glob.mts";
2
+ import type { FilePath } from "./FilePath.mts";
3
+ export type GlobInvalidation = {
4
+ glob: Glob;
5
+ };
6
+ export type FileInvalidation = {
7
+ filePath: FilePath;
8
+ };
9
+ export type FileAboveInvalidation = {
10
+ fileName: string;
11
+ aboveFilePath: FilePath;
12
+ };
13
+ export type FileCreateInvalidation = FileInvalidation | GlobInvalidation | FileAboveInvalidation;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,90 @@
1
+ import type { FilePath } from "./FilePath.mts";
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,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};
package/lib/Glob.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
package/lib/Glob.mjs ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export type Transferable = {};
2
+ export interface NapiWorkerPool {
3
+ getWorkers(): Promise<Array<Transferable>>;
4
+ shutdown(): void;
5
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ import type { FileCreateInvalidation, PackageJSON } from "./index.mts";
2
+ import type { SemverRange } from "./SemverRange.mts";
3
+ import type { DependencySpecifier } from "./DependencySpecifier.mts";
4
+ import type { FileSystem } from "./FileSystem.mts";
5
+ import type { FilePath } from "./FilePath.mts";
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, arg2: {
35
+ range?: SemverRange | null | undefined;
36
+ shouldAutoInstall?: boolean;
37
+ saveDev?: boolean;
38
+ } | null | undefined): Promise<any>;
39
+ resolve(id: DependencySpecifier, from: FilePath, arg2: {
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
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ export {};