# Class BaseTree`Abstract`

#### Hierarchy

- BaseTree
  - default
  - BareTree

#### Implements

- Tree
- UnixTree

- Defined in fs/base/tree.ts:12

#####
Index

### Constructors

constructor

### Properties

readOnly

### Methods

add
addRecurse
cat
createChildTree
createOrUpdateChildFile
exists
get
getDirectChild
getLinks
getOrCreateDirectChild
ls
mkdir
mkdirRecurse
mv
put
putDetailed
read
removeDirectChild
rm
rmRecurse
updateChild
updateDirectChild
updateLink
write

## Constructors

### constructor

- new BaseTree(): BaseTree

- #### Returns BaseTree

  - Defined in fs/base/tree.ts:16

## Properties

### readOnly

readOnly: boolean

Implementation of UnixTree.readOnly

- Defined in fs/base/tree.ts:14

## Methods

### add

- add(path: Path, content: Uint8Array): Promise<BaseTree>

- #### Parameters

  - ##### path: Path

  - ##### content: Uint8Array

  #### Returns Promise<BaseTree>

  Implementation of UnixTree.add

  - Defined in fs/base/tree.ts:69

### addRecurse

- addRecurse(path: Path, content: Uint8Array, onUpdate: Maybe<UpdateCallback>): Promise<BaseTree>

- #### Parameters

  - ##### path: Path

  - ##### content: Uint8Array

  - ##### onUpdate: Maybe<UpdateCallback>

  #### Returns Promise<BaseTree>

  Implementation of Tree.addRecurse

  - Defined in fs/base/tree.ts:74

### cat

- cat(path: Path): Promise<Uint8Array>

- #### Parameters

  - ##### path: Path

  #### Returns Promise<Uint8Array>

  Implementation of UnixTree.cat

  - Defined in fs/base/tree.ts:35

### `Abstract` createChildTree

- createChildTree(name: string, onUpdate: Maybe<UpdateCallback>): Promise<Tree>

- #### Parameters

  - ##### name: string

  - ##### onUpdate: Maybe<UpdateCallback>

  #### Returns Promise<Tree>

  Implementation of Tree.createChildTree

  - Defined in fs/base/tree.ts:223

### `Abstract` createOrUpdateChildFile

- createOrUpdateChildFile(content: Uint8Array, name: string, onUpdate: Maybe<UpdateCallback>): Promise<File>

- #### Parameters

  - ##### content: Uint8Array

  - ##### name: string

  - ##### onUpdate: Maybe<UpdateCallback>

  #### Returns Promise<File>

  Implementation of Tree.createOrUpdateChildFile

  - Defined in fs/base/tree.ts:224

### exists

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

- #### Parameters

  - ##### path: Path

  #### Returns Promise<boolean>

  Implementation of UnixTree.exists

  - Defined in fs/base/tree.ts:170

### `Abstract` get

- get(path: Path): Promise<null | File | Tree>

- #### Parameters

  - ##### path: Path

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

  Implementation of UnixTree.get

  - Defined in fs/base/tree.ts:232

### `Abstract` getDirectChild

- getDirectChild(name: string): Promise<null | File | Tree>

- #### Parameters

  - ##### name: string

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

  Implementation of Tree.getDirectChild

  - Defined in fs/base/tree.ts:230

### `Abstract` getLinks

- getLinks(): Links

- #### Returns Links

  Implementation of Tree.getLinks

  - Defined in fs/base/tree.ts:235

### getOrCreateDirectChild

- getOrCreateDirectChild(name: string, onUpdate: Maybe<UpdateCallback>): Promise<File | Tree>

- #### Parameters

  - ##### name: string

  - ##### onUpdate: Maybe<UpdateCallback>

  #### Returns Promise<File | Tree>

  Implementation of Tree.getOrCreateDirectChild

  - Defined in fs/base/tree.ts:183

### ls

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

- #### Parameters

  - ##### path: Path

  #### Returns Promise<Links>

  Implementation of UnixTree.ls

  - Defined in fs/base/tree.ts:25

### mkdir

- mkdir(path: Path): Promise<BaseTree>

- #### Parameters

  - ##### path: Path

  #### Returns Promise<BaseTree>

  Implementation of UnixTree.mkdir

  - Defined in fs/base/tree.ts:45

### mkdirRecurse

- mkdirRecurse(path: Path, onUpdate: Maybe<UpdateCallback>): Promise<BaseTree>

- #### Parameters

  - ##### path: Path

  - ##### onUpdate: Maybe<UpdateCallback>

  #### Returns Promise<BaseTree>

  Implementation of Tree.mkdirRecurse

  - Defined in fs/base/tree.ts:49

### mv

- mv(from: Path, to: Path): Promise<BaseTree>

- #### Parameters

  - ##### from: Path

  - ##### to: Path

  #### Returns Promise<BaseTree>

  Implementation of UnixTree.mv

  - Defined in fs/base/tree.ts:130

### put

- put(): Promise<CID<unknown, number, number, Version>>

- #### Returns Promise<CID<unknown, number, number, Version>>

  Implementation of Tree.put

  - Defined in fs/base/tree.ts:20

### `Abstract` putDetailed

- putDetailed(): Promise<PutResult>

- #### Returns Promise<PutResult>

  Implementation of Tree.putDetailed

  - Defined in fs/base/tree.ts:226

### read

- read(path: Path): Promise<null | File | Tree>

- #### Parameters

  - ##### path: Path

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

  - Defined in fs/base/tree.ts:175

### `Abstract` removeDirectChild

- removeDirectChild(name: string): BaseTree

- #### Parameters

  - ##### name: string

  #### Returns BaseTree

  Implementation of Tree.removeDirectChild

  - Defined in fs/base/tree.ts:229

### rm

- rm(path: Path): Promise<BaseTree>

- #### Parameters

  - ##### path: Path

  #### Returns Promise<BaseTree>

  Implementation of UnixTree.rm

  - Defined in fs/base/tree.ts:98

### rmRecurse

- rmRecurse(path: Path, onUpdate: Maybe<UpdateCallback>): Promise<BaseTree>

- #### Parameters

  - ##### path: Path

  - ##### onUpdate: Maybe<UpdateCallback>

  #### Returns Promise<BaseTree>

  Implementation of Tree.rmRecurse

  - Defined in fs/base/tree.ts:103

### updateChild

- updateChild(child: File | Tree, path: Path): Promise<BaseTree>

- `put` is called on child (result of promise) in `updateDirectChild` Then for the outermost parent, `put` should be called manually.

  #### Parameters

  - ##### child: File | Tree

  - ##### path: Path

  #### Returns Promise<BaseTree>

  Implementation of Tree.updateChild

  - Defined in fs/base/tree.ts:194

### `Abstract` updateDirectChild

- updateDirectChild(child: File | Tree, name: string, onUpdate: Maybe<UpdateCallback>): Promise<BaseTree>

- #### Parameters

  - ##### child: File | Tree

  - ##### name: string

  - ##### onUpdate: Maybe<UpdateCallback>

  #### Returns Promise<BaseTree>

  Implementation of Tree.updateDirectChild

  - Defined in fs/base/tree.ts:228

### `Abstract` updateLink

- updateLink(name: string, result: PutResult): BaseTree

- #### Parameters

  - ##### name: string

  - ##### result: PutResult

  #### Returns BaseTree

  Implementation of Tree.updateLink

  - Defined in fs/base/tree.ts:234

### write

- write(path: Path, content: Uint8Array): Promise<BaseTree>

- #### Parameters

  - ##### path: Path

  - ##### content: Uint8Array

  #### Returns Promise<BaseTree>

  - Defined in fs/base/tree.ts:179

Generated using TypeDoc