### Hierarchy

- FileSystem

## Index

### Constructors

- constructor

### Properties

- _publishWhenOnline
- _publishing
- appPath
- localOnly
- proofs
- publishHooks
- root

### Methods

- acceptShare
- add
- addPublicExchangeKey
- cat
- deactivate
- exists
- get
- hasPublicExchangeKey
- historyStep
- loadShare
- ls
- mkdir
- mv
- publish
- read
- resolveSymlink
- rm
- sharePrivate
- symlink
- write
- empty
- fromCID

## Constructors

### constructor

- new FileSystem(__namedParameters: <internal>.ConstructorParams): FileSystem

- - Defined in fs/filesystem.ts:86

  #### Parameters

  - ##### __namedParameters: <internal>.ConstructorParams

  #### Returns FileSystem

## Properties

### _publishWhenOnline

_publishWhenOnline: [CID, string][]

- Defined in fs/filesystem.ts:82

### _publishing

_publishing: false | [CID, true]

- Defined in fs/filesystem.ts:83

### appPath

appPath: undefined | AppPath

- Defined in fs/filesystem.ts:78

### Readonly localOnly

localOnly: boolean

- Defined in fs/filesystem.ts:76

### proofs

proofs: {}

- Defined in fs/filesystem.ts:79

#### Type declaration

- ##### [_: string]: string

### publishHooks

publishHooks: PublishHook[]

- Defined in fs/filesystem.ts:80

### root

root: <internal>.default

- Defined in fs/filesystem.ts:75

## Methods

### acceptShare

- acceptShare(__namedParameters: { shareId: string; sharedBy: string }): Promise<FileSystem>

- - Defined in fs/filesystem.ts:570

  Accept a share. Copies the links to the items into your 'Shared with me' directory. eg. `private/Shared with me/Sharer/`

  #### Parameters

  - ##### __namedParameters: { shareId: string; sharedBy: string }

    - ##### shareId: string

    - ##### sharedBy: string

  #### Returns Promise<FileSystem>

### add

- add(path: DistinctivePath, content: FileContent | SoftLink | SoftLink[] | Record<string, SoftLink>, options?: MutationOptions): Promise<FileSystem>

- - Defined in fs/filesystem.ts:246

  #### Parameters

  - ##### path: DistinctivePath

  - ##### content: FileContent | SoftLink | SoftLink[] | Record<string, SoftLink>

  - ##### options: MutationOptions = {}

  #### Returns Promise<FileSystem>

### addPublicExchangeKey

- addPublicExchangeKey(): Promise<void>

- - Defined in fs/filesystem.ts:699

  Stores the public part of the exchange key in the DID format, in the `/public/.well-known/exchange/DID_GOES_HERE/` directory.

  #### Returns Promise<void>

### cat

- cat(path: FilePath): Promise<FileContent>

- - Defined in fs/filesystem.ts:327

  #### Parameters

  - ##### path: FilePath

  #### Returns Promise<FileContent>

### deactivate

- deactivate(): void

- - Defined in fs/filesystem.ts:193

  Deactivate a file system.

  Use this when a user signs out. The only function of this is to stop listing to online/offline events.

  #### Returns void

### exists

- exists(path: DistinctivePath): Promise<boolean>

- - Defined in fs/filesystem.ts:355

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns Promise<boolean>

### get

- get(path: DistinctivePath): Promise<null | PuttableUnixTree | File>

- - Defined in fs/filesystem.ts:367

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns Promise<null | PuttableUnixTree | File>

### hasPublicExchangeKey

- hasPublicExchangeKey(): Promise<boolean>

- - Defined in fs/filesystem.ts:711

  Checks if the public exchange key was added in the well-known location. See `addPublicExchangeKey()` for the exact details.

  #### Returns Promise<boolean>

### historyStep

- historyStep(): Promise<void>

- - Defined in fs/filesystem.ts:553

  Ensures the current version of your file system is "committed" and stepped forward, so the current version will always be persisted as an "step" in the history of the file system.

  This function is implicitly called every time your file system changes are synced, so in most cases calling this is handled for you.

  #### Returns Promise<void>

### loadShare

- loadShare(__namedParameters: { shareId: string; sharedBy: string }): Promise<<internal>.default>

