From 732d31ca5103c3eda4204aa44304dfc70593c46a Mon Sep 17 00:00:00 2001 From: Dirk-Jan Wassink Date: Wed, 10 Oct 2018 11:11:39 +0200 Subject: [PATCH 001/124] Added Keyframes to InterpolationValue to support the new keyframes --- types/styled-components/index.d.ts | 1 + types/styled-components/styled-components-tests.tsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index e449633123..c6210edf91 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -37,6 +37,7 @@ export type InterpolationValue = | number | Styles | FalseyValue + | Keyframes | StyledComponentClass; export type SimpleInterpolation = | InterpolationValue diff --git a/types/styled-components/styled-components-tests.tsx b/types/styled-components/styled-components-tests.tsx index d49fae3ebd..8adfb03307 100644 --- a/types/styled-components/styled-components-tests.tsx +++ b/types/styled-components/styled-components-tests.tsx @@ -97,6 +97,14 @@ const fadeIn = keyframes` } `; +const animationRule = css` + ${fadeIn} 1s infinite alternate; +`; + +const ComponentWithKeyframe = styled.div` + animation: ${animationRule}; +`; + const theme = { main: 'mediumseagreen', }; From 10ab941fd24d8f571332b0858d4a3128015d1668 Mon Sep 17 00:00:00 2001 From: Emily Marigold Klassen Date: Wed, 10 Oct 2018 12:51:44 -0700 Subject: [PATCH 002/124] Add types for express-ntlm (#29617) --- types/express-ntlm/express-ntlm-tests.ts | 22 +++++++++++++ types/express-ntlm/index.d.ts | 40 ++++++++++++++++++++++++ types/express-ntlm/tsconfig.json | 23 ++++++++++++++ types/express-ntlm/tslint.json | 1 + 4 files changed, 86 insertions(+) create mode 100644 types/express-ntlm/express-ntlm-tests.ts create mode 100644 types/express-ntlm/index.d.ts create mode 100644 types/express-ntlm/tsconfig.json create mode 100644 types/express-ntlm/tslint.json diff --git a/types/express-ntlm/express-ntlm-tests.ts b/types/express-ntlm/express-ntlm-tests.ts new file mode 100644 index 0000000000..6874b2a0e7 --- /dev/null +++ b/types/express-ntlm/express-ntlm-tests.ts @@ -0,0 +1,22 @@ +import express = require('express'); +import ntlm = require('express-ntlm'); + +const app = express(); + +app.use(ntlm({ + debug() { + const args = Array.prototype.slice.apply(arguments); + console.log.apply(null, args); + }, + domain: 'MYDOMAIN', + domaincontroller: 'ldap://myad.example', + + // use different port (default: 389) + // domaincontroller: 'ldap://myad.example:3899', +})); + +app.all('*', (request, response) => { + response.end(JSON.stringify(request.ntlm)); // {"DomainName":"MYDOMAIN","UserName":"MYUSER","Workstation":"MYWORKSTATION"} +}); + +app.listen(80); diff --git a/types/express-ntlm/index.d.ts b/types/express-ntlm/index.d.ts new file mode 100644 index 0000000000..58949d0394 --- /dev/null +++ b/types/express-ntlm/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for express-ntlm 2.3 +// Project: https://github.com/einfallstoll/express-ntlm +// Definitions by: Emily Marigold Klassen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { ConnectionOptions } from 'tls'; + +import { Handler } from 'express'; + +declare function expressNtlm(options?: expressNtlm.Options): Handler; + +declare namespace expressNtlm { + interface Options { + prefix?: string; + badrequest?: Handler; + internalservererror?: Handler; + forbidden?: Handler; + unauthorized?: Handler; + domain?: string; + domaincontroller?: string; + tlsOptions?: ConnectionOptions; + debug?(prefix: string, message: string): void; + } + interface RequestNtlm { + DomainName?: string; + UserName?: string; + Workstation?: string; + } +} + +declare global { + namespace Express { + interface Request { + ntlm?: expressNtlm.RequestNtlm; + } + } +} + +export = expressNtlm; diff --git a/types/express-ntlm/tsconfig.json b/types/express-ntlm/tsconfig.json new file mode 100644 index 0000000000..fd451d5b7b --- /dev/null +++ b/types/express-ntlm/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-ntlm-tests.ts" + ] +} diff --git a/types/express-ntlm/tslint.json b/types/express-ntlm/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-ntlm/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6bf0bc358cd317dbc8d94e03fbcf0edfdbcce4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Fai=C3=9Ft?= Date: Wed, 10 Oct 2018 21:52:06 +0200 Subject: [PATCH 003/124] [@types/leaflet-polylinedecorator] Adjust offset, endOffset and repeat types (#29603) * offset, endOffset and repeat in the Pattern Interface can also be of type string * added a few new tests with new string offset, endOffset and repeat --- types/leaflet-polylinedecorator/index.d.ts | 7 ++-- .../leaflet-polylinedecorator-tests.ts | 41 +++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/types/leaflet-polylinedecorator/index.d.ts b/types/leaflet-polylinedecorator/index.d.ts index b3603e9f29..b66fbc58cc 100644 --- a/types/leaflet-polylinedecorator/index.d.ts +++ b/types/leaflet-polylinedecorator/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for leaflet-polylinedecorator 1.1 // Project: https://github.com/bbecquet/Leaflet.PolylineDecorator#readme // Definitions by: Viktor Soucek +// Michael Faisst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -45,9 +46,9 @@ declare module 'leaflet' { } interface Pattern { - offset?: number; - endOffset?: number; - repeat: number; + offset?: number | string; + endOffset?: number | string; + repeat: number | string; symbol: Symbol.Dash | Symbol.ArrowHead | Symbol.Marker; } diff --git a/types/leaflet-polylinedecorator/leaflet-polylinedecorator-tests.ts b/types/leaflet-polylinedecorator/leaflet-polylinedecorator-tests.ts index 7a9c5ee946..66a02cd376 100644 --- a/types/leaflet-polylinedecorator/leaflet-polylinedecorator-tests.ts +++ b/types/leaflet-polylinedecorator/leaflet-polylinedecorator-tests.ts @@ -53,3 +53,44 @@ L.polylineDecorator(polyline, { })} ] }).addTo(map); + +L.polylineDecorator(polyline, { + patterns: [ + { + offset: "10%", + repeat: 0, + symbol: L.Symbol.arrowHead({ + polygon: true, + headAngle: 45, + pixelSize: 12, + pathOptions: {} + })} + ] +}).addTo(map); + +L.polylineDecorator(polyline, { + patterns: [ + { + endOffset: "20%", + repeat: 0, + symbol: L.Symbol.arrowHead({ + polygon: true, + headAngle: 45, + pixelSize: 12, + pathOptions: {} + })} + ] +}).addTo(map); + +L.polylineDecorator(polyline, { + patterns: [ + { + repeat: "5%", + symbol: L.Symbol.arrowHead({ + polygon: true, + headAngle: 45, + pixelSize: 12, + pathOptions: {} + })} + ] +}).addTo(map); From 730cf3a53070ac629b5794385d5292b0335bd681 Mon Sep 17 00:00:00 2001 From: Felipe Lacerda Date: Wed, 10 Oct 2018 21:52:22 +0200 Subject: [PATCH 004/124] [redux-form] Add name to FieldArray.fields (#29598) --- types/redux-form/lib/FieldArray.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/redux-form/lib/FieldArray.d.ts b/types/redux-form/lib/FieldArray.d.ts index ad2198077c..a4599b5e97 100644 --- a/types/redux-form/lib/FieldArray.d.ts +++ b/types/redux-form/lib/FieldArray.d.ts @@ -36,6 +36,7 @@ export interface FieldArrayFieldsProps { getAll(): FieldValue[]; removeAll(): void; insert(index: number, value: FieldValue): void; + name: string; length: number; map(callback: FieldIterate): R[]; pop(): FieldValue; From 95fdf92cc2d27d994bc7d558d21ae79a12fb6202 Mon Sep 17 00:00:00 2001 From: Justin Powell Date: Wed, 10 Oct 2018 14:52:42 -0500 Subject: [PATCH 005/124] react-modal updates for 3.6 (#29585) * updates react-modal definitions for 3.6 * adds specs for react-modal definition updates * adds attribution for react-modal updates * remove trailing whitespace --- types/react-modal/index.d.ts | 11 +++++++++-- types/react-modal/react-modal-tests.tsx | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/types/react-modal/index.d.ts b/types/react-modal/index.d.ts index 237c725332..d04a6b5c18 100644 --- a/types/react-modal/index.d.ts +++ b/types/react-modal/index.d.ts @@ -1,11 +1,12 @@ -// Type definitions for react-modal 3.2 +// Type definitions for react-modal 3.6 // Project: https://github.com/reactjs/react-modal // Definitions by: Rajab Shakirov , // Drew Noakes , // Thomas B Homburg , // Tatu Tamminen , // Uwe Wiemer , -// Peter Blazejewicz +// Peter Blazejewicz , +// Justin Powell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -48,6 +49,9 @@ declare namespace ReactModal { /* String className to be applied to the document.body. */ bodyOpenClassName?: string; + /* String className to be applied to the document.html. */ + htmlOpenClassName?: string; + /* String or object className to be applied to the modal content. */ className?: string | Classes; @@ -87,6 +91,9 @@ declare namespace ReactModal { /* Additional aria attributes. */ aria?: Aria; + /* Additional data attributes to be applied to to the modal content in the form of "data-*" */ + data?: any; + /* String indicating the role of the modal, allowing the 'dialog' role to be applied if desired. */ role?: string; diff --git a/types/react-modal/react-modal-tests.tsx b/types/react-modal/react-modal-tests.tsx index 463ac1c7be..8dfd6d35e3 100644 --- a/types/react-modal/react-modal-tests.tsx +++ b/types/react-modal/react-modal-tests.tsx @@ -51,6 +51,10 @@ class ExampleOfUsingReactModal extends React.Component { labelledby: 'labelledby', describedby: 'describedby' }; + const customDataVariables = { + dataOne: 'one', + dataTwo: 'two' + }; return ( this.contentRef = instance} overlayRef={instance => this.overlayRef = instance} > From 3d6ded6cd7bd32cd0d997eab17a9b897dd3ec455 Mon Sep 17 00:00:00 2001 From: nixxquality Date: Wed, 10 Oct 2018 21:53:18 +0200 Subject: [PATCH 006/124] SortFunction signature should match Array.sort (#29468) -1 and 1 aren't the only numbers allowed. Any number less than or greater than 0 will sort the item properly. This enables shortcuts like (a, b) => a - b; Restricting the signature to -1 | 0 | 1 is a mistake. --- types/react-table/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index c58f54eefc..ca7981a6f8 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -27,7 +27,7 @@ export type SortedChangeFunction = (newSorted: SortingRule[], column: any, addit export type FilteredChangeFunction = (newFiltering: Filter[], column: any, value: any) => void; export type ExpandedChangeFunction = (column: any, event: any, isTouch: boolean) => void; export type ResizedChangeFunction = (newResized: Resize[], event: any) => void; -export type SortFunction = (a: any, b: any, desc: any) => -1 | 0 | 1; +export type SortFunction = (a: any, b: any, desc: any) => number; export interface Resize { id: string; From 273c8be397abaebefbd091e60ef91badd3d7a43c Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Wed, 10 Oct 2018 12:53:43 -0700 Subject: [PATCH 007/124] webauthn: Mark `rpId` and `allowCredentials` as optional for `PublicKeyCredentialRequestOptions`. (#29463) As documented at https://w3c.github.io/webauthn/#dictdef-publickeycredentialrequestoptions (already linked in the comment for the interface), the the `rpId` and and `allowCredentials` fields are optional. --- types/webappsec-credential-management/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/webappsec-credential-management/index.d.ts b/types/webappsec-credential-management/index.d.ts index a0498f34af..3c608e2202 100644 --- a/types/webappsec-credential-management/index.d.ts +++ b/types/webappsec-credential-management/index.d.ts @@ -392,8 +392,8 @@ type UserVerificationRequirement = "required" | "preferred" | "discouraged"; interface PublicKeyCredentialRequestOptions { challenge: BufferSource; timeout: number; - rpId: string; - allowCredentials: PublicKeyCredentialDescriptor[]; + rpId?: string; + allowCredentials?: PublicKeyCredentialDescriptor[]; userVerification?: UserVerificationRequirement; extensions?: any; } From 84521a00c5c1322062fe7c5c7d889089e45d8d4d Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Wed, 10 Oct 2018 12:53:58 -0700 Subject: [PATCH 008/124] touch: Add closeAfter option (#29459) --- types/touch/index.d.ts | 1 + types/touch/touch-tests.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/touch/index.d.ts b/types/touch/index.d.ts index 69b878e8ea..04aa904cc4 100644 --- a/types/touch/index.d.ts +++ b/types/touch/index.d.ts @@ -18,6 +18,7 @@ declare namespace touch { mtime?: boolean | Date; ref?: string; nocreate?: boolean; + closeAfter?: boolean; } function sync(filename: string, options?: Options): void; diff --git a/types/touch/touch-tests.ts b/types/touch/touch-tests.ts index f843b4c465..be9db26632 100644 --- a/types/touch/touch-tests.ts +++ b/types/touch/touch-tests.ts @@ -25,6 +25,8 @@ opts.ref = strVal; opts.nocreate = boolVal; +opts.closeAfter = boolVal; + let str: string; // touch API tests touch(strVal, (e) => console.log(e)); From 7e5f12eec1e5c69313ef6732a58073eec98e1494 Mon Sep 17 00:00:00 2001 From: Neil Gentleman Date: Wed, 10 Oct 2018 12:54:46 -0700 Subject: [PATCH 009/124] [react-bootstrap] fix Dropdown.Menu (#29452) * [react-bootstrap] remove incorrect exports several sub-components are exported in index.d.ts, when they are not in the library itself. should fail: `import { DropdownMenu } from 'react-bootstrap';` should succeed: `import { Dropdown } from 'react-bootstrap';` `import DropdownMenu from 'react-bootstrap/lib/DropdownMenu';` * [react-bootstrap] fix Dropdown.Menu typing DropdownMenu uses `export =`, so the import must use require, `import *`. this matches the pattern in Carousel, FormControl, etc. --- types/react-bootstrap/lib/Dropdown.d.ts | 6 +-- types/react-bootstrap/lib/index.d.ts | 50 ------------------- ...-bootstrap-individual-components-tests.tsx | 41 +++++++++++++++ 3 files changed, 43 insertions(+), 54 deletions(-) diff --git a/types/react-bootstrap/lib/Dropdown.d.ts b/types/react-bootstrap/lib/Dropdown.d.ts index 1568e6cfb5..a3f8220da7 100644 --- a/types/react-bootstrap/lib/Dropdown.d.ts +++ b/types/react-bootstrap/lib/Dropdown.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SelectCallback } from 'react-bootstrap'; -import * as DropdownToggle from './DropdownToggle'; -import * as DropdownMenu from './DropdownMenu'; +import DropdownToggle = require('./DropdownToggle'); +import DropdownMenu = require('./DropdownMenu'); declare namespace Dropdown { export interface DropdownBaseProps { @@ -26,5 +26,3 @@ declare class Dropdown extends React.Component { public static Toggle: typeof DropdownToggle; } export = Dropdown; - - diff --git a/types/react-bootstrap/lib/index.d.ts b/types/react-bootstrap/lib/index.d.ts index 1b59d08457..4a3c27a59c 100644 --- a/types/react-bootstrap/lib/index.d.ts +++ b/types/react-bootstrap/lib/index.d.ts @@ -208,8 +208,6 @@ export { ButtonToolbarProps, Carousel, CarouselProps, - CarouselCaption, - CarouselCaptionProps, CarouselItem, CarouselItemProps, Checkbox, @@ -226,20 +224,12 @@ export { DropdownProps, DropdownButton, DropdownButtonProps, - DropdownMenu, - DropdownMenuProps, - DropdownToggle, - DropdownToggleProps, Fade, FadeProps, Form, FormProps, FormControl, FormControlProps, - FormControlFeedback, - FormControlFeedbackProps, - FormControlStatic, - FormControlStaticProps, FormGroup, FormGroupProps, Glyphicon, @@ -252,10 +242,6 @@ export { ImageProps, InputGroup, InputGroupProps, - InputGroupAddon, - InputGroupAddonProps, - InputGroupButton, - InputGroupButtonProps, Jumbotron, JumbotronProps, Label, @@ -266,18 +252,6 @@ export { ListGroupItemProps, Media, MediaProps, - MediaBody, - MediaBodyProps, - MediaHeading, - MediaHeadingProps, - MediaLeft, - MediaLeftProps, - MediaList, - MediaListProps, - MediaListItem, - MediaListItemProps, - MediaRight, - MediaRightProps, MenuItem, MenuItemProps, Modal, @@ -298,12 +272,6 @@ export { NavbarProps, NavbarBrand, NavbarBrandProps, - NavbarCollapse, - NavbarCollapseProps, - NavbarHeader, - NavbarHeaderProps, - NavbarToggle, - NavbarToggleProps, NavDropdown, NavDropdownProps, NavItem, @@ -318,26 +286,10 @@ export { PageItemProps, Pager, PagerProps, - PagerItem, - PagerItemProps, Pagination, PaginationProps, - PaginationItem, - PaginationItemProps, Panel, PanelProps, - PanelHeading, - PanelHeadingProps, - PanelTitle, - PanelTitleProps, - PanelToggle, - PanelToggleProps, - PanelCollapse, - PanelCollapseProps, - PanelBody, - PanelBodyProps, - PanelFooter, - PanelFooterProps, PanelGroup, PanelGroupProps, Popover, @@ -354,8 +306,6 @@ export { SafeAnchorProps, SplitButton, SplitButtonProps, - SplitToggle, - SplitToggleProps, Tab, TabProps, TabContainer, diff --git a/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx b/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx index 9457cea4a2..c2f1e1e9c8 100644 --- a/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx +++ b/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx @@ -115,6 +115,7 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component { +