mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped
This commit is contained in:
+1
-1
@@ -5,5 +5,5 @@ indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{*.json,*.yml,*.ts}]
|
||||
[{*.json,*.yml,*.ts,*.tsx,*.md}]
|
||||
indent_style = space
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
# DefinitelyTyped [](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped)
|
||||
|
||||
[](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
# DefinitelyTyped
|
||||
|
||||
> The repository for *high quality* TypeScript type definitions.
|
||||
|
||||
@@ -8,6 +6,19 @@ Also see the [definitelytyped.org](http://definitelytyped.org) website, although
|
||||
|
||||
*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md), [Korean](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md), and [Russian](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ru.md)!*
|
||||
|
||||
## Current status
|
||||
|
||||
This section tracks the health of the repository and publishing process.
|
||||
It may be helpful for contributors experiencing any issues with their PRs and packages.
|
||||
|
||||
* All packages are type-checking/linting cleanly: [](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped)
|
||||
* All packages are being published to npm in under 10,000 seconds: [](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13)
|
||||
* [typescript-bot](https://github.com/typescript-bot) has been active on DefinitelyTyped [](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14)
|
||||
|
||||
If anything here seems wrong, or any of the above are failing, please raise an issue in [the DefinitelyTyped Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped).
|
||||
|
||||
[](https://gitter.im/DefinitelyTyped/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
## What are declaration files?
|
||||
|
||||
See the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html).
|
||||
@@ -342,6 +353,3 @@ This project is licensed under the MIT license.
|
||||
Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file.
|
||||
|
||||
[](https://github.com/igrigorik/ga-beacon)
|
||||
|
||||
[](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) Are packages being published to npm in less than 10,000 seconds on average?
|
||||
[](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) Has typescript-bot been active on DefinitelyTyped in the last two hours?
|
||||
|
||||
+5
-5
@@ -8,7 +8,7 @@
|
||||
|
||||
Также посетите веб-сайт [definitelytyped.org](http://definitelytyped.org), хотя информация в этом README более свежая.
|
||||
|
||||
*Вы также можете прочитать этот README на [английском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md), [испанском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [корейском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md).*
|
||||
*Вы также можете прочитать этот README на [английском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md), [испанском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) и [корейском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md).*
|
||||
|
||||
## Что такое файлы декларации (файлы описания/объявления типов)?
|
||||
|
||||
@@ -101,9 +101,9 @@ DefinitelyTyped работает только благодаря вкладу т
|
||||
// John <https://github.com/john>
|
||||
```
|
||||
|
||||
* Если есть `tslint.json`, запустите `npm run lint package-name`. В противном случае запустите `tsc` in в директории пакета.
|
||||
* Если есть `tslint.json`, запустите `npm run lint package-name`. В противном случае запустите `tsc` в директории пакета.
|
||||
|
||||
Когда вы создаете PR для редактирования существующего пакета, `dt-bot` должен @-уведомить previous authors.
|
||||
Когда вы создаете PR для редактирования существующего пакета, `dt-bot` должен @-уведомить
|
||||
предыдущих авторов. Если этого не произойдет, вы можете сделать это самостоятельно в комментарии, связанном с PR.
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ DefinitelyTyped работает только благодаря вкладу т
|
||||
| tsconfig.json | Позволяет вам запускать `tsc` внутри пакета. |
|
||||
| tslint.json | Включает linting. |
|
||||
|
||||
Создайте их, запустив `npx dts-gen --dt --name my-package-name --template module` если у вас ≥ 5.2.0, `npm install -g dts-gen` и `dts-gen --dt --name my-package-name --template module` в противном случае.
|
||||
Создайте их, запустив `npx dts-gen --dt --name my-package-name --template module` если у вас npm ≥ 5.2.0, `npm install -g dts-gen` и `dts-gen --dt --name my-package-name --template module` в противном случае.
|
||||
Посмотреть все варианты на [dts-gen](https://github.com/Microsoft/dts-gen).
|
||||
|
||||
Вы можете отредактировать `tsconfig.json` чтобы добавить новые файлы, добавить `"target": "es6"` (необходимо для асинхронных функций), добавить в `"lib"`, или добавить опцию компилятора `"jsx"`.
|
||||
@@ -283,7 +283,7 @@ f("one");
|
||||
"typeRoots": ["../../"],
|
||||
"paths": {
|
||||
"history": [ "history/v2" ]
|
||||
},
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import * as ActiveStorage from 'activestorage';
|
||||
|
||||
ActiveStorage.start();
|
||||
|
||||
const delegate: ActiveStorage.DirectUploadDelegate = {
|
||||
directUploadWillCreateBlobWithXHR(xhr) {
|
||||
console.log(xhr.status);
|
||||
},
|
||||
|
||||
directUploadWillStoreFileWithXHR(xhr) {
|
||||
console.log(xhr.status);
|
||||
},
|
||||
};
|
||||
|
||||
const d = new ActiveStorage.DirectUpload(
|
||||
new File([], 'blank.txt'),
|
||||
'/rails/active_storage/direct_uploads',
|
||||
delegate
|
||||
);
|
||||
|
||||
d.create((error, blob) => {
|
||||
if (error) {
|
||||
console.log(error.message);
|
||||
} else {
|
||||
const { byte_size, checksum, content_type, filename, signed_id } = blob;
|
||||
console.log({ byte_size, checksum, content_type, filename, signed_id });
|
||||
}
|
||||
});
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// Type definitions for ActiveStorage 5.2
|
||||
// Project: https://github.com/rails/rails/tree/master/activestorage/app/javascipt
|
||||
// Definitions by: Cameron Bothner <https://github.com/cbothner>
|
||||
// Definitions: https://github.com/cbothner/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export as namespace ActiveStorage
|
||||
|
||||
export function start(): void;
|
||||
|
||||
export class DirectUpload {
|
||||
id: number;
|
||||
file: File;
|
||||
url: string;
|
||||
|
||||
constructor(file: File, url: string, delegate: DirectUploadDelegate)
|
||||
|
||||
create(callback: (error: Error, blob: Blob) => void): void;
|
||||
}
|
||||
|
||||
export interface DirectUploadDelegate {
|
||||
directUploadWillCreateBlobWithXHR?: (xhr: XMLHttpRequest) => void;
|
||||
|
||||
directUploadWillStoreFileWithXHR?: (xhr: XMLHttpRequest) => void;
|
||||
}
|
||||
|
||||
export interface Blob {
|
||||
byte_size: number;
|
||||
checksum: string;
|
||||
content_type: string;
|
||||
filename: string;
|
||||
signed_id: string;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"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", "activestorage-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,8 @@
|
||||
import arrayMove = require('array-move');
|
||||
|
||||
const input = ['a', 'b', 'c'];
|
||||
const input2 = [1, 2, 3];
|
||||
|
||||
arrayMove(input, 1, 2); // $ExpectType string[]
|
||||
arrayMove(input2, 1, 2); // $ExpectType number[]
|
||||
arrayMove.mut(input, 1, 2); // $ExpectType void
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// Type definitions for array-move 1.0
|
||||
// Project: https://github.com/sindresorhus/array-move
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = arrayMove;
|
||||
|
||||
/**
|
||||
* Move an array item to a different position.
|
||||
*
|
||||
* @param from Index of item to move. If negative, it will begin that many elements from the end.
|
||||
* @param to Index of where to move the item. If negative, it will begin that many elements from the end.
|
||||
* @returns A new array with the item moved to the new position.
|
||||
*/
|
||||
declare function arrayMove<T extends any[]>(input: T, from: number, to: number): T;
|
||||
|
||||
declare namespace arrayMove {
|
||||
/**
|
||||
* Moves the item to the new position in the input array.
|
||||
*
|
||||
* Useful for huge arrays where absolute performance is needed.
|
||||
*
|
||||
* @param from Index of item to move. If negative, it will begin that many elements from the end.
|
||||
* @param to Index of where to move the item. If negative, it will begin that many elements from the end.
|
||||
*/
|
||||
function mut(input: any[], from: number, to: number): void;
|
||||
}
|
||||
@@ -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",
|
||||
"array-move-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -130,7 +130,8 @@ const otherOptions : Auth0LockConstructorOptions = {
|
||||
hashCleanup: false,
|
||||
leeway: 30,
|
||||
_enableImpersonation: true,
|
||||
_enableIdPInitiatedLogin: false
|
||||
_enableIdPInitiatedLogin: false,
|
||||
defaultADUsernameFromEmailPrefix: false
|
||||
};
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, otherOptions);
|
||||
|
||||
Vendored
+1
-1
@@ -130,7 +130,7 @@ interface Auth0LockConstructorOptions {
|
||||
closable?: boolean;
|
||||
configurationBaseUrl?: string;
|
||||
container?: string;
|
||||
defaultADUsernameFromEmailPrefix?: string;
|
||||
defaultADUsernameFromEmailPrefix?: boolean;
|
||||
defaultDatabaseConnection?: string;
|
||||
defaultEnterpriseConnection?: string;
|
||||
flashMessage?: Auth0LockFlashMessageOptions;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import beeper = require('beeper');
|
||||
|
||||
beeper();
|
||||
beeper(3);
|
||||
beeper(3, () => {});
|
||||
beeper('****-*-*');
|
||||
beeper('****-*-*', () => {});
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for beeper 1.1
|
||||
// Project: https://github.com/sindresorhus/beeper#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = beeper;
|
||||
|
||||
declare function beeper(count?: number, cb?: () => void): void;
|
||||
declare function beeper(melody: string, cb?: () => void): void;
|
||||
@@ -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",
|
||||
"beeper-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -8,3 +8,11 @@ bn.byteLength;
|
||||
|
||||
bn.toArrayLike(Buffer, 'le', 2);
|
||||
const test = new BN(1, 'le');
|
||||
|
||||
const ctx = BN.red('p224');
|
||||
ctx.prime.name;
|
||||
|
||||
const red = bn.toRed(ctx);
|
||||
const newRed = red.redAdd(new BN(1));
|
||||
newRed.cmp(bn);
|
||||
newRed.fromRed();
|
||||
|
||||
Vendored
+88
-31
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/indutny/bn.js
|
||||
// Definitions by: Leonid Logvinov <https://github.com/LogvinovLeon>
|
||||
// Henry Nguyen <https://github.com/HenryNguyen5>
|
||||
// Gaylor Bosson <https://github.com/Gilthoniel>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
@@ -9,36 +10,16 @@
|
||||
type Endianness = 'le' | 'be';
|
||||
type IPrimeName = 'k256' | 'p224' | 'p192' | 'p25519';
|
||||
|
||||
declare class RedBN {
|
||||
redAdd(b: RedBN): RedBN;
|
||||
redIAdd(b: RedBN): RedBN;
|
||||
redSub(b: RedBN): RedBN;
|
||||
redISub(b: RedBN): RedBN;
|
||||
redShl(num: number): RedBN;
|
||||
redMul(b: RedBN): RedBN;
|
||||
redIMul(b: RedBN): RedBN;
|
||||
redSqr(): RedBN;
|
||||
redISqr(): RedBN;
|
||||
/**
|
||||
* @description square root modulo reduction context's prime
|
||||
*/
|
||||
redSqrt(): RedBN;
|
||||
/**
|
||||
* @description modular inverse of the number
|
||||
*/
|
||||
redInvm(): RedBN;
|
||||
redNeg(): RedBN;
|
||||
/**
|
||||
* @description modular exponentiation
|
||||
*/
|
||||
redPow(b: RedBN): RedBN;
|
||||
fromRed(): BN;
|
||||
interface MPrime {
|
||||
name: string;
|
||||
p: BN;
|
||||
n: number;
|
||||
k: BN;
|
||||
}
|
||||
|
||||
// FIXME: not sure how to specify the reduction context here
|
||||
interface ReductionContext {
|
||||
m: number;
|
||||
prime: any;
|
||||
prime: MPrime;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@@ -78,11 +59,6 @@ declare class BN {
|
||||
*/
|
||||
static min(left: BN, right: BN): BN;
|
||||
|
||||
/**
|
||||
* @description Convert number to red
|
||||
*/
|
||||
toRed(reductionContext: ReductionContext): RedBN;
|
||||
|
||||
/**
|
||||
* @description clone number
|
||||
*/
|
||||
@@ -522,6 +498,87 @@ declare class BN {
|
||||
* @description inverse `a` modulo `b`
|
||||
*/
|
||||
invm(b: BN): BN;
|
||||
|
||||
/**
|
||||
* @description Convert number to red
|
||||
*/
|
||||
toRed(reductionContext: ReductionContext): RedBN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Big-Number class with additionnal methods that are using modular
|
||||
* operation.
|
||||
*/
|
||||
declare class RedBN extends BN {
|
||||
/**
|
||||
* @description Convert back a number using a reduction context
|
||||
*/
|
||||
fromRed(): BN;
|
||||
|
||||
/**
|
||||
* @description modular addition
|
||||
*/
|
||||
redAdd(b: BN): RedBN;
|
||||
|
||||
/**
|
||||
* @description in-place modular addition
|
||||
*/
|
||||
redIAdd(b: BN): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular subtraction
|
||||
*/
|
||||
redSub(b: BN): RedBN;
|
||||
|
||||
/**
|
||||
* @description in-place modular subtraction
|
||||
*/
|
||||
redISub(b: BN): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular shift left
|
||||
*/
|
||||
redShl(num: number): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular multiplication
|
||||
*/
|
||||
redMul(b: BN): RedBN;
|
||||
|
||||
/**
|
||||
* @description in-place modular multiplication
|
||||
*/
|
||||
redIMul(b: BN): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular square
|
||||
*/
|
||||
redSqr(): RedBN;
|
||||
|
||||
/**
|
||||
* @description in-place modular square
|
||||
*/
|
||||
redISqr(): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular square root
|
||||
*/
|
||||
redSqrt(): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular inverse of the number
|
||||
*/
|
||||
redInvm(): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular negation
|
||||
*/
|
||||
redNeg(): RedBN;
|
||||
|
||||
/**
|
||||
* @description modular exponentiation
|
||||
*/
|
||||
redPow(b: BN): RedBN;
|
||||
}
|
||||
|
||||
export = BN;
|
||||
|
||||
@@ -61,59 +61,89 @@ var demoExtendedData : BLECentralPlugin.PeripheralDataExtended = {
|
||||
|
||||
//get updates about the bluethooth states
|
||||
ble.startStateNotifications((state) => log(`BLE state ${state}`));
|
||||
ble.startStateNotifications((state) => log(`BLE state ${state}`), (err: string) => log(`things when wrong ${err}`));
|
||||
|
||||
ble.isEnabled(()=> log(`bluetooth is enabled`), ()=>log(`bluetooth is not enabled`));
|
||||
ble.isEnabled(()=> log(`bluetooth is enabled`), err =>log(`bluetooth is not enabled: ${err}`));
|
||||
|
||||
//here we try to enable bluetooth
|
||||
ble.enable(() => log(`yes it worked, or it was already enabled `), () => log(`nope it didn't work, the user pressed cancel, or we are in iOS`));
|
||||
ble.enable(() => log(`yes it worked, or it was already enabled `), err => log(`nope it didn't work, the user pressed cancel, or we are in iOS: ${err}`));
|
||||
|
||||
ble.showBluetoothSettings(() => log(`yes it worked`), () => log(`nope it didn't work`))
|
||||
|
||||
//stop getting updates about the bluethooth states
|
||||
ble.stopStateNotifications()
|
||||
ble.stopStateNotifications(() => log(`yes it worked`))
|
||||
ble.stopStateNotifications(() => log(`yes it worked`), () => log(`nope it didn't work`))
|
||||
|
||||
//scan 5 seconds
|
||||
ble.scan([], 5000, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') );
|
||||
ble.scan([], 5000, (data) => { devices.push(data); });
|
||||
ble.scan([], 5000, (data) => { devices.push(data); }, () => log(`couldn't connect`) );
|
||||
ble.scan([], 5000, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) );
|
||||
|
||||
//scan continously
|
||||
ble.startScan([], (data) => { devices.push(data); }, ()=> log('couldn\'t connect') )
|
||||
ble.startScan([], (data) => { devices.push(data); })
|
||||
ble.startScan([], (data) => { devices.push(data); }, () => log('couldn\'t connect') )
|
||||
ble.startScan([], (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) );
|
||||
|
||||
////scan continously
|
||||
ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') )
|
||||
ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); });
|
||||
ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`));
|
||||
|
||||
//stop scanning
|
||||
ble.stopScan(()=> log('all good'), ()=> log('couldn\'t stop scanning'));
|
||||
|
||||
//are we conenected to that device?
|
||||
ble.isConnected(demoDevice.id, () => log(`already connected to this device`));
|
||||
ble.isConnected(demoDevice.id, () => log(`already connected to this device`), ()=> log(`not yet connected to that device`));
|
||||
|
||||
//connect to a specific device
|
||||
var extendedData : BLECentralPlugin.PeripheralDataExtended;
|
||||
ble.connect(demoDevice.id, (data)=> extendedData = data, () => log(`couldn't connect to the device`) );
|
||||
ble.connect(demoDevice.id, (data)=> extendedData = data, err => log(`couldn't connect to the device: ${err}`) );
|
||||
|
||||
//read some data from a characteristic
|
||||
var charsOfOneOfItsServices = demoExtendedData.characteristics.filter((value) => value.service == demoExtendedData.services[0]);
|
||||
ble.read(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic);
|
||||
ble.read(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data) => log(`we've received some data`), ()=> log(`couldn't read any data`));
|
||||
|
||||
//read the rssi
|
||||
ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`));
|
||||
ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`), err => log(`Unable to read RSSI: ${err}`));
|
||||
|
||||
|
||||
// request mtu
|
||||
ble.requestMtu(demoDevice.id, 10);
|
||||
ble.requestMtu(demoDevice.id, 10, () => log('it worked'));
|
||||
ble.requestMtu(demoDevice.id, 10, () => log('it worked'), () => log('it failed'));
|
||||
|
||||
// refreshDeviceCache
|
||||
ble.refreshDeviceCache(demoDevice.id, 10);
|
||||
ble.refreshDeviceCache(demoDevice.id, 10, () => log('it worked'));
|
||||
ble.refreshDeviceCache(demoDevice.id, 10, () => log('it worked'), () => log('it failed'));
|
||||
|
||||
var notificationsReceived : number = 0;
|
||||
//get notified of changes for that characteristic
|
||||
ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data)=> notificationsReceived++, ()=> log(`darn`));
|
||||
ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic,
|
||||
(data)=> notificationsReceived++);
|
||||
ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic,
|
||||
(data)=> notificationsReceived++, err => log(`darn: ${err}`));
|
||||
|
||||
//write some data
|
||||
ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40));
|
||||
ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`));
|
||||
ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`), ()=> log(`could't write`));
|
||||
//write some data without getting notified
|
||||
ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40));
|
||||
ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`));
|
||||
ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`), ()=> log(`could't write`));
|
||||
|
||||
//stop getting notified of changes.
|
||||
ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic);
|
||||
ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, () => log('it worked'));
|
||||
ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, () => log('it worked'), () => log('it failed'));
|
||||
|
||||
//notificationsReceived == 1
|
||||
|
||||
//just disconnect
|
||||
ble.disconnect(demoDevice.id);
|
||||
|
||||
|
||||
|
||||
ble.disconnect(demoDevice.id, () => log('it worked'));
|
||||
ble.disconnect(demoDevice.id, () => log('it worked'), () => log('it failed'));
|
||||
|
||||
+61
-50
@@ -1,12 +1,13 @@
|
||||
// Type definitions for cordova-plugin-ble-central 1.1.2
|
||||
// Type definitions for cordova-plugin-ble-central 1.2.2
|
||||
// Project: https://github.com/don/cordova-plugin-ble-central
|
||||
// Definitions by: Gidon Junge <https://github.com/gjunge>
|
||||
// Philip Peitsch <https://github.com/peitschie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare namespace BLECentralPlugin {
|
||||
|
||||
interface PeripheralCharacteristic {
|
||||
interface PeripheralCharacteristic {
|
||||
service: string;
|
||||
characteristic: string;
|
||||
properties: string[];
|
||||
@@ -26,7 +27,12 @@ declare namespace BLECentralPlugin {
|
||||
characteristics: PeripheralCharacteristic[]
|
||||
}
|
||||
|
||||
|
||||
|
||||
interface BLEError {
|
||||
name: string;
|
||||
id: string;
|
||||
errorMessage: string;
|
||||
}
|
||||
|
||||
|
||||
interface StartScanOptions {
|
||||
@@ -34,75 +40,80 @@ declare namespace BLECentralPlugin {
|
||||
}
|
||||
|
||||
export interface BLECentralPluginStatic {
|
||||
scan(services: string[], seconds: number, success : (data: PeripheralData) => any): void;
|
||||
scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure : () => any): void;
|
||||
|
||||
startScan(services: string[], success: (data: PeripheralData) => any): void;
|
||||
startScan(services: string[], success: (data: PeripheralData) => any, failure: () => any): void;
|
||||
scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure? : (error: string) => any): void;
|
||||
|
||||
startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any): void;
|
||||
startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure: () => any): void;
|
||||
startScan(services: string[], success: (data: PeripheralData) => any, failure?: (error: string|BLEError) => any): void;
|
||||
|
||||
startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure?: (error: string) => any): void;
|
||||
|
||||
stopScan(): void;
|
||||
stopScan(success: () => any): void;
|
||||
stopScan(success: () => any, failure: () => any): void;
|
||||
|
||||
connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: () => any): void;
|
||||
stopScan(success: () => any, failure?: () => any): void;
|
||||
|
||||
disconnect(device_id:string): void;
|
||||
disconnect(device_id:string, success: () => any): void;
|
||||
disconnect(device_id:string, success: () => any, failure: () => any): void;
|
||||
connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void;
|
||||
|
||||
read(device_id: string, service_uuid:string, characteristic_uuid:string): void;
|
||||
read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void;
|
||||
read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void;
|
||||
/* Automatically connect to a device when it is in range of the phone
|
||||
[iOS] background notifications on ios must be enabled if you want to run in the background
|
||||
[Android] this relies on the autoConnect argument of BluetoothDevice.connectGatt(). Not all Android devices implement this feature correctly. */
|
||||
autoConnect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void;
|
||||
|
||||
write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void;
|
||||
write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void;
|
||||
write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void;
|
||||
disconnect(device_id:string, success?: () => any, failure?: (error: string|BLEError) => any): void;
|
||||
|
||||
/* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack.
|
||||
read(device_id: string, service_uuid:string, characteristic_uuid:string, success?: (rawData: ArrayBuffer) => any, failure?: (error: string|BLEError) => any): void;
|
||||
|
||||
write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success?: () => any, failure?: (error: string|BLEError) => any): void;
|
||||
|
||||
/* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack.
|
||||
The success callback is be called when the characteristic is written.*/
|
||||
writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void;
|
||||
writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void;
|
||||
writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void;
|
||||
writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success?: () => any, failure?: (error: string) => any): void;
|
||||
|
||||
/* Register to be notified when the value of a characteristic changes. */
|
||||
startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void;
|
||||
startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void;
|
||||
|
||||
stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string): void;
|
||||
stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any): void;
|
||||
stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any, failure: () => any): void;
|
||||
startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure?: (error: string|BLEError) => any): void;
|
||||
|
||||
stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success?: () => any, failure?: (error: string|BLEError) => any): void;
|
||||
|
||||
/* Reports if bluetooth is enabled. */
|
||||
isEnabled(success: () => any , failure: () => any): void;
|
||||
isEnabled(success: () => any , failure: (error: string) => any): void;
|
||||
|
||||
/* Calls the success callback when the peripheral is connected and the failure callback when not connected. */
|
||||
isConnected(device_id: string, success: () => any): void;
|
||||
isConnected(device_id: string, success: () => any, failure: () => any): void;
|
||||
isConnected(device_id: string, success: () => any, failure?: (error: string) => any): void;
|
||||
|
||||
startStateNotifications(success: (state: string) => any): void;
|
||||
startStateNotifications(success: (state: string) => any, failure: () => any): void;
|
||||
/* May be used to request (on Android) a larger MTU size to be able to send more data at once
|
||||
[iOS] requestMtu is not supported on iOS. */
|
||||
requestMtu(device_id: string, mtu: number, success?: () => any, failure?: () => any): void;
|
||||
|
||||
/* Clears cached services and characteristics info for some poorly behaved devices. Uses an undocumented API,
|
||||
so it is not guaranteed to work.
|
||||
[iOS] refreshDeviceCache is not supported on iOS. */
|
||||
refreshDeviceCache(device_id: string, timeout_millis: number, success?: (data: PeripheralDataExtended) => any, failure?: (error: string|BLEError) => any): void;
|
||||
|
||||
startStateNotifications(success: (state: string) => any, failure?: (error: string) => any): void;
|
||||
|
||||
stopStateNotifications(success?: () => any, failure?: () => any): void;
|
||||
|
||||
stopStateNotifications(): void;
|
||||
stopStateNotifications(success: () => any): void;
|
||||
stopStateNotifications(success: () => any, failure: () => any): void;
|
||||
|
||||
/* Opens the Bluetooth settings for the operating systems.
|
||||
[iOS] showBluetoothSettings is not supported on iOS. */
|
||||
showBluetoothSettings(): void;
|
||||
showBluetoothSettings(success: () => any): void;
|
||||
showBluetoothSettings(success: () => any, failure: () => any): void;
|
||||
|
||||
|
||||
/* Enable Bluetooth on the device.
|
||||
[iOS] enable is not supported on iOS. */
|
||||
enable(success: () => any, failure: () => any): void;
|
||||
|
||||
enable(success: () => any, failure: (error: string) => any): void;
|
||||
|
||||
readRSSI(device_id:string, success: (rssi: number) => any): void;
|
||||
readRSSI(device_id:string, success: (rssi: number) => any, failure: () => any): void;
|
||||
readRSSI(device_id:string, success: (rssi: number) => any, failure?: (error: string) => any): void;
|
||||
|
||||
/* Find connected peripherals offering the listed service UUIDs.
|
||||
This function wraps CBCentralManager.retrieveConnectedPeripheralsWithServices.
|
||||
[Android] peripheralsWithIdentifiers is not supported on Android. */
|
||||
connectedPeripheralsWithServices(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void;
|
||||
|
||||
/* Find known (but not necessarily connected) peripherals offering the listed service UUIDs.
|
||||
This function wraps CBCentralManager.retrievePeripheralsWithIdentifiers
|
||||
[Android] peripheralsWithIdentifiers is not supported on Android. */
|
||||
peripheralsWithIdentifiers(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void;
|
||||
|
||||
/* Find the bonded devices.
|
||||
[iOS] bondedDevices is not supported on iOS. */
|
||||
bondedDevices(success: (data: PeripheralData[]) => any, failure: () => any): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare var ble: BLECentralPlugin.BLECentralPluginStatic;
|
||||
declare var ble: BLECentralPlugin.BLECentralPluginStatic;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import * as lib from 'country-data';
|
||||
|
||||
lib.callingCodes.all; // $ExpectType ReadonlyArray<string>
|
||||
lib.callingCountries.all; // $ExpectType ReadonlyArray<Country>
|
||||
lib.continents.africa; // $ExpectType Continent
|
||||
lib.continents.africa.countries; // $ExpectType ReadonlyArray<Country>
|
||||
lib.countries.all; // $ExpectType ReadonlyArray<Country>
|
||||
lib.currencies.all; // $ExpectType ReadonlyArray<Currency>
|
||||
lib.languages.all; // $ExpectType ReadonlyArray<Language>
|
||||
lib.regions.antarctica; // $ExpectType Region
|
||||
lib.regions.antarctica.countries; // $ExpectType ReadonlyArray<string>
|
||||
lib.lookup.countries(""); // $ExpectType ReadonlyArray<Country>
|
||||
lib.lookup.currencies(""); // $ExpectType ReadonlyArray<Currency>
|
||||
lib.lookup.languages(""); // $ExpectType ReadonlyArray<Language>
|
||||
Vendored
+103
@@ -0,0 +1,103 @@
|
||||
// Type definitions for country-data 0.0
|
||||
// Project: https://github.com/OpenBookPrices/country-data
|
||||
// Definitions by: Logan Dam <https://github.com/biltongza>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Country {
|
||||
readonly alpha2: string;
|
||||
readonly alpha3: string;
|
||||
readonly countryCallingCodes: ReadonlyArray<string>;
|
||||
readonly currencies: ReadonlyArray<string>;
|
||||
readonly emoji: string;
|
||||
readonly ioc: string;
|
||||
readonly languages: ReadonlyArray<string>;
|
||||
readonly name: string;
|
||||
readonly status: string;
|
||||
}
|
||||
|
||||
export interface Currency {
|
||||
readonly code: string;
|
||||
readonly decimals: number;
|
||||
readonly name: string;
|
||||
readonly number: number;
|
||||
}
|
||||
|
||||
export interface Language {
|
||||
readonly alpha2: string;
|
||||
readonly alpha3: string;
|
||||
readonly bibliographic: string;
|
||||
readonly name: string;
|
||||
}
|
||||
|
||||
export interface Continent {
|
||||
readonly name: string;
|
||||
readonly regions: ReadonlyArray<string>;
|
||||
readonly countries: ReadonlyArray<Country>;
|
||||
}
|
||||
|
||||
export interface Region {
|
||||
readonly name: string;
|
||||
readonly countries: ReadonlyArray<string>;
|
||||
}
|
||||
|
||||
export const countries: {
|
||||
readonly all: ReadonlyArray<Country>;
|
||||
};
|
||||
|
||||
export const continents: {
|
||||
readonly africa: Continent;
|
||||
readonly antarctica: Continent;
|
||||
readonly asia: Continent;
|
||||
readonly europe: Continent;
|
||||
readonly northAmerica: Continent;
|
||||
readonly oceania: Continent;
|
||||
readonly southAmerica: Continent;
|
||||
};
|
||||
|
||||
export const callingCodes: {
|
||||
readonly all: ReadonlyArray<string>;
|
||||
};
|
||||
|
||||
export const callingCountries: {
|
||||
readonly all: ReadonlyArray<Country>;
|
||||
};
|
||||
|
||||
export const currencies: {
|
||||
readonly all: ReadonlyArray<Currency>;
|
||||
};
|
||||
|
||||
export const languages: {
|
||||
readonly all: ReadonlyArray<Language>;
|
||||
};
|
||||
|
||||
export const regions: {
|
||||
readonly centralAsia: Region;
|
||||
readonly southernAsia: Region;
|
||||
readonly southeastAsia: Region;
|
||||
readonly eastAsia: Region;
|
||||
readonly westernAsia: Region;
|
||||
readonly centralAfrica: Region;
|
||||
readonly northAfrica: Region;
|
||||
readonly southernAfrica: Region;
|
||||
readonly eastAfrica: Region;
|
||||
readonly westAfrica: Region;
|
||||
readonly centralAmerica: Region;
|
||||
readonly northernAmerica: Region;
|
||||
readonly caribbean: Region;
|
||||
readonly southAmerica: Region;
|
||||
readonly antarctica: Region;
|
||||
readonly northernEurope: Region;
|
||||
readonly southernEurope: Region;
|
||||
readonly easternEurope: Region;
|
||||
readonly westernEurope: Region;
|
||||
readonly australia: Region;
|
||||
readonly melanesia: Region;
|
||||
readonly micronesia: Region;
|
||||
readonly polynesia: Region;
|
||||
};
|
||||
|
||||
export const lookup: {
|
||||
readonly countries: (query: any) => ReadonlyArray<Country>;
|
||||
readonly currencies: (query: any) => ReadonlyArray<Currency>;
|
||||
readonly languages: (query: any) => ReadonlyArray<Language>;
|
||||
};
|
||||
@@ -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",
|
||||
"country-data-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -5,6 +5,11 @@ function add10(n: number) {
|
||||
|
||||
CustomFunctions.associate('ADD10', add10);
|
||||
|
||||
CustomFunctions.associate({
|
||||
ADD10: add10,
|
||||
RANDOM: (n: number) => n * Math.random()
|
||||
});
|
||||
|
||||
async function getStockValues(ticker: string): Promise<number> {
|
||||
const response = await fetch(`myService.com/prices/${ticker}`);
|
||||
return (await response.json())["price"];
|
||||
|
||||
+7
-2
@@ -16,9 +16,14 @@ Copyright (c) Microsoft Corporation
|
||||
declare namespace CustomFunctions {
|
||||
/**
|
||||
* @beta
|
||||
* Ties together the function's JavaScript name with the JSON id property
|
||||
* Associates the JavaScript function to the name given by the "id" property in the metadata JSON file.
|
||||
*/
|
||||
function associate(id: string, functionObject: Function): void;
|
||||
/**
|
||||
* @beta
|
||||
* Associates the JavaScript functions to the names given by the "id" properties in the metadata JSON file.
|
||||
*/
|
||||
function associate(mappings: { [key: string]: Function }): void;
|
||||
|
||||
/**
|
||||
* A handler passed automatically as the last parameter
|
||||
@@ -28,7 +33,6 @@ declare namespace CustomFunctions {
|
||||
* to handle what happens when the function stops streaming.
|
||||
* @beta
|
||||
*/
|
||||
|
||||
interface StreamingHandler<T> extends CancelableHandler {
|
||||
/**
|
||||
* Sets the returned result for a streaming custom function.
|
||||
@@ -36,6 +40,7 @@ declare namespace CustomFunctions {
|
||||
*/
|
||||
setResult: (value: T | Error) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* CancelableHandler interface
|
||||
|
||||
@@ -371,6 +371,7 @@ const gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw();
|
||||
const mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw();
|
||||
const orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw();
|
||||
const stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw();
|
||||
const equalEarthRaw: d3Geo.GeoRawProjection = d3Geo.geoEqualEarthRaw();
|
||||
const transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw();
|
||||
const naturalEarth1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw();
|
||||
|
||||
@@ -398,6 +399,7 @@ const gnomonic: d3Geo.GeoProjection = d3Geo.geoGnomonic();
|
||||
const mercator: d3Geo.GeoProjection = d3Geo.geoMercator();
|
||||
const orthographic: d3Geo.GeoProjection = d3Geo.geoOrthographic();
|
||||
const stereographic: d3Geo.GeoProjection = d3Geo.geoStereographic();
|
||||
const equalEarth: d3Geo.GeoProjection = d3Geo.geoEqualEarth();
|
||||
const transverseMercator: d3Geo.GeoProjection = d3Geo.geoTransverseMercator();
|
||||
const naturalEarth1: d3Geo.GeoProjection = d3Geo.geoNaturalEarth1();
|
||||
|
||||
|
||||
Vendored
+13
-2
@@ -1,10 +1,10 @@
|
||||
// Type definitions for D3JS d3-geo module 1.10
|
||||
// Type definitions for D3JS d3-geo module 1.11
|
||||
// Project: https://github.com/d3/d3-geo/
|
||||
// Definitions by: Hugues Stefanski <https://github.com/ledragon>, Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Last module patch version validated against: 1.10.0
|
||||
// Last module patch version validated against: 1.11.3
|
||||
|
||||
import * as GeoJSON from 'geojson';
|
||||
|
||||
@@ -1345,11 +1345,22 @@ export function geoOrthographicRaw(): GeoRawProjection;
|
||||
* The stereographic projection.
|
||||
*/
|
||||
export function geoStereographic(): GeoProjection;
|
||||
|
||||
/**
|
||||
* The raw stereographic projection.
|
||||
*/
|
||||
export function geoStereographicRaw(): GeoRawProjection;
|
||||
|
||||
/**
|
||||
* The Equal Eartch projection, by Bojan Šavrič et al., 2018.
|
||||
*/
|
||||
export function geoEqualEarth(): GeoProjection;
|
||||
|
||||
/**
|
||||
* The raw Equal Earth projection, by Bojan Šavrič et al., 2018.
|
||||
*/
|
||||
export function geoEqualEarthRaw(): GeoRawProjection;
|
||||
|
||||
// Composite Projections ---------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for D3JS d3 standard bundle 5.5
|
||||
// Type definitions for D3JS d3 standard bundle 5.7
|
||||
// Project: https://github.com/d3/d3
|
||||
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
|
||||
// Alex Ford <https://github.com/gustavderdrache>
|
||||
@@ -7,7 +7,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Last module patch version validated against: 5.5.0
|
||||
// Last module patch version validated against: 5.7.0
|
||||
|
||||
// NOTE TO MAINTAINERS: Review D3 v4.x module dependencies (see v4 sub-folder) and update its path-mappings in tsconfig (v4 folder),
|
||||
// if new MAJOR version of D3 v4 modules are released!!!
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import debounceFn = require('debounce-fn');
|
||||
|
||||
const debounced = debounceFn((s: string) => true);
|
||||
debounced; // $ExpectType ((s: string) => boolean | undefined) & { cancel(): void; }
|
||||
|
||||
debounceFn((s: string) => true);
|
||||
debounceFn((s: string) => true, { wait: 100 });
|
||||
debounceFn((s: string) => true, { immediate: true });
|
||||
|
||||
debounced.cancel();
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for debounce-fn 1.0
|
||||
// Project: https://github.com/sindresorhus/debounce-fn#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
export = debounce;
|
||||
|
||||
/**
|
||||
* Returns a debounced function that delays calling the `input` function until after `wait` milliseconds
|
||||
* have elapsed since the last time the debounced function was called.
|
||||
*
|
||||
* It comes with a `.cancel()` method to cancel any scheduled `input` function calls.
|
||||
*/
|
||||
declare function debounce<TArgs extends any[], TResult>(
|
||||
input: (...args: TArgs) => TResult,
|
||||
options?: debounce.Options
|
||||
): ((...args: TArgs) => TResult | undefined) & { cancel(): void };
|
||||
|
||||
declare namespace debounce {
|
||||
interface Options {
|
||||
/**
|
||||
* Time to wait until the `input` function is called.
|
||||
* @default 0
|
||||
*/
|
||||
wait?: number;
|
||||
/**
|
||||
* Trigger the function on the leading edge instead of the trailing edge of the `wait` interval.
|
||||
* For example, can be useful for preventing accidental double-clicks on a "submit" button
|
||||
* from firing a second time.
|
||||
*/
|
||||
immediate?: boolean;
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"debounce-fn-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,4 @@
|
||||
import dogeSeed = require('doge-seed');
|
||||
|
||||
dogeSeed(); // $ExpectType string
|
||||
dogeSeed(128); // $ExpectType string
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for doge-seed 1.0
|
||||
// Project: https://github.com/lukechilds/doge-seed#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = dogeSeed;
|
||||
|
||||
/**
|
||||
* Generates a cryptographically secure mnemonic seed phrase with added dankness.
|
||||
* The first four words will be a randomly generated Doge-like sentence.
|
||||
*
|
||||
* The seed phrases are fully valid checksummed BIP39 seeds. They can be used with any cryptocurrency
|
||||
* and can be imported into any BIP39 compliant wallet.
|
||||
*
|
||||
* @param bits The number of bits to derive a BIP39 mnemonic from. Default: `128`.
|
||||
* @returns A BIP39 mnemonic seed phrase.
|
||||
*/
|
||||
declare function dogeSeed(bits?: 128 | 160 | 192 | 224 | 256): string;
|
||||
@@ -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",
|
||||
"doge-seed-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,3 @@
|
||||
import execall = require('execall');
|
||||
|
||||
execall(/(\d+)/g, '$200 and $400'); // $ExpectType Match[]
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for execall 1.0
|
||||
// Project: https://github.com/sindresorhus/execall
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = execall;
|
||||
|
||||
/**
|
||||
* Find multiple RegExp matches in a string. Instead of having to iterate over
|
||||
* `RegExp#exec`, immutable, and with a nicer result format.
|
||||
*
|
||||
* @param re Regular expression to match against the `input`.
|
||||
* @returns An array of matches.
|
||||
*/
|
||||
declare function execall(re: RegExp, input: string): execall.Match[];
|
||||
|
||||
declare namespace execall {
|
||||
interface Match {
|
||||
match: string;
|
||||
sub: string[];
|
||||
index: number;
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"execall-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,18 @@
|
||||
import Exif = require('exif');
|
||||
const ExifImage = Exif.ExifImage;
|
||||
|
||||
new ExifImage({ image: 'myImage.jpg' }, (error, exifData) => {
|
||||
if (error) {
|
||||
console.log(`Error: ${error.message}`);
|
||||
} else {
|
||||
console.log(exifData);
|
||||
}
|
||||
});
|
||||
|
||||
Exif('myImage.jpg', (error, exifData, dataPath) => {
|
||||
if (error) {
|
||||
console.log(`Error: ${error.message}`);
|
||||
} else {
|
||||
console.log(exifData, dataPath);
|
||||
}
|
||||
});
|
||||
Vendored
+143
@@ -0,0 +1,143 @@
|
||||
// Type definitions for exif 0.6
|
||||
// Project: https://github.com/gomfunkel/node-exif#readme
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare namespace Exif {
|
||||
interface ExifData {
|
||||
image: {
|
||||
Copyright?: string;
|
||||
ExifOffset?: number;
|
||||
ImageHeight?: number;
|
||||
ImageWidth?: number;
|
||||
Make?: string;
|
||||
Model?: string;
|
||||
ModifyDate?: string;
|
||||
Orientation?: number;
|
||||
ResolutionUnit?: number;
|
||||
Software?: string;
|
||||
XResolution?: number;
|
||||
YCbCrPositioning?: number;
|
||||
YResolution?: number;
|
||||
};
|
||||
thumbnail: {
|
||||
Compression?: number;
|
||||
Orientation?: number;
|
||||
ResolutionUnit?: number;
|
||||
ThumbnailLength?: number;
|
||||
ThumbnailOffset?: number;
|
||||
XResolution?: number;
|
||||
YCbCrPositioning?: number;
|
||||
YResolution?: number;
|
||||
};
|
||||
exif: {
|
||||
ApertureValue?: number;
|
||||
BrightnessValue?: number;
|
||||
ColorSpace?: number;
|
||||
ComponentsConfiguration?: Buffer;
|
||||
CompressedBitsPerPixel?: number;
|
||||
CreateDate?: string;
|
||||
DateTimeOriginal?: string;
|
||||
ExifImageHeight?: number;
|
||||
ExifImageWidth?: number;
|
||||
ExifVersion?: Buffer;
|
||||
ExposureCompensation?: number;
|
||||
ExposureMode?: number;
|
||||
ExposureProgram?: number;
|
||||
ExposureTime?: number;
|
||||
FileSource?: Buffer;
|
||||
Flash?: number;
|
||||
FlashpixVersion?: Buffer;
|
||||
FNumber?: number;
|
||||
FocalLength?: number;
|
||||
FocalLengthIn35mmFormat?: number;
|
||||
FocalPlaneResolutionUnit?: number;
|
||||
FocalPlaneXResolution?: number;
|
||||
FocalPlaneYResolution?: number;
|
||||
ImageUniqueID?: string;
|
||||
InteropOffset?: number;
|
||||
ISO?: number;
|
||||
MakerNote?: Buffer;
|
||||
MaxApertureValue?: number;
|
||||
MeteringMode?: number;
|
||||
SceneCaptureType?: number;
|
||||
SceneType?: Buffer;
|
||||
SensingMethod?: number;
|
||||
ShutterSpeedValue?: number;
|
||||
UserComment?: Buffer;
|
||||
WhiteBalance?: number;
|
||||
};
|
||||
gps: {
|
||||
GPSAltitude?: number;
|
||||
GPSAltitudeRef?: number;
|
||||
GPSDateStamp?: string;
|
||||
GPSLatitude?: number[];
|
||||
GPSLatitudeRef?: string;
|
||||
GPSLongitude?: number[];
|
||||
GPSLongitudeRef?: string;
|
||||
GPSTimeStamp?: number[];
|
||||
GPSVersionId?: number[];
|
||||
};
|
||||
interoperability: {
|
||||
InteropIndex?: string;
|
||||
InteropVersion?: Buffer;
|
||||
};
|
||||
makernote: {
|
||||
AutoBracketing?: number;
|
||||
BlurWarning?: number;
|
||||
ExposureWarning?: number;
|
||||
error?: string;
|
||||
FlashExposureComp?: number;
|
||||
FocusMode?: number;
|
||||
FocusWarning?: number;
|
||||
FujiFlashMode?: number;
|
||||
Macro?: number;
|
||||
Quality?: string;
|
||||
Sharpness?: number;
|
||||
SlowSync?: number;
|
||||
Version?: Buffer;
|
||||
WhiteBalance?: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface ExifOptions {
|
||||
agfaMaxEntries?: number;
|
||||
epsonMaxEntries?: number;
|
||||
/** node-exif corrects the thumbnail offset in order to have an offset from the start of the buffer/file. */
|
||||
fixThumbnailOffset?: boolean;
|
||||
fujifilmMaxEntries?: number;
|
||||
ifd0MaxEntries?: number;
|
||||
ifd1MaxEntries?: number;
|
||||
/**
|
||||
* The image to get Exif data from can be either a filesystem path or a Buffer.
|
||||
*
|
||||
* If `image` is not specified, the developer must call `loadImage()` to parse the image.
|
||||
*/
|
||||
image?: string | Buffer;
|
||||
/** Specifies the maximum entries to be parsed */
|
||||
maxEntries?: number;
|
||||
maxGpsEntries?: number;
|
||||
maxInteroperabilityEntries?: number;
|
||||
noPadding?: boolean;
|
||||
olympusMaxEntries?: number;
|
||||
panasonicMaxEntries?: number;
|
||||
sanyoMaxEntries?: number;
|
||||
/** An object named "offsets" is added to exifData and contains lot of offsets needed to get thumbnail and other things. */
|
||||
tiffOffsets?: number;
|
||||
}
|
||||
|
||||
type ExifImageCallback = (error: Error | null, data: ExifData) => void;
|
||||
type ExifCallback = (error: Error | null, data: ExifData, dataPath: string) => void;
|
||||
|
||||
class ExifImage {
|
||||
constructor(options: ExifOptions | string | Buffer, callback: ExifImageCallback);
|
||||
constructor();
|
||||
loadImage(file: string | Buffer, callback: ExifImageCallback): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare function Exif(path: string, callback: Exif.ExifCallback): void;
|
||||
|
||||
export = Exif;
|
||||
@@ -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",
|
||||
"exif-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,6 @@
|
||||
import firstRun = require('first-run');
|
||||
|
||||
firstRun(); // $ExpectType boolean
|
||||
firstRun({ name: 'foo' }); // $ExpectType boolean
|
||||
|
||||
firstRun.clear();
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for first-run 1.2
|
||||
// Project: https://github.com/sindresorhus/first-run
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = firstRun;
|
||||
|
||||
/**
|
||||
* Check if it's the first time the process is run.
|
||||
*/
|
||||
declare function firstRun(options?: firstRun.Options): boolean;
|
||||
|
||||
declare namespace firstRun {
|
||||
/**
|
||||
* Clear the state.
|
||||
*/
|
||||
function clear(): void;
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* The name used to identify it.
|
||||
* @default name field in your package.json
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"first-run-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,10 +1,10 @@
|
||||
import {
|
||||
BBox,
|
||||
Feature, FeatureCollection, GeometryCollection, LineString,
|
||||
MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeometryObject
|
||||
MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeoJsonGeometryTypes,
|
||||
GeoJsonTypes, GeometryObject
|
||||
} from "geojson";
|
||||
|
||||
let featureCollection: FeatureCollection<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon | GeometryCollection> = {
|
||||
let featureCollection: FeatureCollection = {
|
||||
type: "FeatureCollection",
|
||||
features: [
|
||||
{
|
||||
@@ -53,6 +53,17 @@ let featureCollection: FeatureCollection<Point | LineString | Polygon | MultiPoi
|
||||
]
|
||||
};
|
||||
|
||||
featureCollection.type; // $ExpectType "FeatureCollection"
|
||||
featureCollection.features[0].type; // $ExpectType "Feature"
|
||||
featureCollection.features[0].geometry; // $ExpectType Geometry
|
||||
featureCollection.features[0].geometry.type; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection"
|
||||
|
||||
declare let geometryTypes: GeoJsonGeometryTypes;
|
||||
geometryTypes; // $ExpectType "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection"
|
||||
|
||||
declare let geojsonTypes: GeoJsonTypes;
|
||||
geojsonTypes; // $ExpectType "FeatureCollection" | "Feature" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection"
|
||||
|
||||
const featureWithPolygon: Feature<Polygon> = {
|
||||
type: "Feature",
|
||||
bbox: [-180.0, -90.0, 180.0, 90.0],
|
||||
@@ -65,6 +76,11 @@ const featureWithPolygon: Feature<Polygon> = {
|
||||
properties: null
|
||||
};
|
||||
|
||||
featureWithPolygon.type; // $ExpectType "Feature"
|
||||
featureWithPolygon.geometry; // $ExpectType Polygon
|
||||
featureWithPolygon.geometry.type; // $ExpectType "Polygon"
|
||||
featureWithPolygon.geometry.coordinates; // $ExpectType number[][][]
|
||||
|
||||
const point: Point = {
|
||||
type: "Point",
|
||||
coordinates: [100.0, 0.0]
|
||||
@@ -135,6 +151,8 @@ let feature: Feature<GeometryObject> = {
|
||||
properties: null
|
||||
};
|
||||
|
||||
feature.properties; // $ExpectType GeoJsonProperties
|
||||
|
||||
feature = {
|
||||
type: "Feature",
|
||||
geometry: polygon,
|
||||
@@ -275,12 +293,16 @@ const featureGeometryNull: Feature<null, TestProperty> = {
|
||||
geometry: null
|
||||
};
|
||||
|
||||
featureGeometryNull.properties.foo; // $ExpectType "bar" | "baz"
|
||||
|
||||
const featureNoNull: Feature<Point, TestProperty> = {
|
||||
type: "Feature",
|
||||
properties: testProps,
|
||||
geometry: point
|
||||
};
|
||||
|
||||
featureNoNull.geometry.type; // $ExpectType "Point"
|
||||
|
||||
const collectionAllNull: FeatureCollection<null, null> = {
|
||||
type: "FeatureCollection",
|
||||
features: [featureAllNull],
|
||||
@@ -301,6 +323,8 @@ const collectionGeometryMaybeNull: FeatureCollection<Point | null, TestProperty>
|
||||
features: [featureGeometryNull, featureNoNull],
|
||||
};
|
||||
|
||||
collectionGeometryMaybeNull.features[0].geometry; // $ExpectType Point | null
|
||||
|
||||
const collectionNoNull: FeatureCollection<Point, TestProperty> = {
|
||||
type: "FeatureCollection",
|
||||
features: [featureNoNull],
|
||||
@@ -311,6 +335,9 @@ const collectionDefault: FeatureCollection = {
|
||||
features: []
|
||||
};
|
||||
|
||||
collectionDefault.features[0].geometry; // $ExpectType Geometry
|
||||
collectionDefault.features[0].properties!.foo; // $ExpectType any
|
||||
|
||||
isNull = featureAllNull.geometry;
|
||||
isPoint = featurePropertyNull.geometry;
|
||||
isNull = featureAllNull.properties;
|
||||
|
||||
Vendored
+18
-21
@@ -4,6 +4,7 @@
|
||||
// Arne Schubert <https://github.com/atd-schubert>
|
||||
// Jeff Jacobson <https://github.com/JeffJacobson>
|
||||
// Ilia Choly <https://github.com/icholy>
|
||||
// Dan Vanderkam <https://github.com/danvk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -16,14 +17,13 @@ export as namespace GeoJSON;
|
||||
* The valid values for the "type" property of GeoJSON geometry objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonGeometryTypes = "Point" | "LineString" | "MultiPoint" | "Polygon" | "MultiLineString" |
|
||||
"MultiPolygon" | "GeometryCollection";
|
||||
export type GeoJsonGeometryTypes = Geometry['type'];
|
||||
|
||||
/**
|
||||
* The value values for the "type" property of GeoJSON Objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonTypes = "FeatureCollection" | "Feature" | GeoJsonGeometryTypes;
|
||||
export type GeoJsonTypes = GeoJSON['type'];
|
||||
|
||||
/**
|
||||
* Bounding box
|
||||
@@ -58,6 +58,10 @@ export interface GeoJsonObject {
|
||||
type: GeoJsonTypes;
|
||||
/**
|
||||
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
|
||||
* The value of the bbox member is an array of length 2*n where n is the number of dimensions
|
||||
* represented in the contained geometries, with all axes of the most southwesterly point
|
||||
* followed by all axes of the more northeasterly point.
|
||||
* The axes order of a bbox follows the axes order of geometries.
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
bbox?: BBox;
|
||||
@@ -69,24 +73,17 @@ export interface GeoJsonObject {
|
||||
export type GeoJSON = Geometry | Feature | FeatureCollection;
|
||||
|
||||
/**
|
||||
* A geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
*/
|
||||
export interface GeometryObject extends GeoJsonObject {
|
||||
type: GeoJsonGeometryTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union of geometry objects.
|
||||
* Geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
*/
|
||||
export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
|
||||
export type GeometryObject = Geometry;
|
||||
|
||||
/**
|
||||
* Point geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
||||
*/
|
||||
export interface Point extends GeometryObject {
|
||||
export interface Point extends GeoJsonObject {
|
||||
type: "Point";
|
||||
coordinates: Position;
|
||||
}
|
||||
@@ -95,7 +92,7 @@ export interface Point extends GeometryObject {
|
||||
* MultiPoint geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
||||
*/
|
||||
export interface MultiPoint extends GeometryObject {
|
||||
export interface MultiPoint extends GeoJsonObject {
|
||||
type: "MultiPoint";
|
||||
coordinates: Position[];
|
||||
}
|
||||
@@ -104,7 +101,7 @@ export interface MultiPoint extends GeometryObject {
|
||||
* LineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
||||
*/
|
||||
export interface LineString extends GeometryObject {
|
||||
export interface LineString extends GeoJsonObject {
|
||||
type: "LineString";
|
||||
coordinates: Position[];
|
||||
}
|
||||
@@ -113,7 +110,7 @@ export interface LineString extends GeometryObject {
|
||||
* MultiLineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
||||
*/
|
||||
export interface MultiLineString extends GeometryObject {
|
||||
export interface MultiLineString extends GeoJsonObject {
|
||||
type: "MultiLineString";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
@@ -122,7 +119,7 @@ export interface MultiLineString extends GeometryObject {
|
||||
* Polygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
||||
*/
|
||||
export interface Polygon extends GeometryObject {
|
||||
export interface Polygon extends GeoJsonObject {
|
||||
type: "Polygon";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
@@ -131,7 +128,7 @@ export interface Polygon extends GeometryObject {
|
||||
* MultiPolygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
||||
*/
|
||||
export interface MultiPolygon extends GeometryObject {
|
||||
export interface MultiPolygon extends GeoJsonObject {
|
||||
type: "MultiPolygon";
|
||||
coordinates: Position[][][];
|
||||
}
|
||||
@@ -140,7 +137,7 @@ export interface MultiPolygon extends GeometryObject {
|
||||
* Geometry Collection
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
||||
*/
|
||||
export interface GeometryCollection extends GeometryObject {
|
||||
export interface GeometryCollection extends GeoJsonObject {
|
||||
type: "GeometryCollection";
|
||||
geometries: Geometry[];
|
||||
}
|
||||
@@ -151,7 +148,7 @@ export type GeoJsonProperties = { [name: string]: any; } | null;
|
||||
* A feature object which contains a geometry and associated properties.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2
|
||||
*/
|
||||
export interface Feature<G extends GeometryObject | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
export interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "Feature";
|
||||
/**
|
||||
* The feature's geometry
|
||||
@@ -172,7 +169,7 @@ export interface Feature<G extends GeometryObject | null = Geometry, P = GeoJson
|
||||
* A collection of feature objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.3
|
||||
*/
|
||||
export interface FeatureCollection<G extends GeometryObject | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
export interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "FeatureCollection";
|
||||
features: Array<Feature<G, P>>;
|
||||
}
|
||||
|
||||
Vendored
+5
-5
@@ -342,15 +342,15 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
|
||||
* });
|
||||
*
|
||||
*/
|
||||
export class GraphQLObjectType {
|
||||
export class GraphQLObjectType<TSource = any, TContext = any> {
|
||||
name: string;
|
||||
description: Maybe<string>;
|
||||
astNode: Maybe<ObjectTypeDefinitionNode>;
|
||||
extensionASTNodes: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
|
||||
isTypeOf: Maybe<GraphQLIsTypeOfFn<any, any>>;
|
||||
isTypeOf: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
|
||||
|
||||
constructor(config: GraphQLObjectTypeConfig<any, any>);
|
||||
getFields(): GraphQLFieldMap<any, any>;
|
||||
constructor(config: GraphQLObjectTypeConfig<TSource, TContext>);
|
||||
getFields(): GraphQLFieldMap<any, TContext>;
|
||||
getInterfaces(): GraphQLInterfaceType[];
|
||||
toString(): string;
|
||||
toJSON(): string;
|
||||
@@ -371,7 +371,7 @@ export type GraphQLTypeResolver<TSource, TContext> = (
|
||||
value: TSource,
|
||||
context: TContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => MaybePromise<Maybe<GraphQLObjectType | string>>;
|
||||
) => MaybePromise<Maybe<GraphQLObjectType<TSource, TContext> | string>>;
|
||||
|
||||
export type GraphQLIsTypeOfFn<TSource, TContext> = (
|
||||
source: TSource,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import hexRgb = require('hex-rgb');
|
||||
|
||||
hexRgb('#cd2222cc'); // $ExpectType RgbaObj
|
||||
hexRgb('#cd2222cc', { format: 'array' }); // $ExpectType [number, number, number, number]
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for hex-rgb 3.0
|
||||
// Project: https://github.com/sindresorhus/hex-rgb#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = hexRgb;
|
||||
|
||||
declare function hexRgb(hex: string): hexRgb.RgbaObj;
|
||||
declare function hexRgb(hex: string, options: hexRgb.Options): hexRgb.RgbaArr;
|
||||
|
||||
declare namespace hexRgb {
|
||||
interface Options {
|
||||
format: 'array';
|
||||
}
|
||||
|
||||
interface RgbaObj {
|
||||
red: number;
|
||||
green: number;
|
||||
blue: number;
|
||||
alpha: number;
|
||||
}
|
||||
|
||||
type RgbaArr = [number, number, number, number];
|
||||
}
|
||||
@@ -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",
|
||||
"hex-rgb-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,9 @@
|
||||
import htmlTags = require('html-tags');
|
||||
import voidHtmlTags = require('html-tags/void');
|
||||
import htmlTagsJson = require('html-tags/html-tags.json');
|
||||
import voidHtmlTagsJson = require('html-tags/html-tags-void.json');
|
||||
|
||||
htmlTags; // $ExpectType string[]
|
||||
voidHtmlTags; // $ExpectType string[]
|
||||
htmlTagsJson; // $ExpectType string[]
|
||||
voidHtmlTagsJson; // $ExpectType string[]
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export = voidHtmlTags;
|
||||
|
||||
declare const voidHtmlTags: string[];
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export = htmlTags;
|
||||
|
||||
declare const htmlTags: string[];
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for html-tags 2.0
|
||||
// Project: https://github.com/sindresorhus/html-tags#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = htmlTags;
|
||||
|
||||
declare const htmlTags: string[];
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"void.d.ts",
|
||||
"html-tags.json.d.ts",
|
||||
"html-tags-void.json.d.ts",
|
||||
"html-tags-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export = voidHtmlTags;
|
||||
|
||||
declare const voidHtmlTags: string[];
|
||||
@@ -140,3 +140,6 @@ proxy({
|
||||
proxy({
|
||||
headers: {host: 'www.example.org'}
|
||||
});
|
||||
|
||||
// Shorthands
|
||||
proxy('/');
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import * as httpProxy from "http-proxy";
|
||||
import { Readable } from 'stream';
|
||||
|
||||
declare function proxy(config: proxy.Config): proxy.Proxy;
|
||||
declare function proxy(contextOrUri: string | string[] | proxy.Filter, config: proxy.Config): proxy.Proxy;
|
||||
declare function proxy(contextOrUri: string | string[] | proxy.Filter, config?: proxy.Config): proxy.Proxy;
|
||||
|
||||
declare namespace proxy {
|
||||
type Filter = (pathname: string, req: http.IncomingMessage) => boolean;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { Observable } from 'rxjs';
|
||||
import httpRx = require('http-rx');
|
||||
import request = require('request');
|
||||
|
||||
const httpGet: Observable<any> = httpRx.get('');
|
||||
const httpGet: Observable<{response: request.Response}> = httpRx.get('');
|
||||
|
||||
const httpHead: Observable<number> = httpRx.head('');
|
||||
const httpHead: Observable<{body: any}> = httpRx.head('');
|
||||
|
||||
const httpPatch: Observable<string> = httpRx.patch('');
|
||||
const httpPatch: Observable<{response: request.Response, body: any}> = httpRx.patch('');
|
||||
|
||||
const httpPost: Observable<void> = httpRx.post('');
|
||||
const httpPost: Observable<{response: request.Response, body: any}> = httpRx.post('', {json: true});
|
||||
|
||||
const httpPut: Observable<{}> = httpRx.put('');
|
||||
|
||||
|
||||
Vendored
+12
-7
@@ -1,4 +1,4 @@
|
||||
// Type definitions for http-rx 1.1
|
||||
// Type definitions for http-rx 2.0
|
||||
// Project: https://github.com/JasonRammoray/HttpRx
|
||||
// Definitions by: L2jLiga <https://github.com/L2jLiga>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -7,18 +7,23 @@
|
||||
import { Observable } from 'rxjs';
|
||||
import request = require('request');
|
||||
|
||||
interface ResponseWrapper {
|
||||
response: request.Response;
|
||||
body: any;
|
||||
}
|
||||
|
||||
interface HttpRx {
|
||||
get(url: string, options?: request.CoreOptions): Observable<any>;
|
||||
get(url: string, options?: request.CoreOptions): Observable<ResponseWrapper>;
|
||||
|
||||
head(url: string, options?: request.CoreOptions): Observable<any>;
|
||||
head(url: string, options?: request.CoreOptions): Observable<ResponseWrapper>;
|
||||
|
||||
patch(url: string, options?: request.CoreOptions): Observable<any>;
|
||||
patch(url: string, options?: request.CoreOptions): Observable<ResponseWrapper>;
|
||||
|
||||
post(url: string, options?: request.CoreOptions): Observable<any>;
|
||||
post(url: string, options?: request.CoreOptions): Observable<ResponseWrapper>;
|
||||
|
||||
put(url: string, options?: request.CoreOptions): Observable<any>;
|
||||
put(url: string, options?: request.CoreOptions): Observable<ResponseWrapper>;
|
||||
|
||||
'delete'(url: string, options?: request.CoreOptions): Observable<any>;
|
||||
delete(url: string, options?: request.CoreOptions): Observable<ResponseWrapper>;
|
||||
}
|
||||
|
||||
declare const httpRx: HttpRx;
|
||||
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for is-elevated 2.0
|
||||
// Project: https://github.com/sindresorhus/is-elevated#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = isElevated;
|
||||
|
||||
declare function isElevated(): Promise<boolean>;
|
||||
@@ -0,0 +1,3 @@
|
||||
import isElevated = require('is-elevated');
|
||||
|
||||
isElevated(); // $ExpectType Promise<boolean>
|
||||
@@ -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",
|
||||
"is-elevated-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for is-online 8.0
|
||||
// Project: https://github.com/sindresorhus/is-online#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = isOnline;
|
||||
|
||||
/**
|
||||
* Check if the internet connection is up.
|
||||
*
|
||||
* The following checks are run in parallel:
|
||||
* - Retrieve [icanhazip.com](https://github.com/major/icanhaz) via HTTPS
|
||||
* - Query `myip.opendns.com` on OpenDNS (Node.js only)
|
||||
* - Retrieve Apple's Captive Portal test page (Node.js only)
|
||||
*
|
||||
* When the first check succeeds, the returned Promise is resolved to `true`.
|
||||
*/
|
||||
declare function isOnline(options?: isOnline.Options): Promise<boolean>;
|
||||
|
||||
declare namespace isOnline {
|
||||
interface Options {
|
||||
/**
|
||||
* Milliseconds to wait for a server to respond.
|
||||
* @default 5000
|
||||
*/
|
||||
timeout?: number;
|
||||
/**
|
||||
* Internet Protocol version to use. This is an advanced option that is usually not necessary to be set,
|
||||
* but it can prove useful to specifically assert IPv6 connectivity.
|
||||
* @default 'v4'
|
||||
*/
|
||||
version?: 'v4' | 'v6';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import isOnline = require('is-online');
|
||||
|
||||
isOnline(); // $ExpectType Promise<boolean>
|
||||
isOnline({ timeout: 10 }); // $ExpectType Promise<boolean>
|
||||
isOnline({ version: 'v4' }); // $ExpectType Promise<boolean>
|
||||
isOnline({ version: 'v6' }); // $ExpectType Promise<boolean>
|
||||
@@ -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",
|
||||
"is-online-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// Type definitions for is-reachable 3.0
|
||||
// Project: https://github.com/sindresorhus/is-reachable#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = isReachable;
|
||||
|
||||
/**
|
||||
* Check if servers are reachable.
|
||||
*
|
||||
* The Node.js version will do a TCP handshake with the target's port. It attempts to detect cases where a router
|
||||
* redirects the request to itself.
|
||||
*
|
||||
* The browser version is limited by the fact that browsers cannot connect to arbitrary ports. It only supports
|
||||
* HTTP and HTTPS and the check relies on the `/favicon.ico` path being present.
|
||||
*
|
||||
* @param targets One or more targets to check. Can either be a full [URL](https://nodejs.org/api/url.html)
|
||||
* like `https://hostname`, `hostname:port` or just `hostname`. When the protocol is missing from a target
|
||||
* `http` is assumed.
|
||||
*
|
||||
* [Well-known protocols](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml)
|
||||
* are supported (e.g. `ftp://`, `mysql://`, `redis://` and more).
|
||||
*
|
||||
* @returns A `Promise` for a `boolean` which is `true` if any of the `targets` are reachable.
|
||||
*/
|
||||
declare function isReachable(
|
||||
targets: string | string[],
|
||||
options?: isReachable.Options
|
||||
): Promise<boolean>;
|
||||
|
||||
declare namespace isReachable {
|
||||
interface Options {
|
||||
/**
|
||||
* Timeout in milliseconds after which a request is considered failed.
|
||||
* @default 5000
|
||||
*/
|
||||
timeout?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import isReachable = require('is-reachable');
|
||||
|
||||
isReachable('sindresorhus.com'); // $ExpectType Promise<boolean>
|
||||
isReachable('google.com:80', { timeout: 10 }); // $ExpectType Promise<boolean>
|
||||
@@ -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",
|
||||
"is-reachable-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+9
-1
@@ -603,6 +603,14 @@ interface BaseJQueryEventObject extends Event {
|
||||
metaKey: boolean;
|
||||
}
|
||||
|
||||
interface JQueryCustomEventObject extends BaseJQueryEventObject {
|
||||
/**
|
||||
* @see {@link https://api.jquery.com/category/events/event-object/}
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}
|
||||
*/
|
||||
detail?: any;
|
||||
}
|
||||
|
||||
interface JQueryInputEventObject extends BaseJQueryEventObject {
|
||||
altKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
@@ -632,7 +640,7 @@ interface JQueryKeyEventObject extends JQueryInputEventObject {
|
||||
keyCode: number;
|
||||
}
|
||||
|
||||
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
|
||||
interface JQueryEventObject extends BaseJQueryEventObject, JQueryCustomEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for js-levenshtein 1.1
|
||||
// Project: https://github.com/gustf/js-levenshtein
|
||||
// Definitions by: Kallu609 <https://github.com/Kallu609>
|
||||
// Pyry Rouvila <https://github.com/naftis>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Calculates Levenshtein distance between two strings
|
||||
*/
|
||||
declare function levenshtein(compareFrom: string, compareTo: string): number;
|
||||
|
||||
export = levenshtein;
|
||||
@@ -0,0 +1,3 @@
|
||||
import levenshtein = require('js-levenshtein');
|
||||
|
||||
levenshtein('kittens', 'mittens'); // $ExpectType number
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "js-levenshtein-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for js-types 2.0
|
||||
// Project: https://github.com/sindresorhus/js-types#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = jsTypes;
|
||||
|
||||
declare const jsTypes: string[];
|
||||
@@ -0,0 +1,5 @@
|
||||
import jsTypes = require('js-types');
|
||||
import jsTypesJson = require('js-types/js-types.json');
|
||||
|
||||
jsTypes; // $ExpectType string[]
|
||||
jsTypesJson; // $ExpectType string[]
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export = jsTypes;
|
||||
|
||||
declare const jsTypes: string[];
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"js-types.json.d.ts",
|
||||
"js-types-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for jsonabc 2.3
|
||||
// Project: http://novicelab.org/jsonabc
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/**
|
||||
* Sort the JSON (clean, parse, sort, stringify).
|
||||
* @param noArray Sort or don't sort arrays
|
||||
*/
|
||||
export function sort(inputStr: string, noArray?: boolean): string;
|
||||
|
||||
/**
|
||||
* Sort the JSON (clean, parse, sort, stringify).
|
||||
* @param noArray Sort or don't sort arrays
|
||||
*/
|
||||
export function sortObj(input: object, noArray?: boolean): object;
|
||||
|
||||
/** Remove trailing commas */
|
||||
export function cleanJSON(input: string): string;
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as myJsonAbc from 'jsonabc';
|
||||
|
||||
myJsonAbc.sortObj({ c: 0, b: 1, a: 0 });
|
||||
myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }, false);
|
||||
|
||||
myJsonAbc.sort('{ c: 0, b: 1, a: 0 }');
|
||||
myJsonAbc.sort('{ c: 0, b: 1, a: 0 }', true);
|
||||
|
||||
myJsonAbc.cleanJSON('{ c: 0, b: 1, a: 0 }');
|
||||
@@ -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",
|
||||
"jsonabc-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for latest-semver 1.0
|
||||
// Project: https://github.com/sindresorhus/latest-semver#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = latestSemver;
|
||||
|
||||
declare function latestSemver(versions: string[]): string | undefined;
|
||||
@@ -0,0 +1,4 @@
|
||||
import latestSemver = require('latest-semver');
|
||||
|
||||
// $ExpectType string | undefined
|
||||
latestSemver(['v1.8.0-alpha.1', 'v1.3.16', 'v1.7.0', 'v1.6.9']);
|
||||
@@ -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",
|
||||
"latest-semver-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for latest-version 4.0
|
||||
// Project: https://github.com/sindresorhus/latest-version#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = latestVersion;
|
||||
|
||||
declare function latestVersion(name: string, options?: latestVersion.Options): Promise<string>;
|
||||
|
||||
declare namespace latestVersion {
|
||||
interface Options {
|
||||
version?: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import latestVersion = require('latest-version');
|
||||
|
||||
latestVersion('ava'); // $ExpectType Promise<string>
|
||||
latestVersion('npm', { version: 'latest-5' }); // $ExpectType Promise<string>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user