- - Defined in fs/filesystem.ts:584

  Loads a share. Returns a "entry index", in other words, a private tree with symlinks (soft links) to the shared items.

  #### Parameters

  - ##### __namedParameters: { shareId: string; sharedBy: string }

    - ##### shareId: string

    - ##### sharedBy: string

  #### Returns Promise<<internal>.default>

### ls

- ls(path: DirectoryPath): Promise<Links>

- - Defined in fs/filesystem.ts:205

  #### Parameters

  - ##### path: DirectoryPath

  #### Returns Promise<Links>

### mkdir

- mkdir(path: DirectoryPath, options?: MutationOptions): Promise<FileSystem>

- - Defined in fs/filesystem.ts:221

  #### Parameters

  - ##### path: DirectoryPath

  - ##### options: MutationOptions = {}

  #### Returns Promise<FileSystem>

### mv

- mv(from: DistinctivePath, to: DistinctivePath): Promise<FileSystem>

- - Defined in fs/filesystem.ts:381

  #### Parameters

  - ##### from: DistinctivePath

  - ##### to: DistinctivePath

  #### Returns Promise<FileSystem>

### publish

- publish(): Promise<CID>

- - Defined in fs/filesystem.ts:528

  Ensures the latest version of the file system is added to IPFS, updates your data root, and returns the root CID.

  #### Returns Promise<CID>

### read

- read(path: FilePath): Promise<null | FileContent>

- - Defined in fs/filesystem.ts:341

  #### Parameters

  - ##### path: FilePath

  #### Returns Promise<null | FileContent>

### resolveSymlink

- resolveSymlink(link: SoftLink): Promise<null | File | Tree>

- - Defined in fs/filesystem.ts:725

  Resolve a symlink directly. The `get` and `cat` methods will automatically resolve symlinks, but sometimes when working with symlinks directly you might want to use this method instead.

  #### Parameters

  - ##### link: SoftLink

  #### Returns Promise<null | File | Tree>

### rm

- rm(path: DistinctivePath): Promise<FileSystem>

- - Defined in fs/filesystem.ts:417

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns Promise<FileSystem>

### sharePrivate

- sharePrivate(paths: DistinctivePath[], __namedParameters: { shareWith: string | string[]; sharedBy?: SharedBy }): Promise<ShareDetails>

- - Defined in fs/filesystem.ts:648

  Share a private file with a user.

  #### Parameters

  - ##### paths: DistinctivePath[]

  - ##### __namedParameters: { shareWith: string | string[]; sharedBy?: SharedBy }

    - ##### shareWith: string | string[]

    - ##### Optional sharedBy?: SharedBy

  #### Returns Promise<ShareDetails>

### symlink

- symlink(args: { at: DirectoryPath; name: string; referringTo: DistinctivePath; username?: string }): Promise<FileSystem>

- - Defined in fs/filesystem.ts:437

  Make an internal symbolic link at a path.

  #### Parameters

  - ##### args: { at: DirectoryPath; name: string; referringTo: DistinctivePath; username?: string }

    - ##### at: DirectoryPath

    - ##### name: string

    - ##### referringTo: DistinctivePath

    - ##### Optional username?: string

  #### Returns Promise<FileSystem>

### write

- write(path: FilePath, content: FileContent, options?: MutationOptions): Promise<FileSystem>

- - Defined in fs/filesystem.ts:346

  #### Parameters

  - ##### path: FilePath

  - ##### content: FileContent

  - ##### options: MutationOptions = {}

  #### Returns Promise<FileSystem>

### Static empty

- empty(opts?: NewFileSystemOptions): Promise<FileSystem>

- - Defined in fs/filesystem.ts:151

  Creates a file system with an empty public tree & an empty private tree at the root.

  #### Parameters

  - ##### opts: NewFileSystemOptions = {}

  #### Returns Promise<FileSystem>

### Static fromCID

- fromCID(cid: CID, opts?: FileSystemOptions): Promise<null | FileSystem>

- - Defined in fs/filesystem.ts:170

  Loads an existing file system from a CID.

  #### Parameters

  - ##### cid: CID

  - ##### opts: FileSystemOptions = {}

  #### Returns Promise<null | FileSystem>

Generated using TypeDoc