@openrtb/converter
Version:
TypeScript converter library compliant with OpenRTB 2.6/3.0 and AdCOM 1.0 and Native-Ad 1.2
63 lines (56 loc) • 2.05 kB
text/typescript
import * as iab_adcom from 'iab-adcom';
import { Display, Native, Ad } from 'iab-adcom/media';
import { Bid } from 'iab-openrtb/v26';
import { NativeRequest } from 'iab-native';
import { NativeFormat } from 'iab-adcom/placement';
interface Converter<FROM, TO> {
to(from: FROM): TO;
from(to: TO): FROM;
}
declare class V26BidToDisplayConverter implements Converter<Partial<Bid>, Display> {
to(from: Partial<Bid>): {
api: iab_adcom.APIFramework | undefined;
w: number | undefined;
h: number | undefined;
wratio: number | undefined;
hratio: number | undefined;
adm: string | undefined;
};
from(to: Display): {
adm: string | undefined;
apis: iab_adcom.APIFramework[];
w: number | undefined;
h: number | undefined;
wratio: number | undefined;
hratio: number | undefined;
};
}
declare class V26BidToNativeConverter implements Converter<Partial<Bid>, Native> {
to(from: Partial<Bid>): Native;
from(to: Native): Partial<Bid>;
private convertLink;
private convertAsset;
private convertTitle;
private convertImage;
private convertData;
private convertLinkToResponse;
private convertVideo;
private convertAssetToResponse;
private convertTitleToResponse;
private convertImageToResponse;
private convertDataToResponse;
private convertVideoToResponse;
}
declare class V26BidToAdConverter implements Converter<Partial<Bid>, Ad> {
to(from: Partial<Bid>): Ad;
from(to: Ad): Partial<Bid>;
}
declare class V12NativeRequestToNativeFormatConverter implements Converter<NativeRequest, NativeFormat> {
to(from: NativeRequest): NativeFormat;
private convertAssetsToAssetFormats;
private convertV12VideoToVideoPlacement;
from(to: NativeFormat): NativeRequest;
private convertAssetFormatsToAssets;
private convertVideoPlacementToV12Video;
}
export { V12NativeRequestToNativeFormatConverter, V26BidToAdConverter, V26BidToDisplayConverter, V26BidToNativeConverter };