Skip to content

Commit

Permalink
use jsdoc style comments to improve intellisense overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
cemms1 committed Jan 23, 2025
1 parent 6fc9064 commit d5cbd3f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/lib/header-bidding/prebid/prebid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ import {
} from './price-config';

type CmpApi = 'iab' | 'static';
// https://docs.prebid.org/dev-docs/modules/consentManagement.html
/** @see https://docs.prebid.org/dev-docs/modules/consentManagementTcf.html */
type GDPRConfig = {
cmpApi: CmpApi;
timeout: number;
defaultGdprScope: boolean;
allowAuctionWithoutConsent?: never;
consentData?: Record<string, unknown>;
};
// https://docs.prebid.org/dev-docs/modules/consentManagementUsp.html

/** @see https://docs.prebid.org/dev-docs/modules/consentManagementUsp.html */
type USPConfig = {
cmpApi: CmpApi;
timeout: number;
Expand Down Expand Up @@ -110,7 +111,7 @@ type PbjsConfig = {
};

type PbjsEvent = 'bidWon';
// from https://docs.prebid.org/dev-docs/publisher-api-reference/getBidResponses.html
/** @see https://docs.prebid.org/dev-docs/publisher-api-reference/getBidResponses.html */
type PbjsEventData = {
width: number;
height: number;
Expand Down Expand Up @@ -153,7 +154,7 @@ type BuyerTargeting<T> = {
val: (bidResponse: DeepPartial<T>) => string | null | undefined;
};

// https://docs.prebid.org/dev-docs/publisher-api-reference/bidderSettings.html
/** @see https://docs.prebid.org/dev-docs/publisher-api-reference/bidderSettings.html */
type BidderSetting<T = Record<string, unknown>> = {
adserverTargeting: Array<BuyerTargeting<T>>;
bidCpmAdjustment: (n: number) => number;
Expand Down Expand Up @@ -230,7 +231,7 @@ declare global {
push: (cb: () => void) => void;
};
addAdUnits: (adUnits: PrebidAdUnit[]) => void;
// https://docs.prebid.org/dev-docs/publisher-api-reference/requestBids.html
/** @see https://docs.prebid.org/dev-docs/publisher-api-reference/requestBids.html */
requestBids(requestObj?: {
adUnitCodes?: string[];
adUnits?: PrebidAdUnit[];
Expand Down Expand Up @@ -354,7 +355,7 @@ const initialise = (
};
case 'tcfv2':
default:
// https://docs.prebid.org/dev-docs/modules/consentManagement.html
// https://docs.prebid.org/dev-docs/modules/consentManagementTcf.html
return {
gdpr: {
cmpApi: 'iab',
Expand Down

0 comments on commit d5cbd3f

Please sign in to comment.