@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
45 lines • 2.19 kB
TypeScript
import { IResult, Service } from '@c8y/client';
import { Observable } from 'rxjs';
import { DynamicBulkRetrievalError } from './dynamic-bulk-retrieval-error.model';
import { DynamicComponentAlert } from './dynamic-component-alert.model';
import { DynamicBulkDetailsResolver } from './dynamic-details-resolver';
import { DynamicResolverService } from './dynamic-resolver.service';
import { TranslateService } from '@ngx-translate/core';
export declare abstract class DynamicBulkIIdentifiedResolver<T extends {
id: string | number;
[key: string]: any;
}> extends DynamicBulkDetailsResolver<T> {
protected dynamicResolver: DynamicResolverService;
protected translateService: TranslateService;
/**
* You either have to provide the service or implement the performBulkRequest method on your own.
*/
protected service?: Service<T> & {
detail(entityOrId: string | number): Promise<IResult<T>>;
};
/**
* Used within the buildRetrievalAlert method to generate the alert text.
* For ManagedObjects this would be e.g. 'Unable to retrieve the following managed object: {{requestedEntity}}'
*/
protected abstract readonly errorMessage: `${string}: "{{entityName}}" ({{entityId}}).`;
constructor(dynamicResolver: DynamicResolverService, translateService: TranslateService,
/**
* You either have to provide the service or implement the performBulkRequest method on your own.
*/
service?: Service<T> & {
detail(entityOrId: string | number): Promise<IResult<T>>;
});
buildRetrievalAlert(entity: Partial<T>, errors: DynamicBulkRetrievalError[]): DynamicComponentAlert;
protected performBulkRequest(uniqIds: string[], bulkRequestId: number): Promise<{
result: T[];
bulkRequestId: number;
errors: DynamicBulkRetrievalError[];
}> | Observable<{
result: T[];
bulkRequestId: number;
errors: DynamicBulkRetrievalError[];
}>;
protected extractIdsToBeRetrieved(valueBehindAttribute: Partial<T> | Array<Partial<T>>): string | string[];
protected serializeSingleObject(obj: T): Partial<T>;
}
//# sourceMappingURL=abstract-id-resolver.d.ts.map