UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

75 lines (74 loc) 3.25 kB
import { AdaptableObject } from '../AdaptableState/Common/AdaptableObject'; import { AdaptableSharedEntity, CustomSharedEntity, CustomSharedEntityConfig, SharedEntity } from '../AdaptableState/TeamSharingState'; import { AdaptableModule, AdaptableSharedEntityConfig } from '../types'; /** * Provides run-time access to Team Sharing Module and associated state */ export interface TeamSharingApi { /** * Retrieves all currently shared entities; async operation leveraging `TeamSharingOptions.loadSharedEntities(...)` method */ loadSharedEntities(): Promise<SharedEntity[]>; /** * Sets currently shared entities; async operation leveraging `TeamSharingOptions.persistSharedEntities(...)` method * @param sharedEntities the shared entities * @return either TRUE if the shared entities were successfully set or FALSE if the shared entities were not set */ persistSharedEntities(sharedEntities: SharedEntity[]): Promise<boolean>; /** * Whether Team Sharing is available to use */ isTeamSharingAvailable(): boolean; /** * Whether current user has full Team Sharing rights (for creating & updating shared items) */ hasTeamSharingFullRights(): boolean; /** * Opens Settings Panel with Team Sharing section selected and visible */ openTeamSharingSettingsPanel(): void; /** * Checks if active Shared Entities have updates (higher revisions than the local counterpart objects) */ checkForUpdates(): void; /** * Puts an Adaptable Object into Team Share * @param adaptableObject Adaptable Object to Share * @param module module which Shared Entity belongs to * @param sharedEntityConfig Config info about the Sharing Actions */ shareAdaptableEntity(adaptableObject: AdaptableObject, module: AdaptableModule, sharedEntityConfig: AdaptableSharedEntityConfig): void; /** * Puts an custom Object into Team Share * @param customObject custom object to Share * @param sharedEntityConfig shared entity config */ shareCustomEntity(customObject: any, sharedEntityConfig: CustomSharedEntityConfig): void; /** * Removes a Shared Entity from the Team Share. * @param entityId the technical ID (`SharedEntity.Uuid`) of the Shared Entity to be removed from Team Share */ unshareEntity(entityId: string): void; /** * Import the given Shared Entity. In case of `CustomSharedEntity`, the import logic will be delegated to `TeamSharingOptions.handleCustomSharedEntityImport(...)`. * * @param sharedEntity shared entry to import */ importSharedEntry(sharedEntity: SharedEntity): void; /** * Retrieves all locally loaded shared entries (`AdaptableSharedEntity` & `CustomSharedEntity`). */ getLoadedSharedEntities(): SharedEntity[]; /** * Retrieves locally loaded Adaptable Shared Entries. */ getLoadedAdaptableSharedEntities(): AdaptableSharedEntity[]; /** * Retrieves locally loaded Custom Shared Entries. */ getLoadedCustomSharedEntities(): CustomSharedEntity[]; /** * Refreshes the local TeamSharing state by (re)loading the remote state. */ refreshTeamSharing(): void; }