# Class BareTree

#### Hierarchy

- BaseTree
  - BareTree

- Defined in fs/bare/tree.ts:17

#####
Index

### Constructors

constructor

### Properties

children
depot
links
readOnly
type

### Methods

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

## Constructors

### constructor

- new BareTree(depot: Depot.Implementation, links: HardLinks): BareTree

- #### Parameters

  - ##### depot: Depot.Implementation

  - ##### links: HardLinks

  #### Returns BareTree

  Overrides BaseTree.constructor

  - Defined in fs/bare/tree.ts:24

## Properties

### children

children: {
[name: string]: Tree | File;
}

#### Type declaration

- ##### [name: string]: Tree | File

- Defined in fs/bare/tree.ts:21

### depot

depot: Depot.Implementation

- Defined in fs/bare/tree.ts:19

### links

links: HardLinks

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

### readOnly

readOnly: boolean

Inherited from BaseTree.readOnly

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

### type

type: "BareTree"

- Defined in fs/bare/tree.ts:22

## Methods

### add

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

- #### Parameters

  - ##### path: Path

  - ##### content: Uint8Array

  #### Returns Promise<BareTree>

  Inherited from BaseTree.add

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

### addRecurse

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

- #### Parameters

  - ##### path: Path

  - ##### content: Uint8Array

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

  #### Returns Promise<BareTree>

  Inherited from BaseTree.addRecurse

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

### cat

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

- #### Parameters

  - ##### path: Path

  #### Returns Promise<Uint8Array>

  Inherited from BaseTree.cat

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

### createChildTree

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

- #### Parameters

  - ##### name: string

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

  #### Returns Promise<Tree>

  Overrides BaseTree.createChildTree

  - Defined in fs/bare/tree.ts:56

### createOrUpdateChildFile

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

- #### Parameters

  - ##### content: Uint8Array

  - ##### name: string

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

  #### Returns Promise<BareFile>

  Overrides BaseTree.createOrUpdateChildFile

  - Defined in fs/bare/tree.ts:71

### exists

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

- #### Parameters

  - ##### path: Path

  #### Returns Promise<boolean>

  Inherited from BaseTree.exists

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

### get

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

- #### Parameters

  - ##### path: Path

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

  Overrides BaseTree.get

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

### getDirectChild

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

- #### Parameters

  - ##### name: string

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

  Overrides BaseTree.getDirectChild

  - Defined in fs/bare/tree.ts:109

### getLinks

- getLinks(): BaseLinks

- #### Returns BaseLinks

  Overrides BaseTree.getLinks

  - Defined in fs/bare/tree.ts:151

### getOrCreateDirectChild

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

- #### Parameters

  - ##### name: string

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

  #### Returns Promise<File | Tree>

  Inherited from BaseTree.getOrCreateDirectChild

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

### ls

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

- #### Parameters

  - ##### path: Path

  #### Returns Promise<Links>

  Inherited from BaseTree.ls

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

### mkdir

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

- #### Parameters

  - ##### path: Path

  #### Returns Promise<BareTree>

  Inherited from BaseTree.mkdir

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

### mkdirRecurse

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

- #### Parameters

  - ##### path: Path

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

  #### Returns Promise<BareTree>

  Inherited from BaseTree.mkdirRecurse

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

### mv

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

- #### Parameters

  - ##### from: Path

  - ##### to: Path

  #### Returns Promise<BareTree>

  Inherited from BaseTree.mv

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

### put

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

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

  Inherited from BaseTree.put

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

### putAndUpdateLink

- putAndUpdateLink(child: Puttable, name: string, onUpdate: Maybe<UpdateCallback>): Promise<BareTree>

- #### Parameters

  - ##### child: Puttable

  - ##### name: string

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

  #### Returns Promise<BareTree>

  - Defined in fs/bare/tree.ts:89

### putDetailed

- putDetailed(): Promise<PutResult>

- #### Returns Promise<PutResult>

  Overrides BaseTree.putDetailed

  - Defined in fs/bare/tree.ts:85

### read

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

- #### Parameters

  - ##### path: Path

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

  Inherited from BaseTree.read

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

### removeDirectChild

- removeDirectChild(name: string): BareTree

- #### Parameters

  - ##### name: string

  #### Returns BareTree

  Overrides BaseTree.removeDirectChild

  - Defined in fs/bare/tree.ts:101

### rm

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

- #### Parameters

  - ##### path: Path

  #### Returns Promise<BareTree>

  Inherited from BaseTree.rm

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

### rmRecurse

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

- #### Parameters

  - ##### path: Path

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

  #### Returns Promise<BareTree>

  Inherited from BaseTree.rmRecurse

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

### updateChild

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

- `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<BareTree>

  Inherited from BaseTree.updateChild

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

### updateDirectChild

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

- #### Parameters

  - ##### child: File | Tree

  - ##### name: string

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

  #### Returns Promise<BareTree>

  Overrides BaseTree.updateDirectChild

  - Defined in fs/bare/tree.ts:96

### updateLink

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

- #### Parameters

  - ##### name: string

  - ##### result: PutResult

  #### Returns BareTree

  Overrides BaseTree.updateLink

  - Defined in fs/bare/tree.ts:145

### write

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

- #### Parameters

  - ##### path: Path

  - ##### content: Uint8Array

  #### Returns Promise<BareTree>

  Inherited from BaseTree.write

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

### `Static` empty

- empty(depot: Depot.Implementation): Promise<BareTree>

- #### Parameters

  - ##### depot: Depot.Implementation

  #### Returns Promise<BareTree>

  - Defined in fs/bare/tree.ts:32

### `Static` fromCID

- fromCID(depot: Depot.Implementation, cid: CID<unknown, number, number, Version>): Promise<BareTree>

- #### Parameters

  - ##### depot: Depot.Implementation

  - ##### cid: CID<unknown, number, number, Version>

  #### Returns Promise<BareTree>

  - Defined in fs/bare/tree.ts:36

### `Static` fromLinks

- fromLinks(depot: Depot.Implementation, links: HardLinks): BareTree

- #### Parameters

  - ##### depot: Depot.Implementation

  - ##### links: HardLinks

  #### Returns BareTree

  - Defined in fs/bare/tree.ts:44

### `Static` instanceOf

- instanceOf(obj: unknown): obj is BareTree

- #### Parameters

  - ##### obj: unknown

  #### Returns obj is BareTree

  - Defined in fs/bare/tree.ts:48

Generated using TypeDoc