import { HttpClient, HttpEvent } from '@angular/common/http'; import { Observable } from 'rxjs'; import { IMjmlServerResponse, IUserModule, IUserTemplate, IUserTemplateCategory } from '../../interfaces/interfaces'; import { IPEmail } from '../../classes/DefaultEmail'; /** * Add Google Fonts list to IPEmail object to include into template. * MJML Convertor will filter and remove fonts that aren't used. */ export interface IEmailAndGoogleFonts extends IPEmail { googleFonts: string[]; } /** * The abstract service that must extend the user's custom REST API service. * Contains all required properties needed within project. * * Rewrite the default methods/properties to get the desired data. * We recommend using `shareReplay()` operator if it's just a simple static data. * * @example * // Create a custom service * class YourOwnRestApiService extends IpUserRestApiService {} * * // Rewrite it into AppModule * { provide: IpUserRestApiService, useClass: YourOwnRestApiService } */ export declare abstract class IpUserRestApiService { http: HttpClient; /** * Get all user merge fields to inject into text editor. */ getAllUserMergeFields$: Observable; /** * Get all Custom Modules to be included into Modules List. * We're looking for someone who could create many modules to be included by default, if you feel you can help us, please leave a message! */ getAllUserModules$: Observable; /** * Get all Predefined Templates and categories. * You can leave it to get all default templates from NGB API */ getAllUserTemplates$: Observable; constructor(http: HttpClient); /** * This method must return the chosen template from Template Gallery List IPEmail object, * see {@link IpUserRestApiService#getAllUserTemplates$|getAllUserTemplates$}. * * Sometimes it can contain 'templateData' property - in this case, just return it. * * @param category Selected Category from Template Gallery. * @param template Selected Template from Template Gallery. * * @example * if (template.templateData) { return template } */ getUserTemplateData$(category: string, template: IUserTemplate): Observable; /** * Handle all uploaded images. * FormData 'csrf' is deprecated in favor of [HttpClientXsrfModule]{@link https://angular.io/api/common/http/HttpClientXsrfModule}. * * @param body A FormData that contains 'image' and 'csrf' data. * @param uploadImagePath Define a path where NGB have to send the upload request. */ userImageUpload$(body: FormData, uploadImagePath: string): Observable>; /** * Get all images to include into Image Gallery. */ getUserImages$(): Observable; /** * Rewrite the default request which converts IPEmail to HTML, if you have a paid License, * this method allows you to rewrite the default Convertor API Path to yours. * * You can still use the default Convertor API Path, since you have a valid and active License Key. * * @param emailAndFonts IPEmail plus Google Fonts List object. * @param url Your own Convertor API Path, or leave it empty to use NGB servers. */ createHTMLTemplate$(emailAndFonts: IEmailAndGoogleFonts, url?: string): Observable; }