From a33c9becd18a6c4f9269302507ae0bf82fc84cc2 Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Mon, 15 Oct 2018 17:49:12 +0200 Subject: [PATCH 001/132] fix: express-sitemap-xml takes objects (#29635) --- .../express-sitemap-xml-tests.ts | 20 ++++++++++++------- types/express-sitemap-xml/index.d.ts | 16 +++++++++++---- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/types/express-sitemap-xml/express-sitemap-xml-tests.ts b/types/express-sitemap-xml/express-sitemap-xml-tests.ts index f68dbf9696..9882f11c2a 100644 --- a/types/express-sitemap-xml/express-sitemap-xml-tests.ts +++ b/types/express-sitemap-xml/express-sitemap-xml-tests.ts @@ -1,16 +1,22 @@ import * as express from 'express'; -import expressSitemapXml from 'express-sitemap-xml'; +import expressSitemapXml, { LeafObject } from 'express-sitemap-xml'; -const urls = ['/page1', '/page2']; +const page2Leaf: LeafObject = { + changeFreq: 'weekly', + lastMod: new Date(), + url: '/page2' +}; + +const leaves = ['/page1', page2Leaf]; const base = 'http://example.com'; -const getUrls = () => urls; -const getUrlsPromise = () => Promise.resolve(urls); +const getLeaves = () => leaves; +const getLeavesPromise = () => Promise.resolve(leaves); -expressSitemapXml.buildSitemaps(urls, base).then(sitemap => typeof sitemap === 'object'); +expressSitemapXml.buildSitemaps(leaves, base).then(sitemap => typeof sitemap === 'object'); -const sitemap1 = expressSitemapXml(getUrls, base); -const sitemap2 = expressSitemapXml(getUrlsPromise, base); +const sitemap1 = expressSitemapXml(getLeaves, base); +const sitemap2 = expressSitemapXml(getLeavesPromise, base); express().use(sitemap1); express().use(sitemap2); diff --git a/types/express-sitemap-xml/index.d.ts b/types/express-sitemap-xml/index.d.ts index 6460fad25a..1926878bb5 100644 --- a/types/express-sitemap-xml/index.d.ts +++ b/types/express-sitemap-xml/index.d.ts @@ -6,14 +6,22 @@ import * as express from 'express'; -export interface Sitemap { - [url: string]: string; +export interface LeafObject { + changeFreq?: string; + lastMod?: string | Date; + url: string; } -declare function expressSitemapXml(getUrls: (() => (string[] | Promise)), base: string): express.RequestHandler; +export type SitemapLeaf = string | LeafObject; + +export interface Sitemap { + [leaf: string]: string; +} + +declare function expressSitemapXml(getUrls: (() => (SitemapLeaf[] | Promise)), base: string): express.RequestHandler; declare namespace expressSitemapXml { - function buildSitemaps(urls: string[], base: string): Promise; + function buildSitemaps(urls: SitemapLeaf[], base: string): Promise; } export default expressSitemapXml; From f1827c5eff872685c4d076eb34ca1134af0939ba Mon Sep 17 00:00:00 2001 From: Robin van Tienhoven <40362967+RobinvanTienhoven@users.noreply.github.com> Date: Mon, 15 Oct 2018 18:24:16 +0200 Subject: [PATCH 002/132] Removed locale helper tag (#29729) + The tag is not from StripeJS but from a custom library. It causes StripeJS to give a warning on the key. So removing it to make sure no errors are thrown in the future. --- types/stripejs/element.d.ts | 12 ------------ types/stripejs/stripejs-tests.ts | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/types/stripejs/element.d.ts b/types/stripejs/element.d.ts index 9a1b8b17e2..4a1e7b3c46 100644 --- a/types/stripejs/element.d.ts +++ b/types/stripejs/element.d.ts @@ -47,21 +47,9 @@ export interface ElementCreatorOptions { * The translation that should be used for the element text * `auto` defaults to the browser language * - * NOTE: Only use the `string` option in combination with - * @see isLanguageTag - * * @default 'auto' */ locale?: 'auto' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'it' | 'ja' | 'no' | 'nl' | 'sv' | 'zh' | string; - - /** - * Whether or not the locale is written in a language code - * This can be used in combination with localization libraries so that language names won't have to be formatted - * @example `en-US` - * - * @since 0.1.0 - */ - isIETFLocaleTag?: boolean; } export interface FontCSSElement { diff --git a/types/stripejs/stripejs-tests.ts b/types/stripejs/stripejs-tests.ts index 06799c2df5..1c0625861c 100644 --- a/types/stripejs/stripejs-tests.ts +++ b/types/stripejs/stripejs-tests.ts @@ -24,7 +24,7 @@ describe('StripeJS', () => { it('Should be possible to create and modify elements', () => { const creator = stripe.elements(); stripe.elements({fonts: [], locale: 'nl'}); - stripe.elements({fonts: [], locale: 'nl', isIETFLocaleTag: true}); + stripe.elements({fonts: [], locale: 'nl'}); const element = creator.create("cardCvc", {value: {postalCode: '94110'}}); element.blur(); From f89eb54b5819412cc0ce0bcc2aadaa980d1817ca Mon Sep 17 00:00:00 2001 From: Daniel Luz Date: Mon, 15 Oct 2018 13:28:27 -0300 Subject: [PATCH 003/132] Declare enum values where applicable (#29722) --- types/chart.js/chart.js-tests.ts | 2 ++ types/chart.js/index.d.ts | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 41ab453e0f..6283bd4d94 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -36,6 +36,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { tooltips: { filter: data => Number(data.yLabel) > 0, intersect: true, + mode: 'index', itemSort: (a, b) => Math.random() - 0.5, position: "average", caretPadding: 2, @@ -125,6 +126,7 @@ const chartConfig: Chart.ChartConfiguration = { backgroundColor: '#37738353', borderColor: '#37738353', borderWidth: 3, + borderCapStyle: 'round', fill: true }] }, diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index f779cdc57d..689583d8d9 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -174,6 +174,8 @@ declare namespace Chart { type PositionType = 'left' | 'right' | 'top' | 'bottom'; + type InteractionMode = 'point' | 'nearest' | 'single' | 'label' | 'index' | 'x-axis' | 'dataset' | 'x' | 'y'; + interface ChartArea { top: number; right: number; @@ -185,10 +187,10 @@ declare namespace Chart { text?: string; fillStyle?: string; hidden?: boolean; - lineCap?: string; + lineCap?: 'butt' | 'round' | 'square'; lineDash?: number[]; lineDashOffset?: number; - lineJoin?: string; + lineJoin?: 'bevel' | 'round' | 'miter'; lineWidth?: number; strokeStyle?: string; pointStyle?: PointStyle; @@ -331,7 +333,7 @@ declare namespace Chart { interface ChartTooltipOptions { enabled?: boolean; custom?(a: any): void; - mode?: string; + mode?: InteractionMode; intersect?: boolean; backgroundColor?: ChartColor; titleFontFamily?: string; @@ -373,7 +375,7 @@ declare namespace Chart { type ChartTooltipPositioner = (elements: any[], eventPosition: Point) => Point; interface ChartHoverOptions { - mode?: string; + mode?: InteractionMode; animationDuration?: number; intersect?: boolean; onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; @@ -541,10 +543,10 @@ declare namespace Chart { backgroundColor?: ChartColor | ChartColor[]; borderWidth?: number | number[]; borderColor?: ChartColor | ChartColor[]; - borderCapStyle?: string; + borderCapStyle?: 'butt' | 'round' | 'square'; borderDash?: number[]; borderDashOffset?: number; - borderJoinStyle?: string; + borderJoinStyle?: 'bevel' | 'round' | 'miter'; borderSkipped?: PositionType; data?: number[] | ChartPoint[]; fill?: boolean | number | string; @@ -566,7 +568,7 @@ declare namespace Chart { pointStyle?: PointStyle | HTMLImageElement | HTMLCanvasElement | Array; xAxisID?: string; yAxisID?: string; - type?: string; + type?: ChartType | string; hidden?: boolean; hideInLegendAndTooltip?: boolean; showLine?: boolean; From e35089cc402ddce3a63220adfd637fb21c85b4e6 Mon Sep 17 00:00:00 2001 From: Daniel Luz Date: Mon, 15 Oct 2018 13:29:55 -0300 Subject: [PATCH 004/132] Allow null/undefined embedded within numeric values (#29723) Nulls are used create deliberate gaps in charts. --- types/chart.js/chart.js-tests.ts | 2 +- types/chart.js/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 6283bd4d94..705392baed 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -19,7 +19,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { backgroundColor: "#000000", borderWidth: 1, label: "test", - data: [1] + data: [1, null, 3] } ] }, diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 689583d8d9..198b868f74 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -548,7 +548,7 @@ declare namespace Chart { borderDashOffset?: number; borderJoinStyle?: 'bevel' | 'round' | 'miter'; borderSkipped?: PositionType; - data?: number[] | ChartPoint[]; + data?: Array | ChartPoint[]; fill?: boolean | number | string; hoverBackgroundColor?: string | string[]; hoverBorderColor?: string | string[]; From 3e3b7cf82eaf74402fbf5db2f818f7fc824072ad Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Mon, 15 Oct 2018 09:30:35 -0700 Subject: [PATCH 005/132] Update three-core.d.ts (#29695) --- types/three/three-core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 3dea5e474f..2bcbd9af04 100755 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -1857,7 +1857,7 @@ export interface Intersection { face?: Face3 | null; faceIndex?: number; object: Object3D; - uv: Vector2; + uv?: Vector2; } export interface RaycasterParameters { From f51705da30ccbb3f5e8b4160feb0938e726527fb Mon Sep 17 00:00:00 2001 From: Jaff Parker Date: Mon, 15 Oct 2018 12:35:03 -0400 Subject: [PATCH 006/132] [reactstrap] Fixed the error that was preventing from extending the Button component with custom props (#29595) * Fixed the error that was preventing from extending the Button component with custom props * Changed from All to more specific ButtonHTMLProps --- types/reactstrap/lib/Button.d.ts | 2 +- types/reactstrap/reactstrap-tests.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/reactstrap/lib/Button.d.ts b/types/reactstrap/lib/Button.d.ts index 326e5f88de..f19ecf4e32 100644 --- a/types/reactstrap/lib/Button.d.ts +++ b/types/reactstrap/lib/Button.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { CSSModule } from '../index'; -export type ButtonProps = React.HTMLProps & { +export type ButtonProps = React.ButtonHTMLAttributes & { outline?: boolean; active?: boolean; block?: boolean; diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index 48afb0ce31..ee8b39ae45 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -278,6 +278,11 @@ const Example13 = ( ); +interface CustomButtonProps extends ButtonProps { + customProp: string; +} +const CustomButton: React.SFC = props =>