Hierarchy (view full)

Constructors

Properties

_metadata: DriveMetadata = ...
event?: EventTemplate | SignedEvent
modified: boolean = false

whether the drive has been modified and needs to be saved

publisher: Publisher
signer: Signer
prefixed: string | boolean

Accessors

  • get address(): "" | `naddr1${string}`
  • Returns "" | `naddr1${string}`

  • get pubkey(): undefined | string
  • Returns undefined | string

Methods

  • Iterate over the files

    Returns IterableIterator<TreeFile | TreeFolder>

    Example

    for(let fileOrFolder of drive){
    if(fileOrFolder instanceof TreeFolder){
    // keep looping
    }
    else if(fileOrFolder instanceof TreeFile){
    console.log(fileOrFolder.path)
    }
    }
  • Type Parameters

    • T extends keyof EventMap

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: ArgumentMap<EventMap>[Extract<T, keyof EventMap>]

          Returns void

    • Optional context: any

    Returns this

  • Returns EventTemplate

  • Downloads the file at the path

    Parameters

    • path: Path
    • additionalServers: string[] = []

    Returns Promise<null | File>

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends keyof EventMap

    Parameters

    • event: T
    • Rest ...args: ArgumentMap<EventMap>[Extract<T, keyof EventMap>]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (keyof EventMap)[]

  • Parameters

    • path: Path
    • additionalServers: string[] = []

    Returns string

  • Checks if there is a file with a matching sha256 hash

    Parameters

    • sha256: string

    Returns boolean

  • Return the number of listeners listening to a given event.

    Parameters

    • event: keyof EventMap

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends keyof EventMap

    Parameters

    • event: T

    Returns ((...args) => void)[]

  • Moves the file or folder from src to dest

    Parameters

    Returns void

  • Type Parameters

    • T extends keyof EventMap

    Parameters

    • event: T
    • Optional fn: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: ArgumentMap<EventMap>[Extract<T, keyof EventMap>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns this

  • Add a listener for a given event.

    Type Parameters

    • T extends keyof EventMap

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: ArgumentMap<EventMap>[Extract<T, keyof EventMap>]

          Returns void

    • Optional context: any

    Returns this

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends keyof EventMap

    Parameters

    • event: T
    • fn: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: ArgumentMap<EventMap>[Extract<T, keyof EventMap>]

          Returns void

    • Optional context: any

    Returns this

  • Removes the file or folder at the path

    Parameters

    Returns void

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: keyof EventMap

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends keyof EventMap

    Parameters

    • event: T
    • Optional fn: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: ArgumentMap<EventMap>[Extract<T, keyof EventMap>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns this

  • Save any pending changes to nostr

    Returns Promise<undefined | SignedEvent>

  • Parameters

    • event: EventTemplate | SignedEvent

    Returns boolean

Generated using TypeDoc