mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -49,3 +49,6 @@ npm-debug.log
|
||||
|
||||
# yarn
|
||||
yarn.lock
|
||||
|
||||
# pnpm
|
||||
shrinkwrap.yaml
|
||||
|
||||
+14
-18
@@ -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() {
|
||||
|
||||
@@ -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');
|
||||
|
||||
Vendored
+16
-3
@@ -1,6 +1,12 @@
|
||||
// Type definitions for Dropzone 5.0.0
|
||||
// Project: http://www.dropzonejs.com/
|
||||
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>, Simon Huber <https://github.com/renuo>, Sebastiaan de Rooij <https://github.com/Hikariii>, Ted Bicknell <https://github.com/tedbcsgpro>
|
||||
// Definitions by: Natan Vivo <https://github.com/nvivo>
|
||||
// Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>
|
||||
// Vasya Aksyonov <https://github.com/outring>
|
||||
// Simon Huber <https://github.com/renuo>
|
||||
// Sebastiaan de Rooij <https://github.com/Hikariii>
|
||||
// Ted Bicknell <https://github.com/tedbcsgpro>
|
||||
// Daniel Waxweiler <https://github.com/dwaxweiler>
|
||||
// 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;
|
||||
|
||||
Vendored
+1
-1
@@ -338,6 +338,6 @@ declare module "handlebars" {
|
||||
export = Handlebars;
|
||||
}
|
||||
|
||||
declare module "handlebars/handlebars.runtime" {
|
||||
declare module "handlebars/runtime" {
|
||||
export = Handlebars;
|
||||
}
|
||||
|
||||
+4
-1
@@ -9,6 +9,9 @@ import * as React from 'react';
|
||||
|
||||
export type LinkToFunction = (...args: any[]) => string;
|
||||
|
||||
export function linkTo<T>(book: string | LinkToFunction, kind?: string | LinkToFunction): React.MouseEventHandler<T>;
|
||||
export function linkTo<T>(
|
||||
book: string | LinkToFunction,
|
||||
kind?: string | LinkToFunction
|
||||
): () => void;
|
||||
|
||||
export function hrefTo(kind: string, story: string): Promise<string>;
|
||||
|
||||
Reference in New Issue
Block a user