@alfresco/adf-content-services
Version:
Alfresco ADF content services
60 lines (59 loc) • 2.68 kB
TypeScript
import { ContentApi, Node, NodeEntry } from '@alfresco/js-api';
import { Subject } from 'rxjs';
import { AuthenticationService, ThumbnailService } from '@alfresco/adf-core';
import { PermissionsEnum } from '../models/permissions.enum';
import { AllowableOperationsEnum } from '../models/allowable-operations.enum';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import * as i0 from "@angular/core";
export interface FolderCreatedEvent {
name: string;
relativePath?: string;
parentId?: string;
node?: NodeEntry;
}
export declare class ContentService {
authService: AuthenticationService;
apiService: AlfrescoApiService;
private thumbnailService?;
folderCreated: Subject<FolderCreatedEvent>;
folderCreate: Subject<Node>;
folderEdit: Subject<Node>;
private _contentApi;
get contentApi(): ContentApi;
constructor(authService: AuthenticationService, apiService: AlfrescoApiService, thumbnailService?: ThumbnailService);
/**
* Gets a content URL for the given node.
*
* @param node Node or Node ID to get URL for.
* @param attachment Toggles whether to retrieve content as an attachment for download
* @param ticket Custom ticket to use for authentication
* @returns URL string or `null`
*/
getContentUrl(node: NodeEntry | string, attachment?: boolean, ticket?: string): string;
getDocumentThumbnailUrl(nodeId: string, attachment?: boolean, ticket?: string): string;
/**
* Checks if the user has permission on that node
*
* @param node Node to check permissions
* @param permission Required permission type
* @param userId Optional current user id will be taken by default
* @returns True if the user has the required permissions, false otherwise
*/
hasPermissions(node: Node, permission: PermissionsEnum | string, userId?: string): boolean;
/**
* Checks if the user has permissions on that node
*
* @param node Node to check allowableOperations
* @param allowableOperation Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
* @returns True if the user has the required permissions, false otherwise
*/
hasAllowableOperations(node: Node, allowableOperation: AllowableOperationsEnum | string): boolean;
getNodeIcon(node: Node): string;
private getFolderIcon;
isSmartFolder(node: Node): boolean;
isRuleFolder(node: Node): boolean;
isLinkFolder(node: Node): boolean;
private hasAspect;
static ɵfac: i0.ɵɵFactoryDeclaration<ContentService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ContentService>;
}