Skip to main content
Version: v1

ISharedDirectoryEvents Interface

Events emitted in response to changes to the directory data. These events only emit on the ISharedDirectory itself, and not on subdirectories.

Signature​

export interface ISharedDirectoryEvents extends ISharedObjectEvents

Extends: ISharedObjectEvents

Remarks​

The following is the list of events emitted.

### "valueChanged"

The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory or any subdirectory.

#### Listener signature

(
changed: IDirectoryValueChanged,
local: boolean,
target: IEventThisPlaceHolder,
) => void
  • changed - Information on the key that changed, its value prior to the change, and the path to the key that changed.
  • local - Whether the change originated from this client.
  • target - The ISharedDirectory itself.

### "clear"

The clear event is emitted when the ISharedDirectory is cleared.

#### Listener signature

(local: boolean, target: IEventThisPlaceHolder) => void
  • local - Whether the clear originated from this client.
  • target - The ISharedDirectory itself.

### "subDirectoryCreated"

The subDirectoryCreated event is emitted when a subdirectory is created.

#### Listener signature

(path: string, local: boolean, target: IEventThisPlaceHolder) => void
  • path - The relative path to the subdirectory that is created. It is relative from the object which raises the event.
  • local - Whether the create originated from the this client.
  • target - The ISharedDirectory itself.

###"subDirectoryDeleted"

The subDirectoryDeleted event is emitted when a subdirectory is deleted.

#### Listener signature

(path: string, local: boolean, target: IEventThisPlaceHolder) => void
  • path - The relative path to the subdirectory that is deleted. It is relative from the object which raises the event.
  • local - Whether the delete originated from the this client.
  • target - The ISharedDirectory itself.

Call Signatures​

Call SignatureReturn TypeDescription
(event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): anyany
(event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): anyany
(event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): anyany
(event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): anyany

Call Signature Details​

(event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any​

Signature​

(event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;

(event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any​

Signature​

(event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;

(event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any​

Signature​

(event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;

(event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any​

Signature​

(event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;