types.d.ts 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. declare module "@npmcli/arborist" {
  2. export interface ArboristOptions {
  3. path: string
  4. binLinks?: boolean
  5. progress?: boolean
  6. savePrefix?: string
  7. ignoreScripts?: boolean
  8. }
  9. export interface ArboristNode {
  10. name: string
  11. path: string
  12. }
  13. export interface ArboristEdge {
  14. to?: ArboristNode
  15. }
  16. export interface ArboristTree {
  17. edgesOut: Map<string, ArboristEdge>
  18. }
  19. export interface ReifyOptions {
  20. add?: string[]
  21. save?: boolean
  22. saveType?: "prod" | "dev" | "optional" | "peer"
  23. }
  24. export class Arborist {
  25. constructor(options: ArboristOptions)
  26. loadVirtual(): Promise<ArboristTree | undefined>
  27. reify(options?: ReifyOptions): Promise<ArboristTree>
  28. }
  29. }
  30. declare var Bun:
  31. | {
  32. file(path: string): {
  33. text(): Promise<string>
  34. json(): Promise<unknown>
  35. }
  36. write(path: string, content: string | Uint8Array): Promise<void>
  37. }
  38. | undefined