summaryrefslogtreecommitdiffhomepage
path: root/packages/shared/src/types.d.ts
blob: b5d667f1d918ad034fa4e535e2d31b538e8c2cce (plain)
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
declare module "@npmcli/arborist" {
  export interface ArboristOptions {
    path: string
    binLinks?: boolean
    progress?: boolean
    savePrefix?: string
    ignoreScripts?: boolean
  }

  export interface ArboristNode {
    name: string
    path: string
  }

  export interface ArboristEdge {
    to?: ArboristNode
  }

  export interface ArboristTree {
    edgesOut: Map<string, ArboristEdge>
  }

  export interface ReifyOptions {
    add?: string[]
    save?: boolean
    saveType?: "prod" | "dev" | "optional" | "peer"
  }

  export class Arborist {
    constructor(options: ArboristOptions)
    loadVirtual(): Promise<ArboristTree | undefined>
    reify(options?: ReifyOptions): Promise<ArboristTree>
  }
}

declare var Bun:
  | {
      file(path: string): {
        text(): Promise<string>
        json(): Promise<unknown>
      }
      write(path: string, content: string | Uint8Array): Promise<void>
    }
  | undefined