diff --git a/notNeededPackages.json b/notNeededPackages.json index 3d1b57ad27758a..985c2afd444d7c 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -152,6 +152,10 @@ "libraryName": "angular-ui-router-uib-modal", "asOfVersion": "0.0.11" }, + "animejs": { + "libraryName": "animejs", + "asOfVersion": "4.0.0" + }, "ansi-colors": { "libraryName": "ansi-colors", "asOfVersion": "3.2.1" @@ -1513,6 +1517,10 @@ "libraryName": "cytoscape-popper", "asOfVersion": "4.0.0" }, + "dailymotion__vast-client": { + "libraryName": "@dailymotion/vast-client", + "asOfVersion": "6.4.1" + }, "dargs": { "libraryName": "dargs", "asOfVersion": "6.1.0" diff --git a/types/aframe/package.json b/types/aframe/package.json index 98d14f538ed84d..fb84616ce36eb2 100644 --- a/types/aframe/package.json +++ b/types/aframe/package.json @@ -6,7 +6,7 @@ "https://aframe.io/" ], "dependencies": { - "@types/animejs": "*", + "@types/animejs": "<4", "@types/three": "*" }, "devDependencies": { diff --git a/types/animejs/.npmignore b/types/animejs/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/animejs/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/animejs/animejs-tests.ts b/types/animejs/animejs-tests.ts deleted file mode 100644 index 2e39a1ccfeadf3..00000000000000 --- a/types/animejs/animejs-tests.ts +++ /dev/null @@ -1,123 +0,0 @@ -import anime, { AnimeInstance } from "animejs"; - -const test1 = anime({ - targets: "div", - duration: 40, - color: "#FFFFFF", -}); - -const callback = (anim: AnimeInstance) => { - console.log(anim.completed); - console.log(anim.animatables[0].id); - console.log(anim.animations[0].duration); -}; - -const test2 = anime({ - targets: "div", - translateX: (el: HTMLElement, i: number, index: number) => { - return 0; - }, - translateY: "40px", - color: [ - { value: "#FF0000", duration: 2000 }, - { value: "#00FF00", duration: 2000 }, - { value: "#0000FF", duration: 2000 }, - ], - duration: () => { - return 1000000000000; - }, - update: callback, - complete: callback, -}); - -const someNodes = document.querySelector("button"); - -const test3 = anime({ - targets: someNodes, - top: "-5000000em", -}); - -const tl = anime.timeline({ - loop: false, - direction: "normal", -}); - -tl.add({ - targets: ".tiny-divvy-div", - scale: 10000000, -}); - -const path = anime.path("#motionPath path"); - -test1.play(); -test1.tick(10); -test2.reverse(); -test3.pause(); -tl.seek(4000); - -tl.finished.then(() => { - console.log("I wonder if anyone will ever actually read this."); -}); - -const usesEnums = anime({ - targets: ".usingEnumsIsAReallyHandyThing", - direction: "reverse", - easing: "inoutexpo", - someProperty: "+=4000", -}); - -const bezier = anime.bezier(0, 0, 100, 100); -// anime.speed = 100000000; -(anime as any).speed = 4000; -anime.easings["hello"] = anime.bezier(0, 0, 1900, 3020); -const runningAnims = anime.running; -anime.remove(".tiny-divvy-div"); - -anime.timeline().add({ - targets: [], - duration: 1000, - easing: "linear", -}, 0); - -anime({ - targets: ".mizi", - keyframes: [ - { translateY: -40, delay: 123 }, - { translateX: 250 }, - { translateY: 40 }, - { translateX: 0 }, - { translateY: 0 }, - ], - delay: anime.stagger(200, { grid: [14, 5], from: "center" }), - endDelay: -1.12742e-12, - loop: true, - easing: (el, i, total) => { - return (t) => { - return Math.pow(Math.sin(t * (i + 1)), total); - }; - }, - loopBegin: () => { - console.log("Hello, MMM"); - }, - changeComplete: () => { - console.log("It surely had been read."); - }, -}); -anime.set( - ".test-div", - { - height: "1000px", - }, -); - -anime.get(".test-div", "height"); -anime.get(".test-div", "height", "rem"); - -// test importing from lib/ files -import animeCJS = require("animejs/lib/anime"); -import animeMin = require("animejs/lib/anime.min"); -import animeES6 from "animejs/lib/anime.es"; - -animeCJS({}); -animeES6({}); -animeMin({}); diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts deleted file mode 100644 index 046a9271ce980b..00000000000000 --- a/types/animejs/index.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -type FunctionBasedParameter = (element: HTMLElement, index: number, length: number) => number; -type AnimeCallbackFunction = (anim: anime.AnimeInstance) => void; -type CustomEasingFunction = (el: HTMLElement, index: number, length: number) => (time: number) => number; -// Allowing null is necessary because DOM queries may not return anything. -type AnimeTarget = string | object | HTMLElement | SVGElement | NodeList | null; - -declare namespace anime { - type EasingOptions = - | "linear" - | "easeInQuad" - | "easeInCubic" - | "easeInQuart" - | "easeInQuint" - | "easeInSine" - | "easeInExpo" - | "easeInCirc" - | "easeInBack" - | "easeInElastic" - | "easeInBounce" - | "easeOutQuad" - | "easeOutCubic" - | "easeOutQuart" - | "easeOutQuint" - | "easeOutSine" - | "easeOutExpo" - | "easeOutCirc" - | "easeOutBack" - | "easeOutElastic" - | "easeOutBounce" - | "easeInOutQuad" - | "easeInOutCubic" - | "easeInOutQuart" - | "easeInOutQuint" - | "easeInOutSine" - | "easeInOutExpo" - | "easeInOutCirc" - | "easeInOutBack" - | "easeInOutElastic" - | "easeInOutBounce"; - type DirectionOptions = "reverse" | "alternate" | "normal"; - - interface AnimeCallBack { - begin?: AnimeCallbackFunction | undefined; - change?: AnimeCallbackFunction | undefined; - update?: AnimeCallbackFunction | undefined; - complete?: AnimeCallbackFunction | undefined; - loopBegin?: AnimeCallbackFunction | undefined; - loopComplete?: AnimeCallbackFunction | undefined; - changeBegin?: AnimeCallbackFunction | undefined; - changeComplete?: AnimeCallbackFunction | undefined; - } - - interface AnimeInstanceParams extends AnimeCallBack { - loop?: number | boolean | undefined; - autoplay?: boolean | undefined; - direction?: DirectionOptions | string | undefined; - } - - interface AnimeAnimParams extends AnimeCallBack { - targets?: AnimeTarget | readonly AnimeTarget[] | undefined; - - duration?: number | FunctionBasedParameter | undefined; - delay?: number | FunctionBasedParameter | undefined; - endDelay?: number | FunctionBasedParameter | undefined; - elasticity?: number | FunctionBasedParameter | undefined; - round?: number | boolean | FunctionBasedParameter | undefined; - keyframes?: readonly AnimeAnimParams[] | undefined; - - easing?: EasingOptions | string | CustomEasingFunction | ((el: HTMLElement) => string) | undefined; - - [AnyAnimatedProperty: string]: any; - } - - interface AnimeParams extends AnimeInstanceParams, AnimeAnimParams { - // Just need this to merge both Params interfaces. - } - - interface Animatable { - id: number; - target: HTMLElement; - total: number; - transforms: object; - } - - interface Animation { - animatable: Animatable; - currentValue: string; - delay: number; - duration: number; - endDelay: number; - property: string; - tweens: readonly object[]; - type: string; - } - - interface AnimeInstance extends AnimeCallBack { - play(): void; - pause(): void; - restart(): void; - reverse(): void; - seek(time: number): void; - tick(time: number): void; - - began: boolean; - paused: boolean; - completed: boolean; - finished: Promise; - - autoplay: boolean; - currentTime: number; - delay: number; - direction: string; - duration: number; - loop: number | boolean; - timelineOffset: number; - progress: number; - remaining: number; - reversed: boolean; - - animatables: readonly Animatable[]; - animations: readonly Animation[]; - } - - interface AnimeTimelineAnimParams extends AnimeAnimParams { - timelineOffset: number | string | FunctionBasedParameter; - } - - interface AnimeTimelineInstance extends AnimeInstance { - add(params: AnimeAnimParams, timelineOffset?: string | number): AnimeTimelineInstance; - } - - interface StaggerOptions { - start?: number | string | undefined; - direction?: "normal" | "reverse" | undefined; - easing?: CustomEasingFunction | string | EasingOptions | undefined; - grid?: readonly number[] | undefined; - axis?: "x" | "y" | undefined; - from?: "first" | "last" | "center" | number | undefined; - } - - // Helpers - const version: string; - const speed: number; - let suspendWhenDocumentHidden: boolean; - const running: AnimeInstance[]; - const easings: { [EasingFunction: string]: (t: number) => any }; - function remove(targets: AnimeTarget | readonly AnimeTarget[]): void; - function get(targets: AnimeTarget, prop: string, unit?: string): string | number; - function path(path: string | HTMLElement | SVGElement | null, percent?: number): (prop: string) => { - el: HTMLElement | SVGElement; - property: string; - totalLength: number; - }; - function setDashoffset(el: HTMLElement | SVGElement | null): number; - function bezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number; - function stagger( - value: number | string | ReadonlyArray, - options?: StaggerOptions, - ): FunctionBasedParameter; - function set(targets: AnimeTarget, value: { [AnyAnimatedProperty: string]: any }): void; - // Timeline - function timeline(params?: AnimeParams | readonly AnimeInstance[]): AnimeTimelineInstance; - function random(min: number, max: number): number; -} - -declare function anime(params: anime.AnimeParams): anime.AnimeInstance; - -export = anime; -export as namespace anime; diff --git a/types/animejs/lib/anime.d.ts b/types/animejs/lib/anime.d.ts deleted file mode 100644 index e4f4cebf86f8f8..00000000000000 --- a/types/animejs/lib/anime.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import anime = require(".."); -export = anime; diff --git a/types/animejs/lib/anime.es.d.ts b/types/animejs/lib/anime.es.d.ts deleted file mode 100644 index 5a7f5d5826b947..00000000000000 --- a/types/animejs/lib/anime.es.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import anime = require(".."); -export default anime; diff --git a/types/animejs/lib/anime.min.d.ts b/types/animejs/lib/anime.min.d.ts deleted file mode 100644 index 361b89220e6b3b..00000000000000 --- a/types/animejs/lib/anime.min.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import anime = require(".."); -export = anime; -export as namespace anime; diff --git a/types/animejs/package.json b/types/animejs/package.json deleted file mode 100644 index 11570104d2e707..00000000000000 --- a/types/animejs/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@types/animejs", - "version": "3.1.9999", - "projects": [ - "http://animejs.com" - ], - "devDependencies": { - "@types/animejs": "workspace:." - }, - "owners": [ - { - "name": "Andrew Babin ", - "githubUsername": "A-Babin" - }, - { - "name": "southrock ", - "githubUsername": "southrock" - } - ] -} diff --git a/types/animejs/tsconfig.json b/types/animejs/tsconfig.json deleted file mode 100644 index 65c8bf26b7714c..00000000000000 --- a/types/animejs/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "allowSyntheticDefaultImports": true, - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "animejs-tests.ts" - ] -} diff --git a/types/dailymotion__vast-client/.npmignore b/types/dailymotion__vast-client/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/dailymotion__vast-client/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/dailymotion__vast-client/dailymotion__vast-client-tests.ts b/types/dailymotion__vast-client/dailymotion__vast-client-tests.ts deleted file mode 100644 index 01aaf46e5dc28d..00000000000000 --- a/types/dailymotion__vast-client/dailymotion__vast-client-tests.ts +++ /dev/null @@ -1,553 +0,0 @@ -import { - Ad, - CompanionAd, - Creative, - CreativeCompanion, - CreativeLinear, - CreativeNonLinear, - Macros, - parseDuration, - Storage, - VASTClient, - VastParseEvent, - VASTParser, - VastResponse, - VASTTracker, -} from "@dailymotion/vast-client"; - -const domParser = new DOMParser(); - -const isLinearCreative = (creative: Creative): creative is CreativeLinear => true; -const isNonLinearCreative = ( - creative: Creative, -): creative is CreativeNonLinear => true; -const isCompanion = (creative: Creative): creative is CreativeCompanion => true; - -const url = "https://test.com"; - -const clientTests = async () => { - class TestStorage extends Storage {} - - // With default values - const vastClient = new VASTClient(); - - // With cappingFreeLunch - new VASTClient(2); - - // With cappingMinimumTimeInterval - new VASTClient(0, 2000); - - // With customStorage - new VASTClient(0, 0, new TestStorage()); - - const vast = await vastClient.get(url, { - timeout: 10, - }); - - for (const ad of vast.ads) { - for (const creative of ad.creatives) { - if (isLinearCreative(creative)) { - creative.mediaFiles[0].apiFramework; - } else if (isNonLinearCreative(creative)) { - creative.variations[0].apiFramework; - } else if (isCompanion(creative)) { - creative.type; - } - } - } - - const doc = domParser.parseFromString("", "text/xml"); - - const parsedVast = await vastClient.parseVAST(doc, { - urlHandler: { - get: async (url, opts) => ({ - xml: doc, - }), - }, - }); - - parsedVast.ads; - - vastClient.hasRemainingAds() === true; - (await vastClient.getNextAds()).ads; - vastClient.getParser().on("VAST-ad-parsed", () => {}); - vastClient.addURLTemplateFilter((url) => url); - vastClient.removeLastURLTemplateFilter(); - vastClient.countURLTemplateFilters() === 1; - vastClient.clearURLTemplateFilters(); -}; - -const vastParserTests = async () => { - const parser = new VASTParser(); - - parser.on("VAST-error", ({ maxWrapperDepth }) => {}); - parser.on("VAST-warning", ({ ERRORCODE }) => {}); - parser.on("VAST-resolving", ({ ERRORMESSAGE }) => {}); - parser.on("VAST-resolved", ({ parentElement }) => {}); - parser.on("VAST-ad-parsed", ({ message }) => {}); - - parser.trackVastError( - [ - { - id: null, - url, - }, - ], - { - anyObj: true, - }, - { - anyObj: true, - }, - { - anyObj: true, - }, - ); - - await parser.fetchVAST(url); - await parser.fetchVAST(url, 1); - await parser.fetchVAST(url, 1, url); - const fetchedVast = await parser.fetchVAST(url, 1, url, {} as Ad); - fetchedVast.replace("", ""); - - await parser.parseVAST( - domParser.parseFromString("", "text/xml"), - ); - const parsedVast = await parser.parseVAST( - domParser.parseFromString("", "text/xml"), - { - allowMultipleAds: false, - }, - ); - parsedVast.ads; - - parser.getEstimatedBitrate() === 5; -}; - -const vastTrackerTests = async () => { - const client = new VASTClient(); - const ad = {} as Ad; - const creative = {} as Creative; - const variation = {} as CompanionAd; - - // With a client instance - new VASTTracker(client, ad, creative); - // For a companion ad - new VASTTracker(client, ad, creative, variation); - // With the initial muted state - new VASTTracker(client, ad, creative, null, false); - - // Without a client instance - const vastTracker = new VASTTracker(null, ad, creative); - - const macros: Macros = { - test: "123", - }; - - vastTracker.error(); - vastTracker.error(macros); - vastTracker.error(macros, false); - - vastTracker.load(); - vastTracker.load(macros); - - vastTracker.complete(); - vastTracker.complete(macros); - - vastTracker.click(); - vastTracker.click(url); - vastTracker.click(url, macros); - - vastTracker.close(); - vastTracker.close(macros); - - vastTracker.skip(); - vastTracker.skip(macros); - - vastTracker.setDuration(5); - - vastTracker.setExpand(true); - - vastTracker.setFullscreen(true); - - vastTracker.setMuted(true); - - vastTracker.setPaused(true); - - vastTracker.setProgress(5); - vastTracker.setProgress(5, macros); - vastTracker.setProgress(5, macros, true); - - vastTracker.setSkipDelay(5); - - vastTracker.trackImpression(); - vastTracker.trackImpression(macros); - - vastTracker.trackViewableImpression(); - vastTracker.trackViewableImpression(macros); - - vastTracker.trackNotViewableImpression(); - vastTracker.trackNotViewableImpression(macros); - - vastTracker.trackUndeterminedImpression(); - vastTracker.trackUndeterminedImpression(macros); - - vastTracker.notUsed(); - vastTracker.notUsed(macros); - - vastTracker.otherAdInteraction(); - vastTracker.otherAdInteraction(macros); - - vastTracker.acceptInvitation(); - vastTracker.acceptInvitation(macros); - - vastTracker.adExpand(); - vastTracker.adExpand(macros); - - vastTracker.adCollapse(); - vastTracker.adCollapse(macros); - - vastTracker.minimize(); - vastTracker.minimize(macros); - - vastTracker.convertToTimecode(5); - - vastTracker.overlayViewDuration("00:00:00"); - vastTracker.overlayViewDuration("00:00:00", macros); - - vastTracker.verificationNotExecuted(); - vastTracker.verificationNotExecuted(macros); - - vastTracker.track("impression"); - vastTracker.track("impression", macros); - vastTracker.track("impression", macros, true); -}; - -const vastResponseTests = () => { - const vastTest: VastResponse = { - ads: [ - { - id: null, - sequence: null, - adType: null, - adServingId: null, - categories: [], - expires: null, - viewableImpression: [], - system: { - value: "string", - version: "string", - }, - title: "string", - description: "string", - advertiser: null, - pricing: null, - survey: null, - errorURLTemplates: [ - "url", - ], - impressionURLTemplates: [ - { - id: "string", - url: "url", - }, - ], - creatives: [ - { - id: "string", - adId: null, - sequence: null, - apiFramework: null, - type: "string", - duration: 30, - skipDelay: -1, - mediaFiles: [ - { - id: "string", - fileURL: "url", - fileSize: 0, - deliveryType: "string", - mimeType: "string", - mediaType: "string", - codec: "string", - bitrate: 177, - minBitrate: 0, - maxBitrate: 0, - width: 640, - height: 360, - apiFramework: "string", - scalable: null, - maintainAspectRatio: null, - }, - ], - mezzanine: null, - interactiveCreativeFile: null, - closedCaptionFiles: [], - videoClickThroughURLTemplate: { - id: "string", - url: "url", - }, - videoClickTrackingURLTemplates: [ - { - id: "string", - url: "url", - }, - ], - videoCustomClickURLTemplates: [ - { - id: "string", - url: "url", - }, - ], - adParameters: null, - icons: [], - trackingEvents: { - acceptInvitationLinear: [ - "url", - ], - closeLinear: [ - "url", - ], - complete: [ - "url", - ], - creativeView: [ - "url", - ], - exitFullscreen: [ - "url", - ], - firstQuartile: [ - "url", - ], - fullscreen: [ - "url", - ], - midpoint: [ - "url", - ], - mute: [ - "url", - ], - pause: [ - "url", - ], - resume: [ - "url", - ], - rewind: [ - "url", - ], - start: [ - "url", - ], - thirdQuartile: [ - "url", - ], - unmute: [ - "url", - ], - }, - universalAdIds: [], - }, - ], - extensions: [], - adVerifications: [], - blockedAdCategories: [], - followAdditionalWrappers: true, - allowMultipleAds: false, - fallbackOnNoAd: null, - }, - ], - errorURLTemplates: [], - version: "string", - }; - - const vpaidTest: VastResponse = { - ads: [ - { - id: "id", - sequence: null, - adType: null, - adServingId: null, - categories: [], - expires: null, - viewableImpression: [], - system: { - value: "string", - version: null, - }, - title: "string", - description: "string", - advertiser: null, - pricing: null, - survey: null, - errorURLTemplates: ["url"], - impressionURLTemplates: [ - { - id: null, - url: "string", - }, - { - id: "id", - url: "string", - }, - { - id: null, - url: "string", - }, - { - id: null, - url: "string", - }, - ], - creatives: [ - { - id: null, - adId: null, - sequence: null, - apiFramework: null, - type: "string", - duration: 15, - skipDelay: -1, - mediaFiles: [ - { - id: "id", - fileURL: "url", - fileSize: 0, - deliveryType: "string", - mimeType: "string", - mediaType: "string", - codec: "", - bitrate: 0, - minBitrate: 0, - maxBitrate: 0, - width: 1422, - height: 800, - apiFramework: "string", - scalable: null, - maintainAspectRatio: null, - }, - ], - mezzanine: null, - interactiveCreativeFile: null, - closedCaptionFiles: [], - videoClickThroughURLTemplate: { - id: null, - url: "string", - }, - videoClickTrackingURLTemplates: [ - { - id: null, - url: "string", - }, - { - id: null, - url: "string", - }, - { - id: null, - url: "string", - }, - ], - videoCustomClickURLTemplates: [], - adParameters: { - value: "string", - xmlEncoded: null, - }, - icons: [], - trackingEvents: { - creativeView: ["url", "string"], - start: ["url", "string", "string"], - firstQuartile: ["url", "string", "string"], - midpoint: ["url", "string", "string"], - thirdQuartile: ["url", "string", "string"], - complete: ["url", "string", "string"], - mute: ["url", "string", "string"], - unmute: ["url", "string", "string"], - pause: ["url", "string"], - fullscreen: ["url", "string"], - rewind: ["url", "string"], - resume: ["url", "string"], - expand: ["url", "string"], - collapse: ["url", "string"], - acceptInvitation: ["url;"], - close: ["url", "string"], - skip: ["string"], - }, - universalAdIds: [], - }, - ], - extensions: [ - { - name: "string", - value: null, - attributes: { - type: "string", - }, - children: [ - { - name: "string", - value: null, - attributes: {}, - children: [ - { - name: "string", - value: null, - attributes: { - vendor: "string", - }, - children: [ - { - name: "string", - value: "string", - attributes: { - apiFramework: "string", - browserOptional: "string", - }, - children: [], - }, - { - name: "string", - value: "string", - attributes: {}, - children: [], - }, - ], - }, - ], - }, - ], - }, - ], - adVerifications: [ - { - resource: "string", - vendor: "string", - browserOptional: true, - apiFramework: "string", - type: null, - parameters: "string", - trackingEvents: {}, - }, - ], - blockedAdCategories: [], - followAdditionalWrappers: true, - allowMultipleAds: false, - fallbackOnNoAd: null, - }, - ], - errorURLTemplates: [], - version: "string", - }; -}; - -const otherTests = async () => { - parseDuration("00:00:00") === 0; - - const storage = new Storage(); - storage.getItem("123"); - storage.setItem("123", "123"); - storage.removeItem("123"); - storage.clear(); -}; diff --git a/types/dailymotion__vast-client/index.d.ts b/types/dailymotion__vast-client/index.d.ts deleted file mode 100644 index e10464522309fa..00000000000000 --- a/types/dailymotion__vast-client/index.d.ts +++ /dev/null @@ -1,432 +0,0 @@ -/// - -import { EventEmitter } from "events"; - -export class VASTClient { - constructor( - cappingFreeLunch?: number, - cappingMinimumTimeInterval?: number, - customStorage?: Storage, - ); - - get(url: string, opts?: GetOptions): Promise; - parseVAST( - vastXml: Document, - opts?: ClientParseOptions, - ): Promise; - hasRemainingAds(): boolean; - getNextAds(): Promise; - getParser(): VASTParser; - addURLTemplateFilter(filter: URLTemplateFilter): void; - removeLastURLTemplateFilter(): void; - countURLTemplateFilters(): number; - clearURLTemplateFilters(): void; -} - -export class VASTParser extends EventEmitter { - on(type: VastParseEvent, listener: VastListener): this; - trackVastError( - urlTemplates: URLTemplate[], - errorCode: GenericObject, - ...data: GenericObject[] - ): void; - fetchVAST( - url: string, - wrapperDepth?: number, - previousUrl?: string, - wrapperAd?: Ad, - ): Promise; - parseVAST( - vastXml: Document, - opts?: ParserParseOptions, - ): Promise; - getEstimatedBitrate(): number; -} - -export function parseDuration(duration: string): number; - -export type GenericObject = Record; - -export class VASTTracker extends EventEmitter { - constructor( - client: VASTClient | null, - ad: Ad, - creative: Creative, - variation?: CompanionAd | NonLinearAd | null, - muted?: boolean, - ); - - error(macros?: Macros, isCustomCode?: boolean): void; - load(macros?: Macros): void; - complete(macros?: Macros): void; - click(fallbackClickThroughURL?: string, macros?: Macros): void; - close(macros?: Macros): void; - skip(macros?: Macros): void; - setDuration(duration: number): void; - setExpand(expanded: boolean, macros?: Macros): void; - setFullscreen(fullscreen: boolean, macros?: Macros): void; - setMuted(muted: boolean, macros?: Macros): void; - setPaused(paused: boolean, macros?: Macros): void; - setProgress(progress: number, macros?: Macros, trackOnce?: boolean): void; - setSkipDelay(delay: number): void; - trackImpression(macros?: Macros): void; - trackViewableImpression(macros?: Macros): void; - trackNotViewableImpression(macros?: Macros): void; - trackUndeterminedImpression(macros?: Macros): void; - notUsed(macros?: Macros): void; - otherAdInteraction(macros?: Macros): void; - acceptInvitation(macros?: Macros): void; - adExpand(macros?: Macros): void; - adCollapse(macros?: Macros): void; - minimize(macros?: Macros): void; - convertToTimecode(seconds: number): string; - overlayViewDuration(duration: string, macros?: Macros): void; - verificationNotExecuted(macros?: Macros): void; - track(eventName: string, macros?: Macros, once?: boolean): void; -} - -export class Storage { - getItem(key: string): string | undefined; - setItem(key: string, value: any): void; - removeItem(key: string): void; - clear(): void; -} - -export interface GetOptions { - timeout?: number; - withCredentials?: boolean; - wrapperLimit?: number; - urlHandler?: URLHandler; - resolveAll?: boolean; - allowMultipleAds?: boolean; - followAdditionalWrappers?: boolean; -} - -export interface ClientParseOptions { - timeout?: number; - withCredentials?: boolean; - wrapperLimit?: number; - urlHandler?: URLHandler; - allowMultipleAds?: boolean; - followAdditionalWrappers?: boolean; - requestDuration?: number; - byteLength?: number; -} - -export interface ParserParseOptions { - allowMultipleAds?: boolean; - byteLength?: number; - resolveAll?: boolean; -} - -export interface URLHandler { - get: (url: string, opts: URLHandlerOptions) => Promise; -} - -export interface URLHandlerOptions { - timeout?: number; - withCredentials?: boolean; -} - -export interface URLHandlerResponse { - error?: Error; - statusCode?: number; - xml?: Document; - details?: URLHandlerResponseDetails; -} - -export interface URLHandlerResponseDetails { - byteLength: number; - statusCode: number; - rawXml: string; -} - -export type Macros = Record; - -export type URLTemplateFilter = (url: string) => string; - -export type VastParseEvent = - | "VAST-error" - | "VAST-warning" - | "VAST-resolving" - | "VAST-resolved" - | "VAST-ad-parsed"; - -export interface VastResponse { - ads: Ad[]; - errorURLTemplates: string[]; - version: string; -} - -export interface Ad { - id: string | null; - sequence: number | null; - adType: string | null; - adServingId: string | null; - categories: Category[]; - expires: number | null; - viewableImpression: ViewableImpression[]; - system: AdSystem | null; - title: string | null; - description: string | null; - advertiser: string | null; - pricing: string | null; - survey: Survey | null; - errorURLTemplates: string[]; - impressionURLTemplates: URLTemplate[]; - creatives: Creative[]; - extensions: Extension[]; - adVerifications: AdVerification[]; - blockedAdCategories: BlockedAdCategories[]; - followAdditionalWrappers: boolean | null; - allowMultipleAds: boolean | null; - fallbackOnNoAd: boolean | null; -} - -export interface AdSystem { - value: string | null; - version: string | null; -} - -export interface URLTemplate { - id: string | null; - url: string; -} - -export interface CreativeBase { - id: string | null; - adId: string | null; - sequence: number | null; - apiFramework: string | null; - universalAdIds: UniversalAdId[]; - creativeExtensions?: Extension[]; -} - -export interface CreativeLinear extends CreativeBase { - type: string; - duration: number; - skipDelay: number | null; - mediaFiles: MediaFile[]; - mezzanine: Mezzanine | null; - interactiveCreativeFile: InteractiveCreativeFile | null; - closedCaptionFiles: ClosedCaptionFile[]; - videoClickThroughURLTemplate: URLTemplate | null; - videoClickTrackingURLTemplates: URLTemplate[]; - videoCustomClickURLTemplates: URLTemplate[]; - adParameters: AdParameters | null; - icons: Icon[]; - trackingEvents: TrackingEvents; -} - -export type TrackingEvents = Record; - -export interface CreativeNonLinear extends CreativeBase { - type: string; - variations: NonLinearAd[]; - trackingEvents: TrackingEvents; -} - -export interface CreativeCompanion extends CreativeBase { - type: string; - required: string | null; - variations: CompanionAd[]; -} - -export type Creative = CreativeLinear | CreativeNonLinear | CreativeCompanion; - -export interface MediaFile { - id: string | null; - fileURL: string | null; - deliveryType: string; - mimeType: string | null; - codec: string | null; - bitrate: number; - minBitrate: number; - maxBitrate: number; - width: number; - height: number; - fileSize: number | null; - mediaType: string | null; - apiFramework: string | null; - scalable: boolean | null; - maintainAspectRatio: boolean | null; -} - -export interface Mezzanine { - delivery: string; - type: string; - width: number; - height: number; - codec: string | null; - id: string | null; - fileSize: number | null; - mediaType: string | null; - fileURL: string | null; -} - -export interface InteractiveCreativeFile { - type: string | null; - apiFramework: string | null; - variableDuration: boolean | null; - fileURL: string | null; -} - -export interface ClosedCaptionFile { - type: string | null; - language: string | null; - fileURL: string | null; -} - -export interface NonLinearAd { - id: string | null; - width: number; - height: number; - expandedWidth: number; - expandedHeight: number; - scalable: boolean; - maintainAspectRatio: boolean; - minSuggestedDuration: number; - apiFramework: string; - type: string | null; - staticResource: string | null; - htmlResource: string | null; - iframeResource: string | null; - nonlinearClickThroughURLTemplate: URLTemplate | null; - nonlinearClickTrackingURLTemplates: URLTemplate[]; - adParameters: AdParameters | null; -} - -export interface CompanionAd { - id: string | null; - width: number; - height: number; - assetWidth: number | null; - assetHeight: number | null; - expandedWidth: number | null; - expandedHeight: number | null; - apiFramework: string | null; - adSlotId: string | null; - pxratio: string; - renderingMode: string; - staticResources: StaticResource[]; - htmlResources: string[]; - iframeResources: string[]; - altText: string | null; - companionClickThroughURLTemplate: URLTemplate | null; - companionClickTrackingURLTemplates: URLTemplate[]; - trackingEvents: TrackingEvents; - adParameters: AdParameters | null; -} - -export interface StaticResource { - url: string; - creativeType: string | null; -} - -export interface Icon { - program: string | null; - height: number; - width: number; - xPosition: number; - yPosition: number; - apiFramework: string | null; - offset: string | null; - duration: number; - type: string | null; - pxratio: string; - staticResource: string | null; - htmlResource: string | null; - iframeResource: string | null; - iconClickThroughURLTemplate: URLTemplate | null; - iconClickTrackingURLTemplates: URLTemplate[]; - iconViewTrackingURLTemplate: URLTemplate | null; - iconClickFallbackImages: IconClickFallbackImage[]; - altText: string | null; - hoverText: string | null; -} - -export interface Extension { - name: string | null; - value: string | null; - attributes: ExtensionAttributes; - children: Extension[]; -} - -export interface ExtensionAttributes { - type?: string | null; - vendor?: string | null; - apiFramework?: string | null; - browserOptional?: string | null; -} - -export interface UniversalAdId { - idRegistry: string; - idValue: string; -} - -export interface AdVerification { - apiFramework: string | null; - browserOptional: boolean; - resource: string | null; - vendor: string | null; - type: string | null; - parameters: string | null; - trackingEvents: TrackingEvents; -} - -export interface Category { - authority: string; - value: string; -} - -export interface ViewableImpression { - id: string | null; - viewable: string[]; - notViewable: string[]; - viewUndetermined: string[]; -} - -export interface BlockedAdCategories { - authority: string; - value: string; -} - -export interface AdParameters { - value: string; - xmlEncoded: string | null; -} - -export interface Survey { - value: string; - type: string | null; -} - -export interface IconClickFallbackImage { - url: string | null; - width: string | null; - height: string | null; -} - -export type VastListener = (values: EventValues) => void; - -export interface EventValues { - ERRORCODE?: number; - ERRORMESSAGE?: string; - extensions?: Extension[]; - system?: AdSystem; - message?: string; - parentElement?: string; - specVersion?: number; - url?: string; - previousUrl?: string; - wrapperDepth?: number; - maxWrapperDepth?: number; - timeout?: number; - wrapperAd?: Ad; - error?: Error; - duration?: number; - byteLength?: number; - statusCode?: number; - type?: string; - adIndex?: number; -} diff --git a/types/dailymotion__vast-client/package.json b/types/dailymotion__vast-client/package.json deleted file mode 100644 index 04511fcb2c1dfc..00000000000000 --- a/types/dailymotion__vast-client/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/dailymotion__vast-client", - "version": "6.3.9999", - "projects": [ - "https://github.com/dailymotion/vast-client-js#readme" - ], - "devDependencies": { - "@types/dailymotion__vast-client": "workspace:." - }, - "dependencies": { - "@types/node": "*" - }, - "owners": [ - { - "name": "Connor Fitzgerald", - "githubUsername": "connorfitzgerald-sa" - } - ] -} diff --git a/types/dailymotion__vast-client/tsconfig.json b/types/dailymotion__vast-client/tsconfig.json deleted file mode 100644 index f61aff2f6ada9d..00000000000000 --- a/types/dailymotion__vast-client/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "dailymotion__vast-client-tests.ts" - ] -} diff --git a/types/geobuf/geobuf-tests.ts b/types/geobuf/geobuf-tests.ts index 85f5b9edd0cc9f..bcdc7278b1e40e 100644 --- a/types/geobuf/geobuf-tests.ts +++ b/types/geobuf/geobuf-tests.ts @@ -1,6 +1,6 @@ import * as geobuf from "geobuf"; import { GeoJSON } from "geojson"; -import Pbf = require("pbf"); +import Pbf from "pbf"; geobuf.decode(new Pbf(Uint8Array.from([]))); // $ExpectType GeoJSON || GeoJSON const geojson: GeoJSON = { diff --git a/types/geobuf/index.d.ts b/types/geobuf/index.d.ts index 5801a4b30a4c5e..febe8c0888f411 100644 --- a/types/geobuf/index.d.ts +++ b/types/geobuf/index.d.ts @@ -1,5 +1,5 @@ -import Pbf = require("pbf"); import { GeoJSON } from "geojson"; +import Pbf from "pbf"; export function decode(pbf: Pbf): GeoJSON; export function encode(obj: GeoJSON, pbf: Pbf): Uint8Array; diff --git a/types/geobuf/package.json b/types/geobuf/package.json index ef01c050217a0d..3b01005f50218e 100644 --- a/types/geobuf/package.json +++ b/types/geobuf/package.json @@ -1,13 +1,15 @@ { "private": true, "name": "@types/geobuf", - "version": "3.0.9999", + "version": "4.0.9999", + "type": "module", "projects": [ "https://github.com/mapbox/geobuf" ], + "exports": "./index.d.ts", "dependencies": { "@types/geojson": "*", - "@types/pbf": "*" + "pbf": "^4.0.1" }, "devDependencies": { "@types/geobuf": "workspace:." @@ -16,6 +18,10 @@ { "name": "Chad Burt", "githubUsername": "underbluewaters" + }, + { + "name": "Yue JIN", + "githubUsername": "kingyue737" } ] } diff --git a/types/w3c-generic-sensor/index.d.ts b/types/w3c-generic-sensor/index.d.ts index 7b43ae48fbd0da..03566a81165bee 100644 --- a/types/w3c-generic-sensor/index.d.ts +++ b/types/w3c-generic-sensor/index.d.ts @@ -26,6 +26,13 @@ declare class Sensor extends EventTarget { useCapture?: boolean, ): void; addEventListener(type: "error", listener: (this: this, ev: SensorErrorEvent) => any, useCapture?: boolean): void; + + removeEventListener( + type: "reading" | "activate", + listener: (this: this, ev: Event) => any, + useCapture?: boolean, + ): void; + removeEventListener(type: "error", listener: (this: this, ev: SensorErrorEvent) => any, useCapture?: boolean): void; } interface SensorOptions {