diff --git a/angular-material/index.d.ts b/angular-material/index.d.ts index 0e27fe3b60..a8196269a4 100644 --- a/angular-material/index.d.ts +++ b/angular-material/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular Material (angular.material module) 1.1 // Project: https://github.com/angular/material -// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello +// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as angular from 'angular'; @@ -18,6 +18,7 @@ declare module 'angular' { controller?: string | Function; locals?: { [index: string]: any }; clickOutsideToClose?: boolean; + bindToController?: boolean; // default: false disableBackdrop?: boolean; escapeToClose?: boolean; resolve?: { [index: string]: () => angular.IPromise }; diff --git a/bookshelf/index.d.ts b/bookshelf/index.d.ts index 4aa6fd38b5..c7947579c8 100644 --- a/bookshelf/index.d.ts +++ b/bookshelf/index.d.ts @@ -17,7 +17,7 @@ interface Bookshelf extends Bookshelf.Events { Collection: typeof Bookshelf.Collection; plugin(name: string | string[] | Function, options?: any): Bookshelf; - transaction(callback: (transaction: knex.Transaction) => T): BlueBird; + transaction(callback: (transaction: knex.Transaction) => BlueBird): BlueBird; } declare function Bookshelf(knex: knex): Bookshelf; diff --git a/dir-resolve/dir-resolve-tests.ts b/dir-resolve/dir-resolve-tests.ts new file mode 100644 index 0000000000..d84f9d0efc --- /dev/null +++ b/dir-resolve/dir-resolve-tests.ts @@ -0,0 +1,3 @@ +import resolve = require("dir-resolve"); + +resolve("module/package"); diff --git a/dir-resolve/index.d.ts b/dir-resolve/index.d.ts new file mode 100644 index 0000000000..0b8f425b0b --- /dev/null +++ b/dir-resolve/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for dir-resolve 1.0 +// Project: https://github.com/mwinche/dir-resolve +// Definitions by: Andy Hanson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function resolve(path: string): string; +export = resolve; diff --git a/dir-resolve/tsconfig.json b/dir-resolve/tsconfig.json new file mode 100644 index 0000000000..1748792b1d --- /dev/null +++ b/dir-resolve/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dir-resolve-tests.ts" + ] +} \ No newline at end of file diff --git a/dir-resolve/tslint.json b/dir-resolve/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/dir-resolve/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/electron/index.d.ts b/electron/index.d.ts index 0b98ae1944..11103b3a18 100644 --- a/electron/index.d.ts +++ b/electron/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Electron v1.4.8 // Project: http://electron.atom.io/ -// Definitions by: jedmao , rhysd , Milan Burda , aliib , Daniel Perez Alvarez +// Definitions by: jedmao , rhysd , Milan Burda , aliib , Daniel Perez Alvarez , Markus Olsson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -2455,7 +2455,11 @@ declare namespace Electron { */ constructor(options: MenuItemOptions); - click: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; + /** + * A function that is fired when the MenuItem receives a click event + */ + click: (event: Event, browserWindow: BrowserWindow, webContents: WebContents) => void; + /** * Read-only property. */ @@ -2492,7 +2496,7 @@ declare namespace Electron { /** * Callback when the menu item is clicked. */ - click?: (menuItem: MenuItem, browserWindow: BrowserWindow) => void; + click?: (menuItem: MenuItem, browserWindow: BrowserWindow, event: Event) => void; /** * Can be normal, separator, submenu, checkbox or radio. */ diff --git a/electron/test/main.ts b/electron/test/main.ts index 276a15d851..35a85a81dc 100644 --- a/electron/test/main.ts +++ b/electron/test/main.ts @@ -531,12 +531,19 @@ var winWindows = new BrowserWindow({ // menu-item // https://github.com/atom/electron/blob/master/docs/api/menu-item.md -var menuItem = new MenuItem({}); +var menuItem = new MenuItem({ + click: (menuItem: Electron.MenuItem, browserWindow: Electron.BrowserWindow, event: Electron.Event) => { + console.log('click', menuItem, browserWindow, event); + } +}); + +const fakeEvent: Electron.Event = { + preventDefault: () => { }, + sender: winWindows.webContents, +} menuItem.label = 'Hello World!'; -menuItem.click = (menuItem, browserWindow) => { - console.log('click', menuItem, browserWindow); -}; +menuItem.click(fakeEvent, winWindows, winWindows.webContents) // menu // https://github.com/atom/electron/blob/master/docs/api/menu.md diff --git a/jwt-simple/index.d.ts b/jwt-simple/index.d.ts index 1ae8f18519..b70aa8c720 100644 --- a/jwt-simple/index.d.ts +++ b/jwt-simple/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jwt-simple v0.5.0 +// Type definitions for jwt-simple v0.5.1 // Project: https://github.com/hokaccha/node-jwt-simple // Definitions by: Ken Fukuyama , Gael Magnan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,7 +11,7 @@ * @param algorithm default is HS256 * @api public */ -export function decode(token: any, key: string, noVerify?: boolean): any; +export function decode(token: any, key: string, noVerify?: boolean, algorithm?: string): any; /** * Encode jwt * @param payload diff --git a/ng-file-upload/index.d.ts b/ng-file-upload/index.d.ts index d9aadbd2d5..cc5a59b2bf 100644 --- a/ng-file-upload/index.d.ts +++ b/ng-file-upload/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Angular File Upload 11.1.1 +// Type definitions for Angular File Upload 12.2 // Project: https://github.com/danialfarid/ng-file-upload -// Definitions by: John Reilly +// Definitions by: John Reilly , +// Eduardo Garcia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -103,10 +104,12 @@ declare module 'angular' { interface FileResizeOptions { centerCrop?: boolean; height?: number; - ratio?: number; + pattern?: string; + ratio?: number | string; resizeIf?: ResizeIfFunction; restoreExif?: boolean; quality?: number; + type?: string; width?: number; } diff --git a/ng-file-upload/ng-file-upload-tests.ts b/ng-file-upload/ng-file-upload-tests.ts index 08fbafdb6b..cc7f98d5bf 100644 --- a/ng-file-upload/ng-file-upload-tests.ts +++ b/ng-file-upload/ng-file-upload-tests.ts @@ -85,9 +85,11 @@ class UploadController { ratio: 0.9, centerCrop: true, restoreExif: true, - resizeIf: (width: number, height: number) => { + resizeIf: (width: number, height: number) => { return true; - } + }, + pattern: '.jpg', + type: 'image/jpeg' }) .then((resizedFile) => { console.log(resizedFile); diff --git a/react-native/index.d.ts b/react-native/index.d.ts index e120301923..29dd9fa780 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -734,6 +734,7 @@ declare module "react" { export interface TextStyleAndroid extends ViewStyle { textAlignVertical?: "auto" | "top" | "bottom" | "center" + includeFontPadding?: boolean } // @see https://facebook.github.io/react-native/docs/text.html#style @@ -2500,9 +2501,9 @@ declare module "react" { /** * Specifies the side of the screen from which the drawer will slide in. - * enum(DrawerConsts.DrawerPosition.Left, DrawerConsts.DrawerPosition.Right) + * enum(DrawerLayoutAndroid.positions.Left, DrawerLayoutAndroid.positions.Right) */ - drawerPosition?: any; + drawerPosition?: number; /** * Specifies the width of the drawer, more precisely the width of the @@ -2563,8 +2564,18 @@ declare module "react" { ref?: Ref } + interface DrawerPosition { + Left: number + Right: number + } + export interface DrawerLayoutAndroidStatic extends NativeMethodsMixin, React.ClassicComponentClass { + /** + * drawer's positions. + */ + positions: DrawerPosition + /** * Opens the drawer. */ diff --git a/react-paginate/index.d.ts b/react-paginate/index.d.ts index aaa3931b74..363aeb8ea1 100644 --- a/react-paginate/index.d.ts +++ b/react-paginate/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for react-paginate 2.1.3 +// Type definitions for react-paginate v4.2.0 // Project: https://github.com/AdeleD/react-paginate -// Definitions by: Simon Hartcher +// Definitions by: Simon Hartcher , Wouter Hardeman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -10,7 +10,7 @@ interface ReactPaginateProps { /** * The total number of pages. */ - pageNum: number; + pageCount: number; /** * The range of pages displayed. @@ -43,19 +43,24 @@ interface ReactPaginateProps { breakClassName?: string | JSX.Element; /** - * The method to call when a page is clicked. + * The method to call when a page is clicked. Exposes the current page object as an argument. */ - clickCallback?: Function; + onPageChange?: Function; /** * The initial page selected. */ - initialSelected?: number; + initialPage?: number; /** * To override selected page with parent prop. */ - forceSelected?: number; + forcePage?: number; + + /** + * Disable `onPageChange` callback with initial page. Default: `false` + */ + disableInitialCallback?: boolean /** * The classname of the pagination container. @@ -101,6 +106,11 @@ interface ReactPaginateProps { * The classname for disabled `previous` and `next` buttons. */ disabledClassName?: string; + + /** + * The method is called to generate the `href` attribute value on tag `a` of each page element. + */ + hrefBuilder?: Function; } declare const ReactPaginate: React.ComponentClass; diff --git a/react-paginate/react-paginate-tests.tsx b/react-paginate/react-paginate-tests.tsx index 2ae495eacf..42a7c49c30 100644 --- a/react-paginate/react-paginate-tests.tsx +++ b/react-paginate/react-paginate-tests.tsx @@ -5,7 +5,7 @@ class Test extends React.Component<{}, {}> { public render() { return ( diff --git a/speakingurl/index.d.ts b/speakingurl/index.d.ts index 289c1eb033..83e38fd7b8 100644 --- a/speakingurl/index.d.ts +++ b/speakingurl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for speakingurl 10.0 +// Type definitions for speakingurl 13.0 // Project: http://pid.github.io/speakingurl/ // Definitions by: Zlatko Andonovski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,7 +7,7 @@ interface Dictionary { [x: string]: T; } -interface Options { +interface SpeakingURLOptions { separator?: string; lang?: string|boolean; symbols?: boolean; @@ -20,10 +20,10 @@ interface Options { custom?: string[]|Dictionary; } -declare function getSlug(input: string, options?: Options|string): string; +declare function getSlug(input: string, options?: SpeakingURLOptions|string): string; declare namespace getSlug { - export function createSlug(options: Options): (input: string) => string; + export function createSlug(options: SpeakingURLOptions): (input: string) => string; } -export = getSlug; \ No newline at end of file +export = getSlug;