|
| 1 | +/* |
| 2 | + * Copyright 2024 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +/** |
| 17 | + * External dependencies |
| 18 | + */ |
| 19 | +import type { Protocol } from 'devtools-protocol'; |
| 20 | + |
| 21 | +export interface singleAuctionEvent { |
| 22 | + bidCurrency?: string; |
| 23 | + uniqueAuctionId?: Protocol.Storage.InterestGroupAuctionId; |
| 24 | + bid?: number; |
| 25 | + name?: string; |
| 26 | + ownerOrigin?: string; |
| 27 | + type: string; |
| 28 | + formattedTime: string | Date; |
| 29 | + componentSellerOrigin?: string; |
| 30 | + time: number; |
| 31 | + auctionConfig?: object; |
| 32 | + interestGroupConfig?: Protocol.Storage.InterestGroupAccessedEvent; |
| 33 | + parentAuctionId?: Protocol.Storage.InterestGroupAuctionId; |
| 34 | + eventType: |
| 35 | + | 'interestGroupAuctionEventOccurred' |
| 36 | + | 'interestGroupAuctionNetworkRequestCompleted' |
| 37 | + | 'interestGroupAuctionNetworkRequestCreated' |
| 38 | + | 'interestGroupAccessed'; |
| 39 | +} |
| 40 | + |
| 41 | +export interface auctionData { |
| 42 | + [uniqueAuctionId: Protocol.Storage.InterestGroupAuctionId]: { |
| 43 | + auctionTime: Protocol.Network.TimeSinceEpoch; |
| 44 | + auctionConfig?: any; |
| 45 | + parentAuctionId?: Protocol.Storage.InterestGroupAuctionId; |
| 46 | + }; |
| 47 | +} |
| 48 | + |
| 49 | +export type InterestGroups = singleAuctionEvent & { |
| 50 | + details: any; |
| 51 | +}; |
| 52 | + |
| 53 | +export type MultiSellerAuction = { |
| 54 | + [parentAuctionId: string]: { |
| 55 | + [uniqueAuctionId: string]: singleAuctionEvent[]; |
| 56 | + }; |
| 57 | +}; |
| 58 | + |
| 59 | +export type SingleSellerAuction = { |
| 60 | + [parentAuctionId: string]: singleAuctionEvent[]; |
| 61 | +}; |
| 62 | + |
| 63 | +export type NoBidsType = { |
| 64 | + [auctionId: string]: { |
| 65 | + ownerOrigin: string; |
| 66 | + name: string; |
| 67 | + uniqueAuctionId: string; |
| 68 | + adUnitCode?: string; |
| 69 | + mediaContainerSize?: number[][]; |
| 70 | + }; |
| 71 | +}; |
| 72 | + |
| 73 | +export type AdsAndBiddersType = { |
| 74 | + [adUnitCode: string]: { |
| 75 | + adUnitCode: string; |
| 76 | + bidders: string[]; |
| 77 | + mediaContainerSize: number[][]; |
| 78 | + }; |
| 79 | +}; |
| 80 | + |
| 81 | +export type ReceivedBids = singleAuctionEvent & { |
| 82 | + adUnitCode?: string; |
| 83 | + mediaContainerSize?: number[]; |
| 84 | +}; |
| 85 | + |
| 86 | +export type AuctionEventsType = SingleSellerAuction | MultiSellerAuction | null; |
0 commit comments