UNPKG

@mediarithmics/plugins-nodejs-sdk

Version:

This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate

51 lines (50 loc) 1.79 kB
/// <reference types="handlebars" /> import * as Handlebars from "handlebars"; import { TemplatingEngine } from "../../core/interfaces/mediarithmics/plugin/TemplatingEngineInterface"; import { AdRendererRequest, ItemProposal, AdRendererTemplateInstanceContext } from "../../core/index"; export interface URLHandlebarsRootContext { REQUEST: AdRendererRequest; CREATIVE: HandlebarsRootContextCreative; IAS_CLIENT_ID?: string; ORGANISATION_ID: string; AD_GROUP_ID?: string; MEDIA_ID?: string; ENCODED_MEDIA_ID?: string; CAMPAIGN_ID?: string; CREATIVE_ID: string; CACHE_BUSTER: string; CB: string; } export interface HandlebarsRootContext extends URLHandlebarsRootContext { ENCODED_CLICK_URL: string; CLICK_URL: string; ADDITIONAL_HTML?: string; } export interface RecommendationsHandlebarsRootContext extends HandlebarsRootContext { private: { redirectUrls: string[]; clickableContents: ClickableContent[]; }; RECOMMENDATIONS: ItemProposal[]; } export interface ClickableContent { item_id?: string; catalog_token: any; $content_id: number; } export interface HandlebarsRootContextCreative { CLICK_URL?: string; WIDTH: string; HEIGHT: string; } export declare function buildURLHandlebarsRootContext(adRenderRequest: AdRendererRequest, instanceContext: AdRendererTemplateInstanceContext): URLHandlebarsRootContext; export declare class HandlebarsEngine implements TemplatingEngine<void, string, HandlebarsTemplateDelegate<any>> { engine: typeof Handlebars; init(): void; compile(template: string): HandlebarsTemplateDelegate<any>; constructor(); } export declare class RecommendationsHandlebarsEngine extends HandlebarsEngine { init(): void; constructor(); }