diff --git a/.gitignore b/.gitignore index c8e25cec8d..ac63b6f6b5 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ npm-debug.log # yarn yarn.lock + +# pnpm +shrinkwrap.yaml diff --git a/types/bleno/bleno-tests.ts b/types/bleno/bleno-tests.ts index 7ea037587c..2251baed19 100644 --- a/types/bleno/bleno-tests.ts +++ b/types/bleno/bleno-tests.ts @@ -1,7 +1,4 @@ import * as Bleno from 'bleno'; -// can also import these types as if they were exported from the module -// tslint:disable-next-line:no-duplicate-imports -import { Characteristic, Descriptor, PrimaryService } from 'bleno'; export class EchoCharacteristic extends Bleno.Characteristic { _value: any; @@ -62,13 +59,13 @@ const SERVICE_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3863'; const CONTROL_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3864'; const STATUS_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3866'; -class StatusCharacteristic extends Characteristic { +class StatusCharacteristic extends Bleno.Characteristic { constructor() { super({ uuid: 'STATUS_CHAR_UUID', properties: ['read'], descriptors: [ - new Descriptor({ + new Bleno.Descriptor({ uuid: '2901', value: Buffer.from('Status'), }), @@ -82,14 +79,14 @@ class StatusCharacteristic extends Characteristic { ) { try { const data = Buffer.from('status ok'); - callback(Characteristic.RESULT_SUCCESS, data.slice(offset)); + callback(Bleno.Characteristic.RESULT_SUCCESS, data.slice(offset)); } catch (error) { - callback(Characteristic.RESULT_UNLIKELY_ERROR); + callback(Bleno.Characteristic.RESULT_UNLIKELY_ERROR); } } } -class ControlCharacteristic extends Characteristic { +class ControlCharacteristic extends Bleno.Characteristic { private readonly callback: (data: Buffer) => void; constructor(onWriteRequestCb: (data: Buffer) => void) { @@ -97,7 +94,7 @@ class ControlCharacteristic extends Characteristic { uuid: CONTROL_CHAR_UUID, properties: ['write'], descriptors: [ - new Descriptor({ + new Bleno.Descriptor({ uuid: '2901', value: Buffer.from('test characteristic'), }), @@ -174,7 +171,7 @@ export class BluetoothController { if (!error) { this.isAdvertising = true; Bleno.setServices([ - new PrimaryService({ + new Bleno.PrimaryService({ uuid: SERVICE_UUID, characteristics: [ new ControlCharacteristic((data) => { @@ -206,8 +203,7 @@ export class BluetoothController { // code from bleno's README // -// tslint:disable-next-line:no-duplicate-imports -import * as bleno from 'bleno'; +const bleno = Bleno; function test1() { const name = 'name'; @@ -243,7 +239,7 @@ function test4() { } function test5() { - const service = new PrimaryService({uuid: '0000'}); + const service = new bleno.PrimaryService({uuid: '0000'}); const services = [ service ]; @@ -282,7 +278,7 @@ function test9() { value: null, // optional static value, must be of type Buffer - for read only characteristics descriptors: [ // see Descriptor for data type - new Descriptor({uuid: '0000'}) + new bleno.Descriptor({uuid: '0000'}) ], onReadRequest: null, // optional read request handler, function(offset, callback) { ... } onWriteRequest: null, // optional write request handler, function(data, offset, withoutResponse, callback) { ...} @@ -294,10 +290,10 @@ function test9() { } function test10() { - Characteristic.RESULT_SUCCESS; - Characteristic.RESULT_INVALID_OFFSET; - Characteristic.RESULT_INVALID_ATTRIBUTE_LENGTH; - Characteristic.RESULT_UNLIKELY_ERROR; + bleno.Characteristic.RESULT_SUCCESS; + bleno.Characteristic.RESULT_INVALID_OFFSET; + bleno.Characteristic.RESULT_INVALID_ATTRIBUTE_LENGTH; + bleno.Characteristic.RESULT_UNLIKELY_ERROR; } function test11() { diff --git a/types/dropzone/dropzone-tests.ts b/types/dropzone/dropzone-tests.ts index 1caed5f4e2..ea7482c9c4 100644 --- a/types/dropzone/dropzone-tests.ts +++ b/types/dropzone/dropzone-tests.ts @@ -63,6 +63,7 @@ const dropzoneWithOptions = new Dropzone(".test", { dictRemoveFileConfirmation: "", dictMaxFilesExceeded: "", dictFileSizeUnits: { tb: "", gb: "", mb: "", kb: "", b: "" }, + dictUploadCanceled: "", accept: (file: Dropzone.DropzoneFile, done: (error?: string | Error) => void) => { if (file.accepted) { @@ -245,6 +246,8 @@ dropzone.resizeImage(firstFile, 120, 120); dropzone.resizeImage(firstFile, 120, 120, 'contain'); dropzone.resizeImage(firstFile, 120, 120, 'contain', function () { }); +document.createElement("div").dropzone; + dropzone .on("drop", () => { console.count('drop'); diff --git a/types/dropzone/index.d.ts b/types/dropzone/index.d.ts index 93f95d2a65..7360999f85 100644 --- a/types/dropzone/index.d.ts +++ b/types/dropzone/index.d.ts @@ -1,6 +1,12 @@ // Type definitions for Dropzone 5.0.0 // Project: http://www.dropzonejs.com/ -// Definitions by: Natan Vivo , Andy Hawkins , Vasya Aksyonov , Simon Huber , Sebastiaan de Rooij , Ted Bicknell +// Definitions by: Natan Vivo +// Andy Hawkins +// Vasya Aksyonov +// Simon Huber +// Sebastiaan de Rooij +// Ted Bicknell +// Daniel Waxweiler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -87,6 +93,7 @@ declare namespace Dropzone { dictRemoveFileConfirmation?: string; dictMaxFilesExceeded?: string; dictFileSizeUnits?: DropzoneDictFileSizeUnits; + dictUploadCanceled?: string; accept?(file: DropzoneFile, done: (error?: string | Error) => void): void; chunksUploaded?(file: DropzoneFile, done: (error?: string | Error) => void): void; @@ -306,8 +313,14 @@ declare class Dropzone { } -interface JQuery { - dropzone(options: Dropzone.DropzoneOptions): Dropzone; +declare global { + interface JQuery { + dropzone(options: Dropzone.DropzoneOptions): Dropzone; + } + + interface HTMLElement { + dropzone: Dropzone; + } } export = Dropzone; diff --git a/types/handlebars/index.d.ts b/types/handlebars/index.d.ts index 351d98fb10..480f91f6f0 100644 --- a/types/handlebars/index.d.ts +++ b/types/handlebars/index.d.ts @@ -338,6 +338,6 @@ declare module "handlebars" { export = Handlebars; } -declare module "handlebars/handlebars.runtime" { +declare module "handlebars/runtime" { export = Handlebars; } diff --git a/types/storybook__addon-links/index.d.ts b/types/storybook__addon-links/index.d.ts index 72ec6aa296..99a9edc492 100644 --- a/types/storybook__addon-links/index.d.ts +++ b/types/storybook__addon-links/index.d.ts @@ -9,6 +9,9 @@ import * as React from 'react'; export type LinkToFunction = (...args: any[]) => string; -export function linkTo(book: string | LinkToFunction, kind?: string | LinkToFunction): React.MouseEventHandler; +export function linkTo( + book: string | LinkToFunction, + kind?: string | LinkToFunction +): () => void; export function hrefTo(kind: string, story: string): Promise;