# TeamSharingApi

Canonical page: https://www.adaptabletools.com/docs/reference/teamsharingapi

Team Sharing: load shared objects, share an object, and import an entry someone else shared.

```ts title="TypeScript"
export interface TeamSharingApi 
```

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [checkForUpdates()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#checkforupdates) | `void` | Checks if active Shared Entities have updates (higher revisions than the local counterpart objects) |
| [getLoadedAdaptableSharedEntities()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#getloadedadaptablesharedentities) | [`AdaptableSharedEntity`](https://www.adaptabletools.com/docs/reference/adaptablesharedentity.md)`[]` | Retrieves locally loaded Adaptable Shared Entries. |
| [getLoadedCustomSharedEntities()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#getloadedcustomsharedentities) | [`CustomSharedEntity`](https://www.adaptabletools.com/docs/reference/customsharedentity.md)`[]` | Retrieves locally loaded Custom Shared Entries. |
| [getLoadedSharedEntities()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#getloadedsharedentities) | [`SharedEntity`](https://www.adaptabletools.com/docs/reference/sharedentity.md)`[]` | Retrieves all locally loaded shared entries (`AdaptableSharedEntity` &amp; `CustomSharedEntity`). |
| [hasTeamSharingFullRights()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#hasteamsharingfullrights) | `boolean` | Whether current user has full Team Sharing rights (for creating &amp; updating shared items) |
| [importSharedEntry(sharedEntity)](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#importsharedentry) | `void` | Import the given Shared Entity. In case of `CustomSharedEntity`, the import logic will be delegated to `TeamSharingOptions.handleCustomSharedEntityImport(...)`. |
| [isTeamSharingAvailable()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#isteamsharingavailable) | `boolean` | Whether Team Sharing is available to use |
| [loadSharedEntities()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#loadsharedentities) | `Promise<`[`SharedEntity`](https://www.adaptabletools.com/docs/reference/sharedentity.md)`[]>` | Retrieves all currently shared entities; async operation leveraging `TeamSharingOptions.loadSharedEntities(...)` method |
| [openTeamSharingSettingsPanel()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#openteamsharingsettingspanel) | `void` | Opens Settings Panel with Team Sharing section selected and visible |
| [persistSharedEntities(sharedEntities)](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#persistsharedentities) | `Promise<boolean>` | Sets currently shared entities; async operation leveraging `TeamSharingOptions.persistSharedEntities(...)` method |
| [refreshTeamSharing()](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#refreshteamsharing) | `void` | Refreshes the local TeamSharing state by (re)loading the remote state. |
| [shareAdaptableEntity(adaptableObject, module, sharedEntityConfig)](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#shareadaptableentity) | `void` | Puts an Adaptable Object into Team Share |
| [shareCustomEntity(customObject, sharedEntityConfig)](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#sharecustomentity) | `void` | Puts an custom Object into Team Share |
| [unshareEntity(entityId)](https://www.adaptabletools.com/docs/reference/teamsharingapi.md#unshareentity) | `void` | Removes a Shared Entity from the Team Share. |

## Method Details

### checkForUpdates

Checks if active Shared Entities have updates (higher revisions than the local counterpart objects)

```ts title="TypeScript"
checkForUpdates(): void;
```

###### Returns

`void`

### getLoadedAdaptableSharedEntities

Retrieves locally loaded Adaptable Shared Entries.

```ts title="TypeScript"
getLoadedAdaptableSharedEntities(): AdaptableSharedEntity[];
```

###### Returns

 Locally loaded Adaptable Shared Entries

[`AdaptableSharedEntity`](https://www.adaptabletools.com/docs/reference/adaptablesharedentity.md)`[]`

### getLoadedCustomSharedEntities

Retrieves locally loaded Custom Shared Entries.

```ts title="TypeScript"
getLoadedCustomSharedEntities(): CustomSharedEntity[];
```

###### Returns

 Locally loaded Custom Shared Entries

[`CustomSharedEntity`](https://www.adaptabletools.com/docs/reference/customsharedentity.md)`[]`

### getLoadedSharedEntities

Retrieves all locally loaded shared entries (`AdaptableSharedEntity` &amp; `CustomSharedEntity`).

```ts title="TypeScript"
getLoadedSharedEntities(): SharedEntity[];
```

###### Returns

 All locally loaded shared entries (`AdaptableSharedEntity` &amp; `CustomSharedEntity`)

[`SharedEntity`](https://www.adaptabletools.com/docs/reference/sharedentity.md)`[]`

### hasTeamSharingFullRights

Whether current user has full Team Sharing rights (for creating &amp; updating shared items)

```ts title="TypeScript"
hasTeamSharingFullRights(): boolean;
```

###### Returns

 `true` when current user has full Team Sharing rights (for creating &amp; updating shared items)

`boolean`

### importSharedEntry

Import the given Shared Entity. In case of `CustomSharedEntity`, the import logic will be delegated to `TeamSharingOptions.handleCustomSharedEntityImport(...)`.

```ts title="TypeScript"
importSharedEntry(sharedEntity: SharedEntity): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sharedEntity | [`SharedEntity`](https://www.adaptabletools.com/docs/reference/sharedentity.md) | shared entry to import |

###### Returns

`void`

### isTeamSharingAvailable

Whether Team Sharing is available to use

```ts title="TypeScript"
isTeamSharingAvailable(): boolean;
```

###### Returns

 `true` when Team Sharing is available to use

`boolean`

### loadSharedEntities

Retrieves all currently shared entities; async operation leveraging `TeamSharingOptions.loadSharedEntities(...)` method

```ts title="TypeScript"
loadSharedEntities(): Promise<SharedEntity[]>;
```

###### Returns

 All currently shared entities; async operation leveraging `TeamSharingOptions.loadSharedEntities(...)` method

`Promise<`[`SharedEntity`](https://www.adaptabletools.com/docs/reference/sharedentity.md)`[]>`

### openTeamSharingSettingsPanel

Opens Settings Panel with Team Sharing section selected and visible

```ts title="TypeScript"
openTeamSharingSettingsPanel(): void;
```

###### Returns

`void`

### persistSharedEntities

Sets currently shared entities; async operation leveraging `TeamSharingOptions.persistSharedEntities(...)` method

```ts title="TypeScript"
persistSharedEntities(sharedEntities: SharedEntity[]): Promise<boolean>;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sharedEntities | [`SharedEntity`](https://www.adaptabletools.com/docs/reference/sharedentity.md)`[]` | the shared entities<br/> either TRUE if the shared entities were successfully set or FALSE if the shared entities were not set |

###### Returns

 `true` after the entities are saved. `false` when Team Sharing is not available

`Promise<boolean>`

### refreshTeamSharing

Refreshes the local TeamSharing state by (re)loading the remote state.

```ts title="TypeScript"
refreshTeamSharing(): void;
```

###### Returns

`void`

### shareAdaptableEntity

Puts an Adaptable Object into Team Share

```ts title="TypeScript"
shareAdaptableEntity(adaptableObject: AdaptableObject, module: AdaptableModule, sharedEntityConfig: AdaptableSharedEntityConfig): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| adaptableObject | [`AdaptableObject`](https://www.adaptabletools.com/docs/reference/adaptableobject.md) | Adaptable Object to Share |
| module | [`AdaptableModule`](https://www.adaptabletools.com/docs/reference/adaptablemodule.md) | module which Shared Entity belongs to |
| sharedEntityConfig | [`AdaptableSharedEntityConfig`](https://www.adaptabletools.com/docs/reference/adaptablesharedentityconfig.md) | Config info about the Sharing Actions |

###### Returns

`void`

### shareCustomEntity

Puts an custom Object into Team Share

```ts title="TypeScript"
shareCustomEntity(customObject: any, sharedEntityConfig: CustomSharedEntityConfig): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| customObject | `any` | custom object to Share |
| sharedEntityConfig | [`CustomSharedEntityConfig`](https://www.adaptabletools.com/docs/reference/customsharedentityconfig.md) | shared entity config |

###### Returns

`void`

### unshareEntity

Removes a Shared Entity from the Team Share.

```ts title="TypeScript"
unshareEntity(entityId: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entityId | `string` | the technical ID (`SharedEntity.Uuid`) of the Shared Entity to be removed from Team Share |

###### Returns

`void`
