From 73e70076ff60993badba273f85653ea47d9b8710 Mon Sep 17 00:00:00 2001 From: Samuel Edwin Date: Wed, 31 Jan 2018 23:50:38 +0700 Subject: [PATCH 01/65] Add justify option to TextStyle --- types/react-native/index.d.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 8d40ad33a3..6cb72a0041 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -758,11 +758,7 @@ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { fontWeight?: "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900"; letterSpacing?: number; lineHeight?: number; - /** - * Specifies text alignment. - * The value 'justify' is only supported on iOS. - */ - textAlign?: "auto" | "left" | "right" | "center"; + textAlign?: "auto" | "left" | "right" | "center" | "justify"; textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through"; textDecorationStyle?: "solid" | "double" | "dotted" | "dashed"; textDecorationColor?: string; From 5af4ae7bf0724fdf096d565b1d51cc6f80ef8923 Mon Sep 17 00:00:00 2001 From: Yoyo Zhou Date: Wed, 31 Jan 2018 12:04:27 -0800 Subject: [PATCH 02/65] kafka-node: fix message value to be string or Buffer (#23201) --- types/kafka-node/index.d.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/types/kafka-node/index.d.ts b/types/kafka-node/index.d.ts index e5aa9cf0a8..71d1fd6728 100644 --- a/types/kafka-node/index.d.ts +++ b/types/kafka-node/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Daniel Imrie-Situnayake , Bill , Michael Haan , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + // # Classes export class Client { constructor(connectionString: string, clientId?: string, options?: ZKOptions, noBatchOptions?: AckBatchOptions, sslOptions?: any); @@ -88,24 +90,24 @@ export class Offset { } export class KeyedMessage { - constructor(key: string, message: string); + constructor(key: string, value: string | Buffer); } // # Interfaces export interface Message { - topic: string; - value: string; - offset?: number; - partition?: number; - highWaterOffset?: number; - key?: string; -} + topic: string; + value: string | Buffer; + offset?: number; + partition?: number; + highWaterOffset?: number; + key?: string; + } export interface ProducerOptions { - requireAcks?: number; - ackTimeoutMs?: number; - partitionerType?: number; + requireAcks?: number; + ackTimeoutMs?: number; + partitionerType?: number; } export interface KafkaClientOptions { From c8e5d4efd968ba4bc9df8b6e06c82a29b48148d6 Mon Sep 17 00:00:00 2001 From: JR Date: Wed, 31 Jan 2018 20:11:16 +0000 Subject: [PATCH 03/65] Update index.d.ts (#23216) Added optional className prop on `ReduxToastrProps` to support https://github.com/diegoddox/react-redux-toastr/issues/103 --- types/react-redux-toastr/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-redux-toastr/index.d.ts b/types/react-redux-toastr/index.d.ts index 29570b99a2..125e0f138e 100644 --- a/types/react-redux-toastr/index.d.ts +++ b/types/react-redux-toastr/index.d.ts @@ -100,6 +100,7 @@ interface ReduxToastrProps { toastr?: ToastrState; transitionIn?: transitionInType; transitionOut?: transitionOutType; + className?: string; } interface ToastrEmitter { From 5f07b0f39bf6f52302c1c1f3cee2d2ec4f8f1c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Wed, 31 Jan 2018 21:15:55 +0100 Subject: [PATCH 04/65] [react-loadable] ability to import types which were unavailable (#23218) * import/export * contributors * fix namespace --- types/react-loadable/index.d.ts | 9 ++++++--- types/react-loadable/test/index.tsx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/types/react-loadable/index.d.ts b/types/react-loadable/index.d.ts index 8b591d3f3a..08c5b52e39 100644 --- a/types/react-loadable/index.d.ts +++ b/types/react-loadable/index.d.ts @@ -1,12 +1,15 @@ // Type definitions for react-loadable 5.3 // Project: https://github.com/thejameskyle/react-loadable#readme -// Definitions by: Diogo Franco , Oden S. , Ian Ker-Seymer +// Definitions by: Diogo Franco +// Oden S. +// Ian Ker-Seymer +// Tomek Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 /// -declare namespace Loadable { +declare namespace LoadableExport { interface LoadingComponentProps { isLoading: boolean; pastDelay: boolean; @@ -182,7 +185,7 @@ declare namespace Loadable { } } -declare const LoadableExport: Loadable.Loadable; +declare const LoadableExport: LoadableExport.Loadable; /* tslint:disable-next-line */ declare module "react-loadable" { diff --git a/types/react-loadable/test/index.tsx b/types/react-loadable/test/index.tsx index 5045fdf125..7d25d849a7 100644 --- a/types/react-loadable/test/index.tsx +++ b/types/react-loadable/test/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Loadable = require('react-loadable'); +import * as Loadable from 'react-loadable'; class LoadingComponent extends React.Component { render() { From cd92f62f153d923b65941958d2d90d8699a78ee3 Mon Sep 17 00:00:00 2001 From: Mykola Date: Wed, 31 Jan 2018 12:20:20 -0800 Subject: [PATCH 05/65] Fix typo (#23277) --- types/mongoose/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 7ac3ee7e41..3cf4e4ca2a 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -694,7 +694,7 @@ declare module "mongoose" { } interface SchemaOptions { - /** defaults to null (which means use the connection's autoIndex option) */ + /** defaults to false (which means use the connection's autoIndex option) */ autoIndex?: boolean; /** defaults to true */ bufferCommands?: boolean; From c08ff42c6244ad335b5be2c11419dce4ca37d40b Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Wed, 31 Jan 2018 21:23:00 +0100 Subject: [PATCH 06/65] Add types for ed2curve (#23286) --- types/ed2curve/ed2curve-tests.ts | 9 +++++++++ types/ed2curve/index.d.ts | 34 ++++++++++++++++++++++++++++++++ types/ed2curve/tsconfig.json | 23 +++++++++++++++++++++ types/ed2curve/tslint.json | 1 + 4 files changed, 67 insertions(+) create mode 100644 types/ed2curve/ed2curve-tests.ts create mode 100644 types/ed2curve/index.d.ts create mode 100644 types/ed2curve/tsconfig.json create mode 100644 types/ed2curve/tslint.json diff --git a/types/ed2curve/ed2curve-tests.ts b/types/ed2curve/ed2curve-tests.ts new file mode 100644 index 0000000000..bb26cf5b49 --- /dev/null +++ b/types/ed2curve/ed2curve-tests.ts @@ -0,0 +1,9 @@ +import * as ed2curve from 'ed2curve'; +import * as nacl from 'tweetnacl'; + +const myKeyPair = nacl.sign.keyPair(); + +const newPublicKey = ed2curve.convertPublicKey(myKeyPair.publicKey); +const newSecretKey = ed2curve.convertSecretKey(myKeyPair.secretKey); + +const newKeyPair = ed2curve.convertKeyPair(myKeyPair); diff --git a/types/ed2curve/index.d.ts b/types/ed2curve/index.d.ts new file mode 100644 index 0000000000..5dd9b1e748 --- /dev/null +++ b/types/ed2curve/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for ed2curve 0.2 +// Project: https://github.com/dchest/ed2curve-js +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export as namespace ed2curve; + +export type Ed25519PublicKey = Uint8Array; +export type Ed25519SecretKey = Uint8Array; +export type Curve25519PublicKey = Uint8Array; +export type Curve25519SecretKey = Uint8Array; + +export interface Ed25519KeyPair { + publicKey: Ed25519PublicKey; + secretKey: Ed25519SecretKey; +} + +export interface Curve25519KeyPair { + publicKey: Curve25519PublicKey; + secretKey: Curve25519SecretKey; +} + +/** + * Converts Ed25519 public key to Curve25519 public key. + * montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p + */ +export function convertPublicKey(publicKey: Ed25519PublicKey): Curve25519PublicKey | null; + +/** Converts Ed25519 secret key to Curve25519 secret key. */ +export function convertSecretKey(secretKey: Ed25519SecretKey): Curve25519SecretKey | null; + +/** Converts Ed25519 key pair to Curve25519 key pair. */ +export function convertKeyPair(keyPair: Ed25519KeyPair): Curve25519KeyPair; diff --git a/types/ed2curve/tsconfig.json b/types/ed2curve/tsconfig.json new file mode 100644 index 0000000000..38f4c49228 --- /dev/null +++ b/types/ed2curve/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ed2curve-tests.ts" + ] +} diff --git a/types/ed2curve/tslint.json b/types/ed2curve/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ed2curve/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2b7d8a255ece3358b73e3aa8c98a5ccdc406f234 Mon Sep 17 00:00:00 2001 From: ArtworkAD Date: Wed, 31 Jan 2018 21:25:06 +0100 Subject: [PATCH 07/65] [qrcode]improve types of qrcode@1.2.0 (#23289) * [qrcode]improve types of qrcode@1.2.0 Add toDataURL with promise as response * [qrcode]improve types of qrcode@1.2.0 - add similar methods for toCanvas - method with short signature comes before method with long signature * [qrcode]improve types of qrcode@1.2.0 - toFile promise - toFileStream promise - toString promise --- types/qrcode/index.d.ts | 70 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/types/qrcode/index.d.ts b/types/qrcode/index.d.ts index cb2ce4a9b7..c04a07c20f 100644 --- a/types/qrcode/index.d.ts +++ b/types/qrcode/index.d.ts @@ -127,65 +127,127 @@ export interface QRCode { */ export function create(text: string | QRCodeSegment[], options: QRCodeOptions): QRCode; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(text: string | QRCodeSegment[], callback: (error: Error, canvas: HTMLCanvasElement) => void): void; +/** + * Draws qr code symbol to canvas. + */ +export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Draws qr code symbol to canvas. */ export function toCanvas(text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error, canvas: HTMLCanvasElement) => void): void; +/** + * Draws qr code symbol to node canvas. + */ +export function toCanvas(canvas: any, text: string | QRCodeSegment[]): Promise; /** * Draws qr code symbol to node canvas. */ export function toCanvas(canvas: any, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Draws qr code symbol to node canvas. + */ +export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Draws qr code symbol to node canvas. */ export function toCanvas(canvas: any, text: string | QRCodeSegment[], options: QRCodeOptions, callback: (error: Error) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[]): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], callback: (error: Error, url: string) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(canvasElement: HTMLCanvasElement, text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(text: string | QRCodeSegment[]): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(text: string | QRCodeSegment[], callback: (error: Error, url: string) => void): void; +/** + * Returns a Data URI containing a representation of the QR Code image. + */ +export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions): Promise; /** * Returns a Data URI containing a representation of the QR Code image. */ export function toDataURL(text: string | QRCodeSegment[], options: QRCodeToDataURLOptions, callback: (error: Error, url: string) => void): void; +/** + * Returns a string representation of the QR Code. + * If choosen output format is svg it will returns a string containing xml code. + */ +export function toString(text: string | QRCodeSegment[]): Promise; /** * Returns a string representation of the QR Code. * If choosen output format is svg it will returns a string containing xml code. */ export function toString(text: string | QRCodeSegment[], callback: (error: Error, string: string) => void): void; +/** + * Returns a string representation of the QR Code. + * If choosen output format is svg it will returns a string containing xml code. + */ +export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions): Promise; /** * Returns a string representation of the QR Code. * If choosen output format is svg it will returns a string containing xml code. */ export function toString(text: string | QRCodeSegment[], options: QRCodeToStringOptions, callback: (error: Error, string: string) => void): void; +/** + * Saves QR Code to image file. + * If options.type is not specified, the format will be guessed from file extension. + * Recognized extensions are png, svg, txt. + */ +export function toFile(path: string, text: string | QRCodeSegment[]): Promise; /** * Saves QR Code to image file. * If options.type is not specified, the format will be guessed from file extension. * Recognized extensions are png, svg, txt. */ export function toFile(path: string, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Saves QR Code to image file. + * If options.type is not specified, the format will be guessed from file extension. + * Recognized extensions are png, svg, txt. + */ +export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions): Promise; /** * Saves QR Code to image file. * If options.type is not specified, the format will be guessed from file extension. @@ -193,10 +255,18 @@ export function toFile(path: string, text: string | QRCodeSegment[], callback: ( */ export function toFile(path: string, text: string | QRCodeSegment[], options: QRCodeToFileOptions, callback: (error: Error) => void): void; +/** + * Writes QR Code image to stream. Only works with png format for now. + */ +export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[]): Promise; /** * Writes QR Code image to stream. Only works with png format for now. */ export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], callback: (error: Error) => void): void; +/** + * Writes QR Code image to stream. Only works with png format for now. + */ +export function toFileStream(stream: stream.Writable, text: string | QRCodeSegment[], options: QRCodeOptions): Promise; /** * Writes QR Code image to stream. Only works with png format for now. */ From f720993a036964faa979a9549e79cf0830a380c8 Mon Sep 17 00:00:00 2001 From: Philippe D'Alva Date: Wed, 31 Jan 2018 15:30:44 -0500 Subject: [PATCH 08/65] @types/zeromq - Update monitor function by adding numOfEvents parameter (#23295) --- types/zeromq/index.d.ts | 9 ++++++--- types/zeromq/zeromq-tests.ts | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/types/zeromq/index.d.ts b/types/zeromq/index.d.ts index 949a5f567b..189d60fc29 100644 --- a/types/zeromq/index.d.ts +++ b/types/zeromq/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for zeromq 4.5 +// Type definitions for zeromq 4.6 // Project: https://github.com/zeromq/zeromq.js -// Definitions by: Dave McKeown , Erik Mavrinac +// Definitions by: Dave McKeown +// Erik Mavrinac +// Philippe D'Alva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // // Forked from the DefinitelyTyped 'zmq' project originally created by Dave McKeown, @@ -149,9 +151,10 @@ export class Socket { * Each event receives the parameters: (eventValue, eventEndpointAddrress, error) * * @param timer interval in ms > 0 or Undefined for default + * @param numOfEvents The maximum number of events to read on each interval, default is 1, use 0 for reading all events * @return for chaining */ - monitor(interval?: number): Socket; + monitor(interval?: number, numOfEvents?: number): Socket; /** * Close the socket. diff --git a/types/zeromq/zeromq-tests.ts b/types/zeromq/zeromq-tests.ts index a49de9cc7d..a1230957a7 100644 --- a/types/zeromq/zeromq-tests.ts +++ b/types/zeromq/zeromq-tests.ts @@ -37,6 +37,7 @@ function test5() { }); sock.monitor(); sock.monitor(10); + sock.monitor(10, 2); } function test6() { From 63cf738f9bd82396b56100afe34279a3d91a9754 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 31 Jan 2018 12:31:13 -0800 Subject: [PATCH 09/65] React typings typo: it's vs its (#23296) "its" as the plural, not "it's" as "it is". --- types/react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 83ab445356..c39e5eeb6c 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -3723,7 +3723,7 @@ declare namespace React { // ---------------------------------------------------------------------- interface ErrorInfo { /** - * Captures which component contained the exception, and it's ancestors. + * Captures which component contained the exception, and its ancestors. */ componentStack: string; } From 97e14b8a814b531b8d2de4e0a1990c3eba94c707 Mon Sep 17 00:00:00 2001 From: x22x22 Date: Thu, 1 Feb 2018 04:32:06 +0800 Subject: [PATCH 10/65] [node-forge]add forge.pki.createCertificate() and supplement interface Certificate (#23298) * add forge.pki.createCertificate() add forge.pki.createCertificate() * [node-forge]add forge.pki.createCertificate() and supplement interface Certificate [node-forge]add forge.pki.createCertificate() and supplement interface Certificate - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [ ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: - [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/x22x22/forge/blob/74b7472b2143735fca0c68a7f20ba32c4fbd5397/lib/x509.js#L910 - [ ] Increase the version number in the header if appropriate. - [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`. * [node-forge]add forge.pki.createCertificate() and supplement interface Certificate [node-forge]add forge.pki.createCertificate() and supplement interface Certificate - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [ ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: - [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/x22x22/forge/blob/74b7472b2143735fca0c68a7f20ba32c4fbd5397/lib/x509.js#L910 - [ ] Increase the version number in the header if appropriate. - [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`. * [node-forge]add forge.pki.createCertificate() and supplement interface Certificate [node-forge]add forge.pki.createCertificate() and supplement interface Certificate * [node-forge]add forge.pki.createCertificate() and supplement interface Certificate [node-forge]add forge.pki.createCertificate() and supplement interface Certificate --- types/node-forge/index.d.ts | 57 ++++++++++++++++- types/node-forge/node-forge-tests.ts | 93 ++++++++++++++++++++++------ 2 files changed, 127 insertions(+), 23 deletions(-) diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index a5d3f078fe..2784d95fa3 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -14,7 +14,7 @@ declare module "node-forge" { type Utf8 = string; type OID = string; - namespace pem { + namespace pem { interface EncodeOptions { maxline?: number; @@ -32,7 +32,7 @@ declare module "node-forge" { function encode(msg: ObjectPEM, options?: EncodeOptions): string; function decode(str: string): ObjectPEM[]; } - + namespace pki { type PEM = string; @@ -79,10 +79,11 @@ declare module "node-forge" { interface CertificateField extends CertificateFieldOptions { valueConstructed?: boolean; valueTagClass?: asn1.Class; - value?: any[]; + value?: any[] | string; extensions?: any[]; } + interface Certificate { version: number; serialNumber: string; @@ -107,11 +108,61 @@ declare module "node-forge" { extensions: any[]; publicKey: any; md: any; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setSubject(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setIssuer(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the extensions of this certificate. + * + * @param exts the array of extensions to use. + */ + setExtensions(exts: any[]): void; + /** + * Gets an extension by its name or id. + * + * @param options the name to use or an object with: + * name the name to use. + * id the id to use. + * + * @return the extension or null if not found. + */ + getExtension(options: string | {name: string;} | {id: number;}): {} | undefined; + + /** + * Signs this certificate using the given private key. + * + * @param key the private key to sign with. + * @param md the message digest object to use (defaults to forge.md.sha1). + */ + sign(key: pki.Key, md: md.MessageDigest): void; + /** + * Attempts verify the signature on the passed certificate using this + * certificate's public key. + * + * @param child the certificate to verify. + * + * @return true if verified, false if not. + */ + verify(child: Certificate): boolean; + } function certificateFromAsn1(obj: asn1.Asn1, computeHash?: boolean): Certificate; function decryptRsaPrivateKey(pem: PEM, passphrase?: string): Key; + + function createCertificate(): Certificate; } namespace ssh { diff --git a/types/node-forge/node-forge-tests.ts b/types/node-forge/node-forge-tests.ts index 63ccca6c70..29b8267714 100644 --- a/types/node-forge/node-forge-tests.ts +++ b/types/node-forge/node-forge-tests.ts @@ -1,4 +1,4 @@ -import * as forge from "node-forge"; +import * as forge from 'node-forge'; let keypair = forge.pki.rsa.generateKeyPair({ bits: 512 }); let privateKeyPem = forge.pki.privateKeyToPem(keypair.privateKey); @@ -8,19 +8,23 @@ let x: string = forge.ssh.privateKeyToOpenSSH(key); let pemKey: forge.pki.PEM = publicKeyPem; let publicKeyRsa = forge.pki.publicKeyFromPem(pemKey); let privateKeyRsa = forge.pki.privateKeyFromPem(privateKeyPem); +let cert = forge.pki.createCertificate(); { let subjectPublicKeyInfo = forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.OID, false, - forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes(), + forge.asn1.create( + forge.asn1.Class.UNIVERSAL, + forge.asn1.Type.OID, + false, + forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes() ), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, ''), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, '') ]), forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.BITSTRING, false, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []) ]) ]) ]); @@ -52,12 +56,14 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin src = new Uint8Array(2); encode = forge.util.binary.hex.encode(src); decode = forge.util.binary.hex.decode(encode); - if (encode !== '0000' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.hex.encode / decode fail'); + if (encode !== '0000' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.hex.encode / decode fail'); src = new Uint8Array(2); encode = forge.util.binary.base64.encode(src); decode = forge.util.binary.base64.decode(encode); - if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.base64.encode / decode fail'); + if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.base64.encode / decode fail'); src = new Uint8Array(10); encode = forge.util.binary.raw.encode(src); @@ -97,7 +103,6 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin if (hex.length !== 40) throw Error('forge.md.MessageDigest.update / digest fail'); } - { let md: forge.md.MessageDigest; let hex: string; @@ -110,26 +115,74 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin } { - let payload = { "asd": "asd" } - let cipher = forge.cipher.createCipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let payload = { asd: 'asd' }; + let cipher = forge.cipher.createCipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); cipher.start(); - cipher.update(forge.util.createBuffer(JSON.stringify(payload), "raw")); + cipher.update(forge.util.createBuffer(JSON.stringify(payload), 'raw')); cipher.finish(); let encrypted = cipher.output; let token = forge.util.encode64(encrypted.getBytes()); - let decipher = forge.cipher.createDecipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let decipher = forge.cipher.createDecipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); decipher.start(); - decipher.update(forge.util.createBuffer(forge.util.decode64(token), "raw")); + decipher.update(forge.util.createBuffer(forge.util.decode64(token), 'raw')); decipher.finish(); let decrypted = decipher.output as forge.util.ByteStringBuffer; let content = JSON.parse(forge.util.encodeUtf8(decrypted.getBytes())); if (content.asd == payload.asd) throw Error('forge.cipher.createCipher failed'); -} \ No newline at end of file +} + +{ + cert.publicKey = keypair.publicKey; + cert.serialNumber = new Date().getTime() + ''; + cert.validity.notBefore = new Date(); + cert.validity.notAfter = new Date(); + cert.validity.notAfter.setFullYear(cert.validity.notAfter.getFullYear() + 20); + const attrs = [ + { + name: 'commonName', + value: 'x22x22' + }, + { + name: 'countryName', + value: 'GitHub' + }, + { + shortName: 'ST', + value: 'GitHub' + }, + { + name: 'localityName', + value: 'GitHub' + }, + { + name: 'organizationName', + value: 'x22x22' + }, + { + shortName: 'OU', + value: 'https://github.com/x22x22' + } + ]; + cert.setSubject(attrs); + cert.setIssuer(attrs); + cert.setExtensions([ + { + name: 'basicConstraints', + critical: true, + cA: true + }, + { + name: 'keyUsage', + critical: true, + keyCertSign: true + }, + { + name: 'subjectKeyIdentifier' + } + ]); + + // self-sign certificate + cert.sign(keypair.privateKey, forge.md.sha256.create()); +} From 1d7a6e1f41f4790ee5165c9b23835601cb189e25 Mon Sep 17 00:00:00 2001 From: Pkthunder Date: Wed, 31 Jan 2018 15:32:52 -0500 Subject: [PATCH 11/65] Update index.d.ts (#23301) see paper.js docs: http://paperjs.org/reference/project/#addlayer-layer http://paperjs.org/reference/project/#insertlayer-index-item --- types/paper/index.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 5bd4315bfd..3f57526a19 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -3237,6 +3237,16 @@ declare module paper { * Deselects all selected items in the project. */ deselectAll(): void; + + /** + * Adds the specified layer at the end of the this project’s layers list. + */ + addLayer(layer: Layer): Layer; + + /** + * Inserts the specified layer at the specified index in this project’s layers list. + */ + insertLayer(index: number, layer: Layer): Layer; /** * Perform a hit-test on the items contained within the project at the location of the specified point. From 99614fa92018ee6023c6dbc6b8ceebff19be5626 Mon Sep 17 00:00:00 2001 From: Gustavo Henke Date: Thu, 1 Feb 2018 07:33:34 +1100 Subject: [PATCH 12/65] @storybook/addon-knobs: add button() knob (#23302) --- types/storybook__addon-knobs/index.d.ts | 2 ++ types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx | 3 +++ 2 files changed, 5 insertions(+) diff --git a/types/storybook__addon-knobs/index.d.ts b/types/storybook__addon-knobs/index.d.ts index c2f8c954ec..f725abb47c 100644 --- a/types/storybook__addon-knobs/index.d.ts +++ b/types/storybook__addon-knobs/index.d.ts @@ -46,6 +46,8 @@ export function date(name: string, value?: Date): Date; export function array(name: string, value: T[], separator?: string): T[]; +export function button(name: string, handler: () => any): void; + export interface WrapStoryProps { context?: object; storyFn?: RenderFunction; diff --git a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx index 9e1c1dbd6b..18d8d0a29e 100644 --- a/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx +++ b/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx @@ -11,6 +11,7 @@ import { select, date, array, + button, knob, } from '@storybook/addon-knobs'; @@ -58,6 +59,8 @@ stories.add('with all knobs', () => { const genericKnob: X = knob('Some generic knob', { value: 'a', type: 'text' }); + button('Some button', () => console.log('Button knob clicked')); + const style = { ...customStyle, fontWeight: bold ? 800 as 800 : 400 as 400, // tslint:disable-line no-unnecessary-type-assertion From 0db2724abb05212b385634fd3d4fdbe0ba4b0cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Fria=C3=A7a?= Date: Wed, 31 Jan 2018 17:35:04 -0300 Subject: [PATCH 13/65] Adding missing type on jquery-mask-plugin (#23304) --- types/jquery-mask-plugin/index.d.ts | 5 ++++- types/jquery-mask-plugin/jquery-mask-plugin-tests.ts | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/jquery-mask-plugin/index.d.ts b/types/jquery-mask-plugin/index.d.ts index a142d0a97e..342045a204 100644 --- a/types/jquery-mask-plugin/index.d.ts +++ b/types/jquery-mask-plugin/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for jQuery Mask Plugin 1.14 // Project: https://igorescobar.github.io/jQuery-Mask-Plugin/ -// Definitions by: Anže Videnič , Igor Escobar +// Definitions by: Anže Videnič +// Igor Escobar +// Anderson Friaça // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -25,6 +27,7 @@ declare namespace jQueryMask { selectOnFocus?: boolean; reverse?: boolean; clearIfNotMatch?: boolean; + placeholder?: string; onComplete?(value: string, e: Event, $element: JQuery, options: Options): void; onKeyPress?(value: string, e: Event, $element: JQuery, options: Options): void; onChange?(value: string, e: Event, $element: JQuery, options: Options): void; diff --git a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts index 310cec421b..90ac9f7a00 100644 --- a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts +++ b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts @@ -27,6 +27,9 @@ $(document).ready(() => { placeholder: "__/__/____" } }); + $('.placeholder2').mask("00/00/0000", { + placeholder: "__/__/____" + }); $('.fallback').mask("00r00r0000", { translation: { r: { From 962a9ec91974abd33080fd04f89ce860039cc2fe Mon Sep 17 00:00:00 2001 From: Oliver Joseph Ash Date: Wed, 31 Jan 2018 20:35:27 +0000 Subject: [PATCH 14/65] Lodash: `zip`: add undefined to return values (#23305) * Lodash: `zip`: add undefined to return values * Lodash: `zip`: correct generic typo * Lodash: `zip`: add undefined to return values for other overloads * Lodash: `zip`: use `` for tests --- types/lodash/array/zip.d.ts | 32 ++++++++++---------- types/lodash/lodash-tests.ts | 57 +++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/types/lodash/array/zip.d.ts b/types/lodash/array/zip.d.ts index cc8fa0be88..e6051f64a7 100644 --- a/types/lodash/array/zip.d.ts +++ b/types/lodash/array/zip.d.ts @@ -8,27 +8,27 @@ declare module "../index" { * @param arrays The arrays to process. * @return Returns the new array of grouped elements. */ - zip(arrays1: List, arrays2: List): Array<[T1, T2]>; + zip(arrays1: List, arrays2: List): Array<[T1 | undefined, T2 | undefined]>; /** * @see _.zip */ - zip(arrays1: List, arrays2: List, arrays3: List): Array<[T1, T2, T3]>; + zip(arrays1: List, arrays2: List, arrays3: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>; /** * @see _.zip */ - zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List): Array<[T1, T2, T3, T4]>; + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>; /** * @see _.zip */ - zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List, arrays5: List): Array<[T1, T2, T3, T4, T5]>; + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List, arrays5: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>; /** * @see _.zip */ - zip(...arrays: Array | null | undefined>): T[][]; + zip(...arrays: Array | null | undefined>): (T | undefined)[][]; } interface LoDashImplicitWrapper { @@ -38,7 +38,7 @@ declare module "../index" { zip( this: LoDashImplicitWrapper>, arrays2: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -47,7 +47,7 @@ declare module "../index" { this: LoDashImplicitWrapper>, arrays2: List, arrays3: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -57,7 +57,7 @@ declare module "../index" { arrays2: List, arrays3: List, arrays4: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -68,7 +68,7 @@ declare module "../index" { arrays3: List, arrays4: List, arrays5: List, - ): LoDashImplicitWrapper>; + ): LoDashImplicitWrapper>; /** * @see _.zip @@ -76,7 +76,7 @@ declare module "../index" { zip( this: LoDashImplicitWrapper | null | undefined>, ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; + ): LoDashImplicitWrapper>>; } interface LoDashExplicitWrapper { @@ -86,7 +86,7 @@ declare module "../index" { zip( this: LoDashExplicitWrapper>, arrays2: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -95,7 +95,7 @@ declare module "../index" { this: LoDashExplicitWrapper>, arrays2: List, arrays3: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -105,7 +105,7 @@ declare module "../index" { arrays2: List, arrays3: List, arrays4: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -116,7 +116,7 @@ declare module "../index" { arrays3: List, arrays4: List, arrays5: List, - ): LoDashExplicitWrapper>; + ): LoDashExplicitWrapper>; /** * @see _.zip @@ -124,6 +124,6 @@ declare module "../index" { zip( this: LoDashExplicitWrapper | null | undefined>, ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; + ): LoDashExplicitWrapper>>; } -} \ No newline at end of file +} diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 9baaa64815..e0c02f2b2d 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -3197,43 +3197,52 @@ namespace TestXor { let list: _.List | null | undefined = [] as any; { - let result: TResult[][]; + // $ExpectType (TResult | undefined)[][] + _.zip(array); + // $ExpectType (TResult | undefined)[][] + _.zip(array, list); + // $ExpectType (TResult | undefined)[][] + _.zip(array, list, array); - result = _.zip(array); - result = _.zip(array, list); - result = _.zip(array, list, array); + // $ExpectType (TResult | undefined)[][] + _.zip(list); + // $ExpectType (TResult | undefined)[][] + _.zip(list, array); + // $ExpectType (TResult | undefined)[][] + _.zip(list, array, list); - result = _.zip(list); - result = _.zip(list, array); - result = _.zip(list, array, list); - - result = _.zip(list, array, list, array, list, array); + // $ExpectType (TResult | undefined)[][] + _.zip(list, array, list, array, list, array); } { - let result: _.LoDashImplicitArrayWrapper; + // $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]> + _(array).zip(list); + // $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]> + _(array).zip(list, array); - result = _(array).zip(list); - result = _(array).zip(list, array); - - result = _(list).zip(array); - result = _(list).zip(array, list); + // $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]> + _(list).zip(array); + // $ExpectType LoDashImplicitWrapper<(TResult | undefined)[][]> + _(list).zip(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + // $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]> + _(array).chain().zip(list); + // $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]> + _(array).chain().zip(list, array); - result = _(array).chain().zip(list); - result = _(array).chain().zip(list, array); - - result = _(list).chain().zip(array); - result = _(list).chain().zip(array, list); + // $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]> + _(list).chain().zip(array); + // $ExpectType LoDashExplicitWrapper<(TResult | undefined)[][]> + _(list).chain().zip(array, list); } { - _.zip([1, 2], [3, 4]); // $ExpectType [number, number][] - _.zip([1, 2], ["a", "b"]); // $ExpectType [number, string][] - _.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number, string, boolean][] + _.zip([1, 2], [3, 4]); // $ExpectType [number | undefined, number | undefined][] + _.zip([1, 2], ["a", "b"]); // $ExpectType [number | undefined, string | undefined][] + _.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number | undefined, string | undefined, boolean | undefined][] } } From 0b755d302fd60e6e686a71091af468222a190364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Fria=C3=A7a?= Date: Wed, 31 Jan 2018 17:38:12 -0300 Subject: [PATCH 15/65] Types for bootstrap-growl-ifightcrime (#23308) * Types for bootstrap-growl-ifightcrime * necessary adjustments * Adding types for values --- .../bootstrap-growl-ifightcrime-tests.ts | 25 ++++++ types/bootstrap-growl-ifightcrime/index.d.ts | 78 +++++++++++++++++++ .../bootstrap-growl-ifightcrime/tsconfig.json | 24 ++++++ types/bootstrap-growl-ifightcrime/tslint.json | 1 + 4 files changed, 128 insertions(+) create mode 100644 types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts create mode 100644 types/bootstrap-growl-ifightcrime/index.d.ts create mode 100644 types/bootstrap-growl-ifightcrime/tsconfig.json create mode 100644 types/bootstrap-growl-ifightcrime/tslint.json diff --git a/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts new file mode 100644 index 0000000000..78f92fcf71 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts @@ -0,0 +1,25 @@ +// basic usage +$(document).ready(() => { + $.bootstrapGrowl('Message to show in alert'); +}); + +// with options example +let offsetOptions: BootstrapGrowlIfightcrime.OffsetOption = { + from: 'top', + amount: 20 +}; + +let options: BootstrapGrowlIfightcrime.Options = { + ele: 'body', + type: 'info', + offset: offsetOptions, + align: 'right', + width: 250, + delay: 4000, + allow_dismiss: true, + stackup_spacing: 10 +}; + +$(document).ready(() => { + $.bootstrapGrowl('Alert with options', options); +}); diff --git a/types/bootstrap-growl-ifightcrime/index.d.ts b/types/bootstrap-growl-ifightcrime/index.d.ts new file mode 100644 index 0000000000..45755682ea --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for Bootstrap Growl Ifightcrime 1.1 +// Project: https://github.com/ifightcrime/bootstrap-growl +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace BootstrapGrowlIfightcrime { + type OffsetPositionType = 'top' | 'bottom'; + + type AlertType = 'info' | 'danger' | 'success' | 'warning' | string | null; + + type AlignType = 'left' | 'center' | 'right'; + + interface OffsetOption { + /** + * Position: top or bottom + */ + from?: OffsetPositionType; + + /** + * Offset amount + */ + amount?: number; + } + + interface Options { + /** + * Which element to append to + */ + ele?: string; + + /** + * Values of (null, 'info', 'danger', 'success', 'warning') or another value + */ + type?: AlertType; + + /** + * Offset Options + */ + offset?: OffsetOption; + + /** + * 'left', 'right', or 'center' + */ + align?: AlignType; + + /** + * Integer + */ + width?: number; + + /** + * Time while the message will be displayed. It's not equivalent to the *demo* timeOut! + */ + delay?: number; + + /** + * If true then will display a cross to close the popup. + */ + allow_dismiss?: boolean; + + /** + * Spacing between consecutively stacked growls. + */ + stackup_spacing?: number; + } +} +interface JQueryStatic { + /** + * Show standard Bootstrap alerts into hovering "Growl-like" notifications + * @param message to show. + * @param options should be an options object. + * @returns The element. + */ + bootstrapGrowl: (message: string, options?: BootstrapGrowlIfightcrime.Options) => JQuery; +} diff --git a/types/bootstrap-growl-ifightcrime/tsconfig.json b/types/bootstrap-growl-ifightcrime/tsconfig.json new file mode 100644 index 0000000000..dbeadea241 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bootstrap-growl-ifightcrime-tests.ts" + ] +} \ No newline at end of file diff --git a/types/bootstrap-growl-ifightcrime/tslint.json b/types/bootstrap-growl-ifightcrime/tslint.json new file mode 100644 index 0000000000..4e88071852 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} From 00aad235f1d0582b28af599062cc9d6f0a3031a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Kov=C3=A1cs?= Date: Wed, 31 Jan 2018 21:40:26 +0100 Subject: [PATCH 16/65] Add types for jquery-awesome-cursor (#23311) --- types/jquery-awesome-cursor/index.d.ts | 34 ++++++++++ .../jquery-awesome-cursor-tests.ts | 64 +++++++++++++++++++ types/jquery-awesome-cursor/tsconfig.json | 23 +++++++ types/jquery-awesome-cursor/tslint.json | 1 + 4 files changed, 122 insertions(+) create mode 100644 types/jquery-awesome-cursor/index.d.ts create mode 100644 types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts create mode 100644 types/jquery-awesome-cursor/tsconfig.json create mode 100644 types/jquery-awesome-cursor/tslint.json diff --git a/types/jquery-awesome-cursor/index.d.ts b/types/jquery-awesome-cursor/index.d.ts new file mode 100644 index 0000000000..1137b16b75 --- /dev/null +++ b/types/jquery-awesome-cursor/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for jquery-awesome-cursor 0.3 +// Project: https://jwarby.github.io/jquery-awesome-cursor +// Definitions by: Zsolt Kovács +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +declare namespace JQueryAwesomeCursor { + type flip = "horizontal" | "vertical" | "both"; + type cssHandler = (name: string) => void; + + interface Options { + color?: string; + size?: number; + hotspot?: number[] | string; + flip?: flip; + rotate?: number; + outline?: string; + font?: Font; + } + + interface Font { + family: string; + cssClass: string | cssHandler; + } +} + +interface JQueryStatic { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} + +interface JQuery { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} diff --git a/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts new file mode 100644 index 0000000000..cd47f56ff9 --- /dev/null +++ b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts @@ -0,0 +1,64 @@ +// Default +jQuery.awesomeCursor('pencil'); + +// Color +jQuery.awesomeCursor('pencil', { + color: '#ff0000' +}); + +// Size +jQuery.awesomeCursor('pencil', { + size: 32 +}); + +// Hotspot +jQuery.awesomeCursor('pencil', { + hotspot: [0, 17] +}); +jQuery.awesomeCursor('pencil', { + hotspot: 'bottom left' +}); + +// Flip +jQuery.awesomeCursor('pencil', { + flip: 'horizontal' +}); +jQuery.awesomeCursor('pencil', { + flip: 'vertical' +}); +jQuery.awesomeCursor('pencil', { + flip: 'both' +}); + +// Rotate +jQuery.awesomeCursor('pencil', { + rotate: 45 +}); + +// Outline +jQuery.awesomeCursor('pencil', { + outline: 'red' +}); + +// Different font +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: 'typcn typcn-%s' + } +}); +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: (name) => { + return 'typcn typcn-' + name; + } + } +}); + +// Mixed +jQuery.awesomeCursor('long-arrow-left', { + color: 'red', + hotspot: 'top left', + rotate: 45, +}); diff --git a/types/jquery-awesome-cursor/tsconfig.json b/types/jquery-awesome-cursor/tsconfig.json new file mode 100644 index 0000000000..cb81088d83 --- /dev/null +++ b/types/jquery-awesome-cursor/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", + "jquery-awesome-cursor-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-awesome-cursor/tslint.json b/types/jquery-awesome-cursor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-awesome-cursor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 0efc1b6933ce9e8b0ea09059a966ca715d7b1ad6 Mon Sep 17 00:00:00 2001 From: Wenchen Li Date: Wed, 31 Jan 2018 15:42:11 -0500 Subject: [PATCH 17/65] Make videoId optional in PlayerOptions (#23315) It could be optional based on the "Example 1: Use API with existing