mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #18141 from jgainfort/fix/vast-client-vastad
Fix/vast-client support for VastAd.creatives
This commit is contained in:
Vendored
+44
-16
@@ -231,9 +231,37 @@ export interface VastError {
|
||||
ERRORCODE: string;
|
||||
}
|
||||
|
||||
export interface VastCreative {
|
||||
id: string;
|
||||
adId: string;
|
||||
trackingEvents: VastTrackingEvents;
|
||||
apiFramework: any;
|
||||
sequence: any;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface VastCreativeLinear extends VastCreative {
|
||||
adParameters: any;
|
||||
duration: number;
|
||||
icons: string[];
|
||||
mediaFiles: VastMediaFile[];
|
||||
skipDelay: boolean;
|
||||
videoClickThroughURLTemplate: string;
|
||||
videoClickTrackingURLTemplates: string[];
|
||||
videoCustomClickURLTempaltes: string[];
|
||||
}
|
||||
|
||||
export interface VastCreativeNonLinear extends VastCreative {
|
||||
variations: VastNonLinearAd[];
|
||||
}
|
||||
|
||||
export interface VastCreativeCompanion extends VastCreative {
|
||||
variations: VastCompanionAd[];
|
||||
}
|
||||
|
||||
export interface VastAd {
|
||||
advertiser: any;
|
||||
creatives: VastCreativeLinear | VastCreativeCompanion[];
|
||||
creatives: VastCreative[];
|
||||
description: string;
|
||||
errorURLTemplates: string[];
|
||||
extensions: VastAdExtension[];
|
||||
@@ -266,22 +294,22 @@ export interface VastAdChildAttributes {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface VastCreativeLinear {
|
||||
adParameters: any;
|
||||
duration: number;
|
||||
icons: string[];
|
||||
mediaFiles: VastMediaFile[];
|
||||
skipDelay: boolean;
|
||||
trackingEvents: VastTrackingEvents;
|
||||
export interface VastNonLinearAd {
|
||||
nonLinearClickTrackingURLTemplates: string[];
|
||||
nonLinearClickThroughURLTemplate: string;
|
||||
adParameters: string;
|
||||
type: string;
|
||||
videoClickThroughURLTemplate: string;
|
||||
videoClickTrackingURLTemplates: string[];
|
||||
videoCustomClickURLTempaltes: string[];
|
||||
}
|
||||
|
||||
export interface VastCreativeCompanion {
|
||||
type: string;
|
||||
variations: VastCompanionAd[];
|
||||
iframeResource: string;
|
||||
htmlResource: string;
|
||||
id: string;
|
||||
width: string;
|
||||
height: string;
|
||||
expandedWidth: string;
|
||||
expandedHeight: string;
|
||||
scalablle: boolean;
|
||||
maintainAspectRatio: boolean;
|
||||
minSuggestedDuration: number;
|
||||
apiFramework: any;
|
||||
}
|
||||
|
||||
export interface VastCompanionAd {
|
||||
|
||||
@@ -5,6 +5,13 @@ function cb(response: DMVAST.VastResponse, error: Error): void {
|
||||
if (error) return;
|
||||
// process the VAST response
|
||||
const ads: DMVAST.VastAd[] = response.ads;
|
||||
const linearCreative = response.ads[0].creatives.filter(creative => {
|
||||
return creative.type === 'linear';
|
||||
});
|
||||
if (linearCreative && linearCreative.length > 0) {
|
||||
const creative = linearCreative[0] as DMVAST.VastCreativeLinear;
|
||||
const mediaFiles = creative.mediaFiles;
|
||||
}
|
||||
}
|
||||
|
||||
// CLIENT
|
||||
|
||||
Reference in New Issue
Block a user