-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from reuters-graphics/ad-placement-names
Ad types and placement names
- Loading branch information
Showing
7 changed files
with
114 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,52 @@ | ||
export type AdType = | ||
| 'leaderboard' | ||
| 'sponsorlogo' | ||
| 'native' | ||
| 'mpu' | ||
| 'billboard'; | ||
export type LeaderboardAd = { | ||
mobile: { | ||
adType: 'leaderboard'; | ||
placementName: 'reuters_mobile_leaderboard'; | ||
}; | ||
desktop: { | ||
adType: 'leaderboard'; | ||
placementName: 'reuters_desktop_leaderboard_atf'; | ||
}; | ||
}; | ||
|
||
export type PlacementName = | ||
| 'reuters_desktop_leaderboard_atf' | ||
| 'reuters_mobile_leaderboard' | ||
| 'reuters_desktop_native_1' | ||
| 'reuters_mobile_mpu_1' | ||
| 'reuters_sponsorlogo' | ||
| 'reuters_billboard_desktop'; | ||
export type SponsorshipAd = { | ||
mobile: { | ||
adType: 'sponsorlogo'; | ||
placementName: 'reuters_sponsorlogo'; | ||
}; | ||
desktop: { | ||
adType: 'sponsorlogo'; | ||
placementName: 'reuters_sponsorlogo'; | ||
}; | ||
}; | ||
|
||
export type DesktopPlacementName = | ||
| 'reuters_desktop_leaderboard_atf' | ||
| 'reuters_desktop_native_1' | ||
| 'reuters_sponsorlogo' | ||
| 'reuters_billboard_desktop'; | ||
export type InlineAd = { | ||
mobile: { | ||
adType: 'mpu' | 'native' | 'mpu2'; | ||
placementName: 'reuters_mobile_mpu_1' | 'reuters_mobile_mpu_2' | 'reuters_mobile_mpu_3'; | ||
}; | ||
desktop: { | ||
adType: 'native' | 'canvas' | 'flex'; | ||
placementName: 'reuters_desktop_native_1' | 'reuters_desktop_native_2' | 'reuters_desktop_native_3'; | ||
}; | ||
}; | ||
|
||
export type MobilePlacementName<DesktopPlacementName extends string> = | ||
DesktopPlacementName extends 'reuters_desktop_leaderboard_atf' | ||
? 'reuters_mobile_leaderboard' | ||
: DesktopPlacementName extends 'reuters_desktop_native_1' | ||
? 'reuters_mobile_mpu_1' | ||
: DesktopPlacementName extends 'reuters_sponsorlogo' | ||
? 'reuters_sponsorlogo' | ||
: DesktopPlacementName extends 'reuters_billboard_desktop' | ||
? 'reuters_mobile_mpu_1' | ||
: never; | ||
export type DesktopPlacementName = | | ||
LeaderboardAd['desktop']['placementName'] | | ||
SponsorshipAd['desktop']['placementName'] | | ||
InlineAd['desktop']['placementName']; | ||
|
||
export type MobilePlacementName = | | ||
LeaderboardAd['mobile']['placementName'] | | ||
SponsorshipAd['mobile']['placementName'] | | ||
InlineAd['mobile']['placementName']; | ||
|
||
export type DesktopAdType = | | ||
LeaderboardAd['desktop']['adType'] | | ||
SponsorshipAd['desktop']['adType'] | | ||
InlineAd['desktop']['adType']; | ||
|
||
export type MobileAdType = | | ||
LeaderboardAd['mobile']['adType'] | | ||
SponsorshipAd['mobile']['adType'] | | ||
InlineAd['mobile']['adType']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters