node-fractal
Version:
Output complex, flexible, AJAX/RESTful data structures.
20 lines (19 loc) • 926 B
TypeScript
import { CollectionResource, ItemResource, Scope } from '.';
export declare abstract class TransformerAbstract {
protected availableIncludes: string[];
protected defaultIncludes: string[];
protected currentScope: Scope | null;
getAvailableIncludes(): string[];
setAvailableIncludes(availableIncludes: string[]): this;
getDefaultIncludes(): string[];
setDefaultIncludes(defaultIncludes: string[]): this;
getCurrentScope(): Scope;
setCurrentScope(currentScope: Scope): this;
processIncludedResources(scope: Scope, data: any): Record<string, any>;
protected item(data: any, transformer: any, resourceKey?: string): ItemResource<any>;
protected collection(data: any, transformer: any, resourceKey?: string): CollectionResource<any>;
private figureOutWhichIncludes;
private includeResourceIfAvailable;
private callIncludeMethod;
abstract transform(data: any): any;
}