Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/ad_spiroBidAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { ajax } from '../src/ajax.js';
import { AUDIO, BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import { isPlainObject, logWarn } from '../src/utils.js';
import type { ORTBResponse } from '../src/prebid.public.js';

/**
* Adspiro bid parameters.
Expand Down Expand Up @@ -106,7 +107,7 @@ export const spec: BidderSpec<typeof BIDDER_CODE> = {
if (!isPlainObject(serverResponse?.body)) {
return [];
}
const { bids } = converter.fromORTB({ request: request.data, response: serverResponse.body }) as ExtendedResponse;
const { bids } = converter.fromORTB({ request: request.data, response: serverResponse.body as ORTBResponse }) as ExtendedResponse;
return bids;
},

Expand Down
3 changes: 3 additions & 0 deletions modules/asterioBidAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ type AsterioServerBid = {
mediaType?: string;
format?: string;
adomain?: string[];
vastXml?: string;
native?: AsterioNativeBid;
meta?: Record<string, any>;
};

type AsterioNativeImage = {
Expand Down
3 changes: 2 additions & 1 deletion modules/multibid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @module modules/multibid
*/

import type { Bid } from '../../src/bidfactory.ts';
import { config } from '../../src/config.js';
import { getHook, setupBeforeHookFnOnce } from '../../src/hook.js';
import { deepAccess, deepSetValue, getUniqueIdentifierStr, groupBy, logWarn } from '../../src/utils.js';
Expand Down Expand Up @@ -210,7 +211,7 @@ export function aliasedBiddersFirst(a, b) {
* @param {Number} adUnitBidLimit bidder targeting limit, default set to 0
* @param {Boolean} hasModified default set to false, this hook modifies targeting and sets to true
*/
export function targetBidPoolHook(fn, bidsReceived, winReducer, adUnitBidLimit = 0, hasModified = false, winSorter = highestDesirabilityFirst) {
export function targetBidPoolHook(fn, bidsReceived: Bid[], winReducer, adUnitBidLimit = 0, hasModified = false, winSorter = highestDesirabilityFirst) {
if (!config.getConfig('multibid')) resetMultiConfig();
if (hasMultibid) {
const modifiedBids = [];
Expand Down
4 changes: 2 additions & 2 deletions src/adRendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ export const getRenderingData = hook('sync', function (bidResponse: Bid, options
};
});

function prepareBidForRendering(bidResponse: Bid, options?: RenderOptions): Bid {
function prepareBidForRendering<T extends Bid>(bidResponse: T, options?: RenderOptions): T {
const { ad, adUrl, cpm, originalCpm, safeRenderer } = bidResponse;
const repl = {
AUCTION_PRICE: originalCpm || cpm,
CLICKTHROUGH: options?.clickUrl || ''
};

const result = {
const result: T = {
...bidResponse,
ad: replaceMacros(ad, repl),
adUrl: replaceMacros(adUrl, repl)
Expand Down
4 changes: 2 additions & 2 deletions src/adapterManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const PBS_ADAPTER_NAME = 'pbsBidAdapter';
export const PARTITIONS = {
CLIENT: 'client',
SERVER: 'server'
};
} as const;

export const dep = {
isAllowed: isActivityAllowed,
Expand Down Expand Up @@ -440,7 +440,7 @@ export function getS2SBidderSet(s2sConfigs) {
* @returns {Object} return.client - Array of bidder codes that should be routed to client adapters.
* @returns {Object} return.server - Array of bidder codes that should be routed to server adapters.
*/
export function _partitionBidders (adUnits, s2sConfigs, { getS2SBidders = getS2SBidderSet } = {}) {
export function _partitionBidders (adUnits, s2sConfigs, { getS2SBidders = getS2SBidderSet } = {}): { [PARTITIONS.CLIENT]: string[], [PARTITIONS.SERVER]: string[] } {
const serverBidders = getS2SBidders(s2sConfigs);
return getBidderCodes(adUnits).reduce((memo, bidder) => {
const partition = serverBidders.has(bidder) ? PARTITIONS.SERVER : PARTITIONS.CLIENT;
Expand Down
37 changes: 37 additions & 0 deletions src/types/local/safeframe.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { SafeFrameGeometry } from '../../utils.ts';

declare global {
interface Window {
$sf?: SafeFrameAPI;
}

interface SafeFrameAPI {
ext: SafeFrameExternalAPI;
}

interface SafeFrameExternalAPI {
register(
width: number,
height: number,
notify?: (event: string, data?: unknown) => void
): void;

expand(dimensions?: {
t?: number;
b?: number;
l?: number;
r?: number;
push?: boolean;
}): void;

collapse(): void;

geom(): SafeFrameGeometry;

inViewPercentage(): number;

status(): string;

supports(feature: string): boolean;
}
}
21 changes: 21 additions & 0 deletions src/types/local/scheduler.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export {};
declare global {
type TaskPriority = "user-blocking" | "user-visible" | "background";

interface SchedulerPostTaskOptions {
delay?: number;
priority?: TaskPriority;
signal?: AbortSignal;
}

interface Scheduler {
postTask<T, P extends readonly unknown[] | []>(callback: (...params: P) => T, options?: SchedulerPostTaskOptions, ...arguments: P): Promise<T>;
}

interface Window {
/**
* https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1249
*/
scheduler?: Scheduler;
}
}
Loading
Loading