mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped into feature/webpack-multicompiler
# Conflicts: # types/webpack-stream/index.d.ts # types/webpack/index.d.ts
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-unnecessary-qualifier": false
|
||||
}
|
||||
}
|
||||
Vendored
+6
-8
@@ -455,7 +455,6 @@ declare namespace adone {
|
||||
* Writes a 32bit le float
|
||||
*
|
||||
* @param offset Offset to write to
|
||||
* @returns {this}
|
||||
*/
|
||||
writeFloatLE(value: number, offset?: number): this;
|
||||
|
||||
@@ -802,8 +801,7 @@ declare namespace adone {
|
||||
* Resizes this ByteArray to be backed by a buffer of at least the given capacity.
|
||||
* Will do nothing if already that large or larger.
|
||||
*
|
||||
* @param {number} capacity Capacity required
|
||||
* @returns {this}
|
||||
* @param capacity Capacity required
|
||||
*/
|
||||
resize(capacity: number): this;
|
||||
|
||||
@@ -1679,8 +1677,8 @@ declare namespace adone {
|
||||
* Returns a new BufferList object containing the bytes within the range specified.
|
||||
* No copies will be performed. All buffers in the result share memory with the original list.
|
||||
*
|
||||
* @param {number} start slice from
|
||||
* @param {number} end slice to
|
||||
* @param start slice from
|
||||
* @param end slice to
|
||||
*/
|
||||
shallowSlice(start?: number, end?: number): BufferList;
|
||||
|
||||
@@ -1705,11 +1703,11 @@ declare namespace adone {
|
||||
destroy(): void;
|
||||
|
||||
then<T1 = Buffer, T2 = never>(
|
||||
onfulfilled?: ((value: Buffer) => T1 | PromiseLike<T1>) | undefined | null,
|
||||
onrejected?: ((reason: any) => T2 | PromiseLike<T2>) | undefined | null
|
||||
onfulfilled?: ((value: Buffer) => T1 | PromiseLike<T1>) | null,
|
||||
onrejected?: ((reason: any) => T2 | PromiseLike<T2>) | null
|
||||
): PromiseLike<T1 | T2>;
|
||||
|
||||
catch<T>(onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): PromiseLike<T | Buffer>;
|
||||
catch<T>(onrejected?: ((reason: any) => T | PromiseLike<T>) | null): PromiseLike<T | Buffer>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+343
-361
File diff suppressed because it is too large
Load Diff
Vendored
-205
@@ -53,41 +53,27 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values swizzled.
|
||||
* @param a
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
*/
|
||||
swizzle(a: Float32x4, l1: number, l2: number, l3: number, l4: number): Float32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values shuffled.
|
||||
* @param a
|
||||
* @param b
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
*/
|
||||
shuffle(a: Float32x4, b: Float32x4, l1: number, l2: number, l3: number, l4: number): Float32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Float32x4. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Float32x4): Float32x4;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Float32x4 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: number): Float32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -121,16 +107,8 @@ declare namespace adone.math {
|
||||
|
||||
div(a: Float32x4, b: Float32x4): Float32x4;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
neg(a: Float32x4): Float32x4;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
abs(a: Float32x4): Float32x4;
|
||||
|
||||
min(a: Float32x4, b: Float32x4): Float32x4;
|
||||
@@ -143,16 +121,8 @@ declare namespace adone.math {
|
||||
|
||||
reciprocalApproximation(a: Float32x4, b: Float32x4): Float32x4;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
reciprocalSqrtApproximation(a: Float32x4): Float32x4;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
sqrt(a: Float32x4): Float32x4;
|
||||
|
||||
/**
|
||||
@@ -310,41 +280,27 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values swizzled.
|
||||
* @param a
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
*/
|
||||
swizzle(a: Int32x4, l1: number, l2: number, l3: number, l4: number): Int32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values shuffled.
|
||||
* @param a
|
||||
* @param b
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
*/
|
||||
shuffle(a: Int32x4, b: Int32x4, l1: number, l2: number, l3: number, l4: number): Int32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Int32x4. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Int32x4): Int32x4;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Int32x4 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: number): Int32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -384,10 +340,6 @@ declare namespace adone.math {
|
||||
|
||||
mul(a: Int32x4, b: Int32x4): Int32x4;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
neg(a: Int32x4): Int32x4;
|
||||
|
||||
/**
|
||||
@@ -565,49 +517,27 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values swizzled.
|
||||
* @param a
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
*/
|
||||
swizzle(a: Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Int16x8;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values shuffled.
|
||||
* @param a
|
||||
* @param b
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
*/
|
||||
shuffle(a: Int16x8, b: Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Int16x8;
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Int16x8. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Int16x8): Int16x8;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Int16x8 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: number): Int16x8;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -647,10 +577,6 @@ declare namespace adone.math {
|
||||
|
||||
mul(a: Int16x8, b: Int16x8): Int16x8;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
neg(a: Int16x8): Int16x8;
|
||||
|
||||
/**
|
||||
@@ -803,23 +729,6 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values swizzled.
|
||||
* @param a
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
* @param l9
|
||||
* @param l10
|
||||
* @param l11
|
||||
* @param l12
|
||||
* @param l13
|
||||
* @param l14
|
||||
* @param l15
|
||||
* @param l16
|
||||
*/
|
||||
swizzle(
|
||||
a: Int8x16,
|
||||
@@ -843,24 +752,6 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values shuffled.
|
||||
* @param a
|
||||
* @param b
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
* @param l9
|
||||
* @param l10
|
||||
* @param l11
|
||||
* @param l12
|
||||
* @param l13
|
||||
* @param l14
|
||||
* @param l15
|
||||
* @param l16
|
||||
*/
|
||||
shuffle(
|
||||
a: Int8x16,
|
||||
@@ -885,20 +776,17 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Int8x16. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Int8x16): Int8x16;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Int8x16 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: number): Int8x16;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -938,10 +826,6 @@ declare namespace adone.math {
|
||||
|
||||
mul(a: Int8x16, b: Int8x16): Int8x16;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
neg(a: Int8x16): Int8x16;
|
||||
|
||||
/**
|
||||
@@ -1065,41 +949,27 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values swizzled.
|
||||
* @param a
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
*/
|
||||
swizzle(a: Uint32x4, l1: number, l2: number, l3: number, l4: number): Uint32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values shuffled.
|
||||
* @param a
|
||||
* @param b
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
*/
|
||||
shuffle(a: Uint32x4, b: Uint32x4, l1: number, l2: number, l3: number, l4: number): Uint32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Uint32x4. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Uint32x4): Uint32x4;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Uint32x4 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: number): Uint32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -1314,49 +1184,27 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values swizzled.
|
||||
* @param a
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
*/
|
||||
swizzle(a: Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Uint16x8;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values shuffled.
|
||||
* @param a
|
||||
* @param b
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
*/
|
||||
shuffle(a: Uint16x8, b: Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Uint16x8;
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Uint16x8. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Uint16x8): Uint16x8;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Uint16x8 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: number): Uint16x8;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -1546,23 +1394,6 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values swizzled.
|
||||
* @param a
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
* @param l9
|
||||
* @param l10
|
||||
* @param l11
|
||||
* @param l12
|
||||
* @param l13
|
||||
* @param l14
|
||||
* @param l15
|
||||
* @param l16
|
||||
*/
|
||||
swizzle(
|
||||
a: Uint8x16,
|
||||
@@ -1586,24 +1417,6 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance with the lane values shuffled.
|
||||
* @param a
|
||||
* @param b
|
||||
* @param l1
|
||||
* @param l2
|
||||
* @param l3
|
||||
* @param l4
|
||||
* @param l5
|
||||
* @param l6
|
||||
* @param l7
|
||||
* @param l8
|
||||
* @param l9
|
||||
* @param l10
|
||||
* @param l11
|
||||
* @param l12
|
||||
* @param l13
|
||||
* @param l14
|
||||
* @param l15
|
||||
* @param l16
|
||||
*/
|
||||
shuffle(
|
||||
a: Uint8x16,
|
||||
@@ -1628,20 +1441,17 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Uint8x16. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Uint8x16): Uint8x16;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Uint8x16 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: number): Uint8x16;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -1802,20 +1612,17 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Bool32x4. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Bool32x4): Bool32x4;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Bool32x4 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: boolean): Bool32x4;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -1823,13 +1630,11 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* If all lane values are `true`, return `true`.
|
||||
* @param a
|
||||
*/
|
||||
allTrue(a: Bool32x4): boolean;
|
||||
|
||||
/**
|
||||
* If any lane values are `true`, return `true`.
|
||||
* @param a
|
||||
*/
|
||||
anyTrue(a: Bool32x4): boolean;
|
||||
|
||||
@@ -1888,20 +1693,17 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Bool16x8. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Bool16x8): Bool16x8;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Bool16x8 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: boolean): Bool16x8;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -1909,13 +1711,11 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* If all lane values are `true`, return `true`.
|
||||
* @param a
|
||||
*/
|
||||
allTrue(a: Bool16x8): boolean;
|
||||
|
||||
/**
|
||||
* If any lane values are `true`, return `true`.
|
||||
* @param a
|
||||
*/
|
||||
anyTrue(a: Bool16x8): boolean;
|
||||
|
||||
@@ -1998,20 +1798,17 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* Returns a new instance if the parameter is a valid SIMD data type and the same as Bool8x16. Throws a TypeError otherwise.
|
||||
* @param a
|
||||
*/
|
||||
check(a: Bool8x16): Bool8x16;
|
||||
|
||||
/**
|
||||
* Creates a new SIMD.Bool8x16 data type with all lanes set to a given value.
|
||||
* @param n
|
||||
*/
|
||||
splat(n: boolean): Bool8x16;
|
||||
|
||||
/**
|
||||
* Returns a new instance with the given lane value replaced.
|
||||
* @param simd An instance of a corresponding SIMD type.
|
||||
* @param lane
|
||||
* @param value A new value to be used for the lane.
|
||||
* @return A new SIMD data type with the given lane value replaced.
|
||||
*/
|
||||
@@ -2019,13 +1816,11 @@ declare namespace adone.math {
|
||||
|
||||
/**
|
||||
* If all lane values are `true`, return `true`.
|
||||
* @param a
|
||||
*/
|
||||
allTrue(a: Bool8x16): boolean;
|
||||
|
||||
/**
|
||||
* If any lane values are `true`, return `true`.
|
||||
* @param a
|
||||
*/
|
||||
anyTrue(a: Bool8x16): boolean;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -47,8 +47,8 @@ declare namespace adone {
|
||||
/**
|
||||
* Converts a function that returns promises to a node.js style callback function
|
||||
*
|
||||
* @param {Function} fn Function
|
||||
* @returns {Promise} the original promise
|
||||
* @param fn Function
|
||||
* @returns the original promise
|
||||
*/
|
||||
export function callbackify<R>(fn: () => Promise<R>): (callback: (err?: any, result?: R) => void) => Promise<R>;
|
||||
export function callbackify<T, R>(fn: (a: T) => Promise<R>): (a: T, callback: (err?: any, result?: R) => void) => Promise<R>;
|
||||
|
||||
@@ -1,144 +1,153 @@
|
||||
import * as algoliasearch from "algoliasearch";
|
||||
import { ClientOptions, SynonymOption, AlgoliaUserKeyOptions, SearchSynonymOptions, AlgoliaResponse,
|
||||
AlgoliaSecuredApiOptions, AlgoliaIndexSettings, AlgoliaQueryParameters, AlgoliaIndex } from "algoliasearch";
|
||||
import * as algoliasearch from 'algoliasearch';
|
||||
import {
|
||||
ClientOptions,
|
||||
SynonymOption,
|
||||
AlgoliaApiKeyOptions,
|
||||
SearchSynonymOptions,
|
||||
AlgoliaResponse,
|
||||
AlgoliaSecuredApiOptions,
|
||||
AlgoliaIndexSettings,
|
||||
AlgoliaQueryParameters,
|
||||
AlgoliaIndex,
|
||||
} from 'algoliasearch';
|
||||
|
||||
let _algoliaResponse: AlgoliaResponse = {
|
||||
hits: [{}, {}],
|
||||
page: 0,
|
||||
nbHits: 12,
|
||||
nbPages: 6,
|
||||
hitsPerPage: 2,
|
||||
processingTimeMS: 32,
|
||||
query: "",
|
||||
params: "",
|
||||
hits: [{}, {}],
|
||||
page: 0,
|
||||
nbHits: 12,
|
||||
nbPages: 6,
|
||||
hitsPerPage: 2,
|
||||
processingTimeMS: 32,
|
||||
query: '',
|
||||
params: '',
|
||||
};
|
||||
|
||||
let _clientOptions: ClientOptions = {
|
||||
timeout: 12,
|
||||
protocol: "",
|
||||
httpAgent: "",
|
||||
timeout: 12,
|
||||
protocol: '',
|
||||
httpAgent: '',
|
||||
};
|
||||
|
||||
let _synonymOption: SynonymOption = {
|
||||
forwardToSlaves: false,
|
||||
replaceExistingSynonyms: false,
|
||||
forwardToReplicas: false,
|
||||
replaceExistingSynonyms: false,
|
||||
};
|
||||
|
||||
let _algoliaUserKeyOptions: AlgoliaUserKeyOptions = {
|
||||
validity: 0,
|
||||
maxQueriesPerIPPerHour: 0,
|
||||
indexes: [""],
|
||||
queryParameters: { attributesToRetrieve: ["algolia"] },
|
||||
description: "",
|
||||
let _algoliaApiKeyOptions: AlgoliaApiKeyOptions = {
|
||||
validity: 0,
|
||||
maxQueriesPerIPPerHour: 0,
|
||||
indexes: [''],
|
||||
queryParameters: { attributesToRetrieve: ['algolia'] },
|
||||
description: '',
|
||||
};
|
||||
|
||||
let _searchSynonymOptions: SearchSynonymOptions = {
|
||||
query: "",
|
||||
page: 0,
|
||||
type: "",
|
||||
hitsPerPage: 0,
|
||||
query: '',
|
||||
page: 0,
|
||||
type: '',
|
||||
hitsPerPage: 0,
|
||||
};
|
||||
|
||||
let _algoliaSecuredApiOptions: AlgoliaSecuredApiOptions = {
|
||||
filters: "",
|
||||
validUntil: 0,
|
||||
restrictIndices: "",
|
||||
userToken: "",
|
||||
filters: '',
|
||||
validUntil: 0,
|
||||
restrictIndices: '',
|
||||
userToken: '',
|
||||
};
|
||||
|
||||
let _algoliaIndexSettings: AlgoliaIndexSettings = {
|
||||
attributesToIndex: [""],
|
||||
attributesForFaceting: [""],
|
||||
unretrievableAttributes: [""],
|
||||
attributesToRetrieve: [""],
|
||||
ranking: [""],
|
||||
customRanking: [""],
|
||||
slaves: [""],
|
||||
maxValuesPerFacet: "",
|
||||
attributesToHighlight: [""],
|
||||
attributesToSnippet: [""],
|
||||
highlightPreTag: "",
|
||||
highlightPostTag: "",
|
||||
snippetEllipsisText: "",
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: "",
|
||||
separatorsToIndex: "",
|
||||
queryType: "",
|
||||
removeWordsIfNoResults: "",
|
||||
advancedSyntax: false,
|
||||
optionalWords: [""],
|
||||
removeStopWords: [""],
|
||||
disablePrefixOnAttributes: [""],
|
||||
disableExactOnAttributes: [""],
|
||||
exactOnSingleWordQuery: "",
|
||||
alternativesAsExact: false,
|
||||
attributeForDistinct: "",
|
||||
distinct: false,
|
||||
numericAttributesToIndex: [""],
|
||||
allowCompressionOfIntegerArray: false,
|
||||
altCorrections: [{}],
|
||||
minProximity: 0,
|
||||
placeholders: "",
|
||||
attributesToIndex: [''],
|
||||
attributesForFaceting: [''],
|
||||
unretrievableAttributes: [''],
|
||||
attributesToRetrieve: [''],
|
||||
ranking: [''],
|
||||
customRanking: [''],
|
||||
replicas: [''],
|
||||
maxValuesPerFacet: '',
|
||||
attributesToHighlight: [''],
|
||||
attributesToSnippet: [''],
|
||||
highlightPreTag: '',
|
||||
highlightPostTag: '',
|
||||
snippetEllipsisText: '',
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
separatorsToIndex: '',
|
||||
queryType: '',
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [''],
|
||||
removeStopWords: [''],
|
||||
disablePrefixOnAttributes: [''],
|
||||
disableExactOnAttributes: [''],
|
||||
exactOnSingleWordQuery: '',
|
||||
alternativesAsExact: false,
|
||||
attributeForDistinct: '',
|
||||
distinct: false,
|
||||
numericAttributesToIndex: [''],
|
||||
allowCompressionOfIntegerArray: false,
|
||||
altCorrections: [{}],
|
||||
minProximity: 0,
|
||||
placeholders: '',
|
||||
};
|
||||
|
||||
let _algoliaQueryParameters: AlgoliaQueryParameters = {
|
||||
query: "",
|
||||
filters: "",
|
||||
attributesToRetrieve: [""],
|
||||
restrictSearchableAttributes: [""],
|
||||
facets: "",
|
||||
maxValuesPerFacet: "",
|
||||
attributesToHighlight: [""],
|
||||
attributesToSnippet: [""],
|
||||
highlightPreTag: "",
|
||||
highlightPostTag: "",
|
||||
snippetEllipsisText: "",
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
page: 0,
|
||||
offset: 0,
|
||||
length: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: "",
|
||||
aroundLatLng: "",
|
||||
aroundLatLngViaIP: "",
|
||||
aroundRadius: "",
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
insideBoundingBox: "",
|
||||
queryType: "",
|
||||
insidePolygon: "",
|
||||
removeWordsIfNoResults: "",
|
||||
advancedSyntax: false,
|
||||
optionalWords: [""],
|
||||
removeStopWords: [""],
|
||||
disableExactOnAttributes: [""],
|
||||
exactOnSingleWordQuery: "",
|
||||
alternativesAsExact: true,
|
||||
distinct: 0,
|
||||
getRankingInfo: false,
|
||||
numericAttributesToIndex: [""],
|
||||
numericFilters: [""],
|
||||
tagFilters: "",
|
||||
facetFilters: "",
|
||||
analytics: false,
|
||||
analyticsTags: [""],
|
||||
synonyms: true,
|
||||
replaceSynonymsInHighlight: false,
|
||||
minProximity: 0,
|
||||
query: '',
|
||||
filters: '',
|
||||
attributesToRetrieve: [''],
|
||||
restrictSearchableAttributes: [''],
|
||||
facets: '',
|
||||
maxValuesPerFacet: '',
|
||||
attributesToHighlight: [''],
|
||||
attributesToSnippet: [''],
|
||||
highlightPreTag: '',
|
||||
highlightPostTag: '',
|
||||
snippetEllipsisText: '',
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
page: 0,
|
||||
offset: 0,
|
||||
length: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
aroundLatLng: '',
|
||||
aroundLatLngViaIP: '',
|
||||
aroundRadius: '',
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
insideBoundingBox: '',
|
||||
queryType: '',
|
||||
insidePolygon: '',
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [''],
|
||||
removeStopWords: [''],
|
||||
disableExactOnAttributes: [''],
|
||||
exactOnSingleWordQuery: '',
|
||||
alternativesAsExact: true,
|
||||
distinct: 0,
|
||||
getRankingInfo: false,
|
||||
numericAttributesToIndex: [''],
|
||||
numericFilters: [''],
|
||||
tagFilters: '',
|
||||
facetFilters: '',
|
||||
analytics: false,
|
||||
analyticsTags: [''],
|
||||
synonyms: true,
|
||||
replaceSynonymsInHighlight: false,
|
||||
minProximity: 0,
|
||||
};
|
||||
|
||||
let index: AlgoliaIndex = algoliasearch("", "").initIndex("");
|
||||
let index: AlgoliaIndex = algoliasearch('', '').initIndex('');
|
||||
|
||||
let search = index.search({query: ""});
|
||||
index.search({query: ""}, (err, res) => {});
|
||||
let search = index.search({ query: '' });
|
||||
index.search({ query: '' }, (err, res) => {});
|
||||
|
||||
Vendored
+1666
-1504
File diff suppressed because it is too large
Load Diff
Vendored
+5
-1
@@ -2323,7 +2323,11 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
negativeLineColor: string;
|
||||
/** Example: {precision:-1, decimalSeparator:'.', thousandsSeparator:','}. The graph uses this object's values to format the numbers. Uses chart's numberFormatter if not defined. */
|
||||
numberFormatter: Object;
|
||||
/** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. */
|
||||
/** If you set it to true, column chart will begin new stack. This allows having Clustered and Stacked column/bar chart. */
|
||||
newStack: boolean;
|
||||
/** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider.
|
||||
@default 50
|
||||
*/
|
||||
openField: string;
|
||||
/**Precision of values. Will use chart's precision if not set any.*/
|
||||
precision: number;
|
||||
|
||||
Vendored
+3
-3
@@ -67,7 +67,7 @@ declare module 'angular' {
|
||||
* If the filter function returns a string it will be passed as the message
|
||||
* argument to the start method of the service.
|
||||
*
|
||||
* @param {angular.IRequestConfig} config - the Angular request config object.
|
||||
* @param config the Angular request config object.
|
||||
*
|
||||
*/
|
||||
requestFilter?(config: IRequestConfig): (string | boolean);
|
||||
@@ -123,7 +123,7 @@ declare module 'angular' {
|
||||
*
|
||||
* This behaviour can be modified in the configuration.
|
||||
*
|
||||
* @param {string|IBlockUIConfig} messageOrOptions -
|
||||
* @param messageOrOptions
|
||||
* Either supply the message (string) to be show in the
|
||||
* overlay or specify an IBlockUIConfig object that will be
|
||||
* merged/extended into the block ui instance state.
|
||||
@@ -156,7 +156,7 @@ declare module 'angular' {
|
||||
* Allows the message shown in the overlay to be updated
|
||||
* while to block is active.
|
||||
*
|
||||
* @param {string} message - The message to show in the overlay.
|
||||
* @param message The message to show in the overlay.
|
||||
*/
|
||||
message(message: string): void;
|
||||
|
||||
|
||||
@@ -264,6 +264,48 @@ myApp.controller('ToastController', ($scope: TestScope, $mdToast: ng.material.IT
|
||||
};
|
||||
});
|
||||
|
||||
myApp.controller('ThemeController', ($element: JQuery, $scope: TestScope, $mdTheming: ng.material.IThemingService) => {
|
||||
$mdTheming($element);
|
||||
|
||||
const PALETTES: ng.material.IConfiguredColorPalette = $mdTheming.PALETTES;
|
||||
const redPalette: ng.material.IPalette = PALETTES.red;
|
||||
const myPalette: ng.material.IPalette = PALETTES.myPalette;
|
||||
const THEMES: ng.material.IConfiguredThemes = $mdTheming.THEMES;
|
||||
const defaultTheme: ng.material.ITheme = THEMES.default;
|
||||
const myTheme: ng.material.ITheme = THEMES.myTheme;
|
||||
|
||||
$scope['registered'] = () => {
|
||||
let registered: boolean = $mdTheming.registered('default');
|
||||
registered = $mdTheming.registered('myTheme');
|
||||
};
|
||||
|
||||
$scope['defaultTheme'] = () => {
|
||||
const themeName: string = $mdTheming.defaultTheme();
|
||||
};
|
||||
|
||||
$scope['generateTheme'] = () => {
|
||||
$mdTheming.generateTheme('myTheme');
|
||||
};
|
||||
|
||||
$scope['setBrowserColors'] = () => {
|
||||
const browserColors: ng.material.IBrowserColors = {
|
||||
theme: 'default',
|
||||
palette: 'neonRed',
|
||||
hue: '500'
|
||||
};
|
||||
const remove: () => void = $mdTheming.setBrowserColor(browserColors);
|
||||
};
|
||||
|
||||
$scope['defineTheme'] = () => {
|
||||
const newTheme: ng.material.IDefineThemeOptions = {
|
||||
primary: 'blue',
|
||||
accent: 'orange',
|
||||
dark: true
|
||||
};
|
||||
$mdTheming.defineTheme('newTheme', newTheme);
|
||||
};
|
||||
});
|
||||
|
||||
myApp.controller('PanelController', ($scope: TestScope, $mdPanel: ng.material.IPanelService, $q: ng.IQService) => {
|
||||
$scope['createPanel'] = () => {
|
||||
const config: ng.material.IPanelConfig = {
|
||||
|
||||
Vendored
+31
@@ -290,6 +290,25 @@ declare module 'angular' {
|
||||
configuration(): IThemeConfig;
|
||||
}
|
||||
|
||||
interface IDefineThemeOptions {
|
||||
primary?: string;
|
||||
accent?: string;
|
||||
warn?: string;
|
||||
background?: string;
|
||||
dark?: boolean;
|
||||
}
|
||||
|
||||
interface IThemingService {
|
||||
PALETTES: IConfiguredColorPalette; // get only
|
||||
THEMES: IConfiguredThemes; // get only
|
||||
(element: JQuery): void;
|
||||
registered(themeName: string): boolean;
|
||||
defaultTheme(): string;
|
||||
generateTheme(name: string): void;
|
||||
setBrowserColor(options: IBrowserColors): () => void;
|
||||
defineTheme(name: string, options: IDefineThemeOptions): IPromise<string>;
|
||||
}
|
||||
|
||||
interface IDateLocaleProvider {
|
||||
months: string[];
|
||||
shortMonths: string[];
|
||||
@@ -330,6 +349,18 @@ declare module 'angular' {
|
||||
'blue-grey': IPalette;
|
||||
}
|
||||
|
||||
interface IConfiguredColorPalette extends IColorPalette {
|
||||
[name: string]: IPalette;
|
||||
}
|
||||
|
||||
interface IThemes {
|
||||
default: ITheme;
|
||||
}
|
||||
|
||||
interface IConfiguredThemes extends IThemes {
|
||||
[name: string]: ITheme;
|
||||
}
|
||||
|
||||
interface IPanelConfig {
|
||||
id?: string;
|
||||
template?: string;
|
||||
|
||||
@@ -178,7 +178,7 @@ mod.controller('name', class {
|
||||
// $onChanges(x: number) { }
|
||||
});
|
||||
mod.controller({
|
||||
MyCtrl: class{},
|
||||
MyCtrl: class {},
|
||||
MyCtrl2() {},
|
||||
MyCtrl3: ['$fooService', ($fooService: any) => { }]
|
||||
});
|
||||
@@ -229,7 +229,7 @@ mod.provider(My.Namespace);
|
||||
mod.service('name', ($scope: ng.IScope) => {});
|
||||
mod.service('name', ['$scope', ($scope: ng.IScope) => {}]);
|
||||
mod.service({
|
||||
MyCtrl: class{},
|
||||
MyCtrl: class {},
|
||||
MyCtrl2: () => {}, // tslint:disable-line:object-literal-shorthand
|
||||
MyCtrl3: ['$fooService', ($fooService: any) => {}]
|
||||
});
|
||||
@@ -491,9 +491,7 @@ namespace TestInjector {
|
||||
|
||||
// $injector.instantiate
|
||||
{
|
||||
class Foobar {
|
||||
constructor($q) {}
|
||||
}
|
||||
class Foobar {}
|
||||
const result: Foobar = $injector.instantiate(Foobar);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+7
-9
@@ -1089,7 +1089,7 @@ declare namespace angular {
|
||||
* Retrieves or overrides whether to generate an error when a rejected promise is not handled.
|
||||
* This feature is enabled by default.
|
||||
*
|
||||
* @returns {boolean} Current value
|
||||
* @returns Current value
|
||||
*/
|
||||
errorOnUnhandledRejections(): boolean;
|
||||
|
||||
@@ -1097,8 +1097,8 @@ declare namespace angular {
|
||||
* Retrieves or overrides whether to generate an error when a rejected promise is not handled.
|
||||
* This feature is enabled by default.
|
||||
*
|
||||
* @param {boolean} value Whether to generate an error when a rejected promise is not handled.
|
||||
* @returns {ng.IQProvider} Self for chaining otherwise.
|
||||
* @param value Whether to generate an error when a rejected promise is not handled.
|
||||
* @returns Self for chaining otherwise.
|
||||
*/
|
||||
errorOnUnhandledRejections(value: boolean): IQProvider;
|
||||
}
|
||||
@@ -1109,8 +1109,8 @@ declare namespace angular {
|
||||
* The successCallBack may return IPromise<never> for when a $q.reject() needs to be returned
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
then<TResult1, TResult2>(successCallback: (promiseValue: T) => IPromise<TResult1>|TResult2, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise<TResult1 | TResult2>;
|
||||
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
then<TResult1, TResult2>(successCallback: (promiseValue: T) => IPromise<TResult1>|TResult2, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise<TResult1 | TResult2>;
|
||||
|
||||
then<TResult, TCatch>(successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback: (reason: any) => IPromise<TCatch>|TCatch, notifyCallback?: (state: any) => any): IPromise<TResult | TCatch>;
|
||||
then<TResult1, TResult2, TCatch1, TCatch2>(successCallback: (promiseValue: T) => IPromise<TResult1>|TResult2, errorCallback: (reason: any) => IPromise<TCatch1>|TCatch2, notifyCallback?: (state: any) => any): IPromise<TResult1 | TResult2 | TCatch1 | TCatch2>;
|
||||
@@ -1639,9 +1639,8 @@ declare namespace angular {
|
||||
useApplyAsync(value: boolean): IHttpProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods.
|
||||
* @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.
|
||||
* @param value If true, `$http` will return a normal promise without the `success` and `error` methods.
|
||||
* @returns If a value is specified, returns the $httpProvider for chaining.
|
||||
* otherwise, returns the current configured value.
|
||||
*/
|
||||
useLegacyPromiseExtensions(value: boolean): boolean | IHttpProvider;
|
||||
@@ -1762,7 +1761,6 @@ declare namespace angular {
|
||||
(tpl: string, ignoreRequestError?: boolean): IPromise<string>;
|
||||
/**
|
||||
* total amount of pending template requests being downloaded.
|
||||
* @type {number}
|
||||
*/
|
||||
totalPendingRequests: number;
|
||||
}
|
||||
|
||||
Vendored
+1
-43
@@ -6,39 +6,23 @@
|
||||
|
||||
/**
|
||||
* Options for function `start`
|
||||
*
|
||||
* @export
|
||||
* @interface StartOptions
|
||||
*/
|
||||
export interface StartOptions {
|
||||
/**
|
||||
* Should annyang restart itself if it is closed indirectly, because of silence or window conflicts?
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
autoRestart?: boolean;
|
||||
/**
|
||||
* Allow forcing continuous mode on or off. Annyang is pretty smart about this, so only set this if you know what you're doing.
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
continuous?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A command option that supports custom regular expressions
|
||||
*
|
||||
* @export
|
||||
* @interface CommandOptionRegex
|
||||
*/
|
||||
export interface CommandOptionRegex {
|
||||
/**
|
||||
* @type {RegExp}
|
||||
*/
|
||||
regexp: RegExp;
|
||||
/**
|
||||
* @type {() => any}
|
||||
*/
|
||||
callback(): void;
|
||||
}
|
||||
|
||||
@@ -50,8 +34,6 @@ export interface CommandOptionRegex {
|
||||
* {'hello :name': helloFunction, 'howdy': helloFunction};
|
||||
* {'hi': helloFunction};
|
||||
* ````
|
||||
* @export
|
||||
* @interface CommandOption
|
||||
*/
|
||||
export interface CommandOption {
|
||||
[command: string]: CommandOptionRegex | (() => void);
|
||||
@@ -92,8 +74,6 @@ export interface Annyang {
|
||||
/**
|
||||
* Start listening.
|
||||
* It's a good idea to call this after adding some commands first, but not mandatory.
|
||||
*
|
||||
* @param {StartOptions} options
|
||||
*/
|
||||
start(options?: StartOptions): void;
|
||||
|
||||
@@ -119,15 +99,13 @@ export interface Annyang {
|
||||
/**
|
||||
* Turn on output of debug messages to the console. Ugly, but super-handy!
|
||||
*
|
||||
* @export
|
||||
* @param {boolean} [newState=true] Turn on/off debug messages
|
||||
* @param [newState=true] Turn on/off debug messages
|
||||
*/
|
||||
debug(newState?: boolean): void;
|
||||
|
||||
/**
|
||||
* Set the language the user will speak in. If this method is not called, defaults to 'en-US'.
|
||||
*
|
||||
* @param {string} lang
|
||||
* @see [Languages](https://github.com/TalAter/annyang/blob/master/docs/FAQ.md#what-languages-are-supported)
|
||||
*/
|
||||
setLanguage(lang: string): void;
|
||||
@@ -144,8 +122,6 @@ export interface Annyang {
|
||||
* annyang.addCommands(commands2);
|
||||
* // annyang will now listen to all three commands
|
||||
* ````
|
||||
*
|
||||
* @param {CommandOption} commands
|
||||
*/
|
||||
addCommands(commands: CommandOption): void;
|
||||
|
||||
@@ -161,7 +137,6 @@ export interface Annyang {
|
||||
* // Remove all existing commands
|
||||
* annyang.removeCommands();
|
||||
* ````
|
||||
* @param {string} command
|
||||
*/
|
||||
removeCommands(command?: string): void;
|
||||
|
||||
@@ -175,37 +150,22 @@ export interface Annyang {
|
||||
* // Don't respond to howdy or hi
|
||||
* annyang.removeCommands(['howdy', 'hi']);
|
||||
* ````
|
||||
*
|
||||
* @param {string[]} command
|
||||
*/
|
||||
removeCommands(command: string[]): void;
|
||||
|
||||
/**
|
||||
* @param {Events} event
|
||||
* @param {(userSaid : string, commandText : string, results : string[]) => void} callback
|
||||
* @param {*} [context]
|
||||
*/
|
||||
addCallback(event: Events, callback: (userSaid?: string, commandText?: string, results?: string[]) => void, context?: any): void;
|
||||
|
||||
/**
|
||||
* @param {Events} [event]
|
||||
* @param {Function} [callback]
|
||||
*/
|
||||
removeCallback(event?: Events, callback?: (userSaid: string, commandText: string, results: string[]) => void): void;
|
||||
|
||||
/**
|
||||
* Returns true if speech recognition is currently on.
|
||||
* Returns false if speech recognition is off or annyang is paused.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isListening(): boolean;
|
||||
|
||||
/**
|
||||
* Returns the instance of the browser's SpeechRecognition object used by annyang.
|
||||
* Useful in case you want direct access to the browser's Speech Recognition engine.
|
||||
*
|
||||
* @returns {*}
|
||||
*/
|
||||
getSpeechRecognizer(): any;
|
||||
|
||||
@@ -223,8 +183,6 @@ export interface Annyang {
|
||||
* ['Time for some thrilling heroics', 'Time for some thrilling aerobics']
|
||||
* );
|
||||
* ````
|
||||
*
|
||||
* @param {string} command
|
||||
*/
|
||||
trigger(command: string | string[]): void;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
"no-declare-current-package": false,
|
||||
"no-internal-module": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-qualifier": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { argon2 } from 'argon2-browser';
|
||||
|
||||
const mandatoryOptions = {
|
||||
pass: 'Qwerty12?',
|
||||
salt: 'Salty'
|
||||
};
|
||||
|
||||
(async () => {
|
||||
(await argon2.hash(mandatoryOptions)).encoded; // string
|
||||
(await argon2.hash(mandatoryOptions)).hash; // Uint8Array
|
||||
(await argon2.hash(mandatoryOptions)).hashHex; // string
|
||||
|
||||
(await argon2.hash({ ...mandatoryOptions, distPath: 'path' })).encoded; // string
|
||||
(await argon2.hash({ ...mandatoryOptions, hashLen: 24 })).encoded; // string
|
||||
(await argon2.hash({ ...mandatoryOptions, mem: 1024 })).encoded; // string
|
||||
(await argon2.hash({ ...mandatoryOptions, parallelism: 1 })).encoded; // string
|
||||
(await argon2.hash({ ...mandatoryOptions, time: 1 })).encoded; // string
|
||||
(await argon2.hash({ ...mandatoryOptions, type: argon2.ArgonType.Argon2d })).encoded; // string
|
||||
(await argon2.hash({ ...mandatoryOptions, type: argon2.ArgonType.Argon2i })).encoded; // string
|
||||
})();
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// Type definitions for argon2-browser 1.1
|
||||
// Project: https://github.com/antelle/argon2-browser#readme
|
||||
// Definitions by: Ivan Gabriele <https://github.com/ivangabriele>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export namespace argon2 {
|
||||
function hash(options: Argon2BrowserHashOptions): Promise<Argon2BrowserHashResult>;
|
||||
|
||||
interface Argon2BrowserHashOptions {
|
||||
distPath?: string;
|
||||
hashLen?: number;
|
||||
mem?: number;
|
||||
parallelism?: number;
|
||||
pass: string;
|
||||
salt: string;
|
||||
time?: number;
|
||||
type?: ArgonType;
|
||||
}
|
||||
|
||||
interface Argon2BrowserHashResult {
|
||||
encoded: string;
|
||||
hash: Uint8Array;
|
||||
hashHex: string;
|
||||
}
|
||||
|
||||
enum ArgonType {
|
||||
Argon2d = 0,
|
||||
Argon2i = 1
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"argon2-browser-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
-1
@@ -12,7 +12,6 @@
|
||||
* arrify(1) // returns [1]
|
||||
* @example
|
||||
* arrify([2, 3]) // returns [2, 3]
|
||||
* @param val
|
||||
*/
|
||||
declare function arrify<T>(val: undefined | null | T | T[]): T[];
|
||||
export = arrify;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { ScenarioContext, Next } from 'artillery';
|
||||
|
||||
const scenarioContext: ScenarioContext = {vars: {}};
|
||||
scenarioContext.vars = {};
|
||||
scenarioContext.vars.testing = "value";
|
||||
scenarioContext.vars.testing2 = 1;
|
||||
|
||||
const next: Next = (error?: Error) => {
|
||||
// do nothing.
|
||||
};
|
||||
|
||||
next();
|
||||
next(new Error());
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for artillery 1.6
|
||||
// Project: https://github.com/shoreditch-ops/artillery#readme
|
||||
// Definitions by: Kira McCoan <https://github.com/kmccoan-allocadia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
import * as request from 'request';
|
||||
import * as events from 'events';
|
||||
|
||||
export interface ScenarioContext { vars: {[key: string]: any}; }
|
||||
export type Next = (err?: Error) => void;
|
||||
export type ResponseRequest = request.ResponseRequest;
|
||||
export type RequestResponse = request.RequestResponse;
|
||||
export type EventEmitter = events.EventEmitter;
|
||||
@@ -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",
|
||||
"artillery-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+10
-48
@@ -249,14 +249,12 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Artyom can return inmediately the voices available in your browser.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/14/read-doc/artyom-getvoices/artyom-js
|
||||
* @returns {Array}
|
||||
*/
|
||||
getVoices(): SpeechSynthesisVoice[];
|
||||
|
||||
/**
|
||||
* Returns an array with all the available commands for artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/10/read-doc/artyom-getavailablecommands/artyom-js
|
||||
* @returns {Array}
|
||||
*/
|
||||
getAvailableCommands(): ArtyomCommand[];
|
||||
|
||||
@@ -264,38 +262,30 @@ declare namespace Artyom {
|
||||
* Set up artyom for the application. This function will set the default language used by artyom
|
||||
* or notice the user if artyom is not supported in the actual browser.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/15/read-doc/artyom-initialize/artyom-js
|
||||
* @param {ArtyomConfigProperties} config
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
initialize(config: ArtyomConfigProperties): boolean;
|
||||
|
||||
/**
|
||||
* Force artyom to stop listen even if is in continuos mode.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/9/read-doc/artyom-fatality/artyom-js
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
fatality(): boolean;
|
||||
|
||||
/**
|
||||
* Add dinamically commands to artyom using. You can even add commands while artyom is active.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/4/read-doc/artyom-addcommands/artyom-js
|
||||
* @param {ArtyomCommand | Array[ArtyomCommand]} newCommand
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
addCommands(newCommand: ArtyomCommand | ArtyomCommand[]): boolean;
|
||||
|
||||
/**
|
||||
* Remove the commands of artyom with indexes that matches with the given text.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/19/read-doc/artyom-removecommands/artyom-js
|
||||
* @param {string} identifier
|
||||
* @returns {Array}
|
||||
*/
|
||||
removeCommands(identifier: string): number[];
|
||||
|
||||
/**
|
||||
* Removes all the added commands of artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/7/read-doc/artyom-emptycommands/artyom-js
|
||||
* @returns {Array}
|
||||
*/
|
||||
emptyCommands(): ArtyomCommand[];
|
||||
|
||||
@@ -308,7 +298,6 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Returns an object with the actual properties of artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/12/read-doc/artyom-getproperties/artyom-js
|
||||
* @returns {ArtyomConfigProperties}
|
||||
*/
|
||||
getProperties(): ArtyomConfigProperties;
|
||||
|
||||
@@ -321,37 +310,34 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Returns the code language of artyom according to initialize function.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/11/read-doc/artyom-getlanguage/artyom-js
|
||||
* @returns {String} Language
|
||||
* @returns Language
|
||||
*/
|
||||
getLanguage(): string;
|
||||
|
||||
/**
|
||||
* Talks a text according to the given parameters (private function).
|
||||
* @param {String} text Text to be spoken
|
||||
* @param {Int} actualChunk Number of chunk of the
|
||||
* @param {Int} totalChunks
|
||||
* @param {any} callbacks
|
||||
* @param text Text to be spoken
|
||||
* @param actualChunk Number of chunk of the
|
||||
*/
|
||||
artyomTalk(text: any, actualChunk: any, totalChunks: any, callbacks: any): any;
|
||||
|
||||
/**
|
||||
* Splits a string into an array of strings with a limited size (chunk_length).
|
||||
* @param {String} input text to split into chunks
|
||||
* @param {Integer} chunk_length limit of characters in every chunk
|
||||
* @param input text to split into chunks
|
||||
* @param chunk_length limit of characters in every chunk
|
||||
*/
|
||||
splitStringByChunks(input: any, chunk_length: any): string[];
|
||||
|
||||
/**
|
||||
* Process the given text into chunks and execute the private function artyom_talk.
|
||||
* @param {String} message Text to be spoken
|
||||
* @param {Object} callbacks { onStart, onEnd }
|
||||
* @param message Text to be spoken
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/20/read-doc/artyom-say/artyom-js
|
||||
*/
|
||||
say(message: any, callbacks: any): void;
|
||||
|
||||
/**
|
||||
* Repeats the last sentence that artyom said. Useful in noisy environments.
|
||||
* @param {Boolean} returnObject If set to true, an object with the text and the timestamp when was executed will be returned.
|
||||
* @param returnObject If set to true, an object with the text and the timestamp when was executed will be returned.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/25/read-doc/artyom-repeatlastsay/artyom-js
|
||||
*/
|
||||
repeatLastSay(returnObject: any): void;
|
||||
@@ -359,50 +345,42 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Verify if the browser supports speechSynthesis.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/40/read-doc/artyom-speechsupported/artyom-js
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
speechSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Verify if the browser supports webkitSpeechRecognition.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/39/read-doc/artyom-recognizingsupported/artyom-js
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
recognizingSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Simulate a voice command via JS.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/22/read-doc/artyom-simulateinstruction/artyom-js
|
||||
* @param {string} sentence
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
simulateInstruction(sentence: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns an object with data of the matched element.
|
||||
* @param {string} voiceCommand
|
||||
* @returns {Object | Function}. There is a result field when the function should return a boolean value.
|
||||
* @returns . There is a result field when the function should return a boolean value.
|
||||
*/
|
||||
artyomExecute(voiceCommand: string): any;
|
||||
|
||||
/**
|
||||
* Displays a message in the console if the artyom propery DEBUG is set to true.
|
||||
* @param {string} error The error to be debugged
|
||||
* @param {string} traceLevel Error level: { error | warn | info }
|
||||
* @param error The error to be debugged
|
||||
* @param traceLevel Error level: { error | warn | info }
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/38/read-doc/artyom-debug/artyom-js
|
||||
*/
|
||||
debug(stringEvent: string, traceLevel: string): void;
|
||||
|
||||
/**
|
||||
* Allows to retrieve the recognized spoken text of artyom and do something with it everytime something is recognized.
|
||||
* @param {Function} action
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
redirectRecognizedTextOutput(action: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Says a random quote and returns it's object.
|
||||
* @param data
|
||||
*/
|
||||
sayRandom(data: any): any;
|
||||
|
||||
@@ -431,7 +409,6 @@ declare namespace Artyom {
|
||||
* This function returns a boolean according to the SpeechRecognition status if artyom is listening, will return true.
|
||||
* Note: This is not a feature of SpeechRecognition, therefore this value hangs on the fiability of the onStart and onEnd
|
||||
* events of the SpeechRecognition
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isRecognizing(): boolean;
|
||||
|
||||
@@ -439,14 +416,12 @@ declare namespace Artyom {
|
||||
* This function returns a boolean according to the speechSynthesis status if artyom is speaking, will return true.
|
||||
* Note: This is not a feature of speechSynthesis, therefore this value hangs on the fiability of the onStart and onEnd
|
||||
* events of the speechSynthesis.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isSpeaking(): boolean;
|
||||
|
||||
/**
|
||||
* The SpeechSynthesisUtterance objects are stored in the artyom_garbage_collector variable to prevent the wrong behaviour
|
||||
* of artyom.say. Use this method to clear all spoken SpeechSynthesisUtterance unused objects.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
clearGarbageCollection(): any;
|
||||
|
||||
@@ -457,31 +432,26 @@ declare namespace Artyom {
|
||||
|
||||
/**
|
||||
* Pause the processing of commands. Artyom still listening in the background and it can be resumed after a couple of seconds.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
dontObey(): any;
|
||||
|
||||
/**
|
||||
* Allow artyom to obey commands again.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
obey(): any;
|
||||
|
||||
/**
|
||||
* A boolean to check if artyom is obeying commands or not.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isObeying(): boolean;
|
||||
|
||||
/**
|
||||
* Process the recognized text if artyom is active in remote mode.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
remoteProcessorService(action: any): any;
|
||||
|
||||
/**
|
||||
* Returns a string with the actual version of Artyom script.
|
||||
* @returns {String}
|
||||
*/
|
||||
getVersion(): string;
|
||||
|
||||
@@ -490,22 +460,14 @@ declare namespace Artyom {
|
||||
* tasks then probably you don't like to write a lot to achieve it.
|
||||
* Use the artisan syntax to write less, but with the same accuracy.
|
||||
* @disclaimer Not a promise-based implementation, just syntax.
|
||||
* @returns {Object}
|
||||
*/
|
||||
on(indexes: any, smart: any): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* ArtyomBuilder bla, bla...
|
||||
*/
|
||||
class ArtyomBuilder {
|
||||
/**
|
||||
* Method to bla, bla, bla...
|
||||
*/
|
||||
static getInstance(): ArtyomJS;
|
||||
}
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:export-just-namespace
|
||||
export = Artyom;
|
||||
export as namespace Artyom;
|
||||
|
||||
@@ -1 +1,8 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODOs
|
||||
"export-just-namespace": false,
|
||||
"no-unnecessary-class": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -28,7 +28,7 @@ interface ascii2mathml {
|
||||
|
||||
/**
|
||||
* Converts ASCIIMath expression to MathML markup.
|
||||
* @param asciimath {string} ASCIIMath expression
|
||||
* @param asciimath ASCIIMath expression
|
||||
* @param options Options
|
||||
*/
|
||||
(asciimath: string, options?: Options): string;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"no-void-expression": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-const": false,
|
||||
|
||||
@@ -19,3 +19,19 @@ Many of the types used by Atom Keymap can be referenced from the AtomKeymap name
|
||||
```ts
|
||||
function example(keybind: AtomKeymap.KeyBinding) {}
|
||||
```
|
||||
|
||||
### Exposing Private Methods and Properties
|
||||
|
||||
[Declaration Merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to augment any of the types used within Atom Keymap. As an example, if we wanted to reveal the private ```partialMatchTimeout``` property within the KeymapManager class, then we would create a file with the following contents:
|
||||
|
||||
```ts
|
||||
// <<filename>>.d.ts
|
||||
|
||||
declare namespace AtomKeymap {
|
||||
interface KeymapManager {
|
||||
partialMatchTimeout: number;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Once this file is either referenced or included within your project, then this new property would be freely usable on instances of the KeymapManager class without TypeScript reporting errors.
|
||||
|
||||
@@ -11,17 +11,17 @@ keymaps.defaultTarget = document.body;
|
||||
|
||||
// Pass all the window's keydown events to the KeymapManager
|
||||
document.addEventListener("keydown", (event): void => {
|
||||
keymaps.handleKeyboardEvent(event);
|
||||
keymaps.handleKeyboardEvent(event);
|
||||
});
|
||||
|
||||
// Add some keymaps. It can also be a directory of json / cson files.
|
||||
keymaps.loadKeymap("/path/to/keymap-file.json");
|
||||
// OR
|
||||
keymaps.add("/key/for/these/keymaps", {
|
||||
body: {
|
||||
up: "core:move-up",
|
||||
down: "core:move-down",
|
||||
},
|
||||
body: {
|
||||
up: "core:move-up",
|
||||
down: "core:move-down",
|
||||
},
|
||||
});
|
||||
|
||||
// When a keybinding is triggered, it will dispatch it on the node that was focused
|
||||
@@ -31,17 +31,17 @@ window.addEventListener("core:move-down", (event) => console.log("down", event))
|
||||
// General Usage ==============================================================
|
||||
const manager = new KeymapManager();
|
||||
manager.add("some/unique/path", {
|
||||
".workspace": {
|
||||
"ctrl-x": "package:do-something",
|
||||
"ctrl-y": "package:do-something-else",
|
||||
},
|
||||
".test": {
|
||||
enter: "core:confirm",
|
||||
},
|
||||
".workspace": {
|
||||
"ctrl-x": "package:do-something",
|
||||
"ctrl-y": "package:do-something-else",
|
||||
},
|
||||
".test": {
|
||||
enter: "core:confirm",
|
||||
},
|
||||
});
|
||||
|
||||
manager.onDidMatchBinding((event): void => {
|
||||
console.log(event.binding.command);
|
||||
console.log(event.binding.command);
|
||||
});
|
||||
|
||||
manager.destroy();
|
||||
@@ -84,8 +84,8 @@ manager.handleKeyboardEvent(event);
|
||||
manager.keystrokeForKeyboardEvent(event);
|
||||
|
||||
sub = manager.addKeystrokeResolver((event): string => {
|
||||
event.layoutName;
|
||||
return "Test";
|
||||
event.layoutName;
|
||||
return "Test";
|
||||
});
|
||||
|
||||
const num: number = manager.getPartialMatchTimeout();
|
||||
|
||||
Vendored
+179
-181
@@ -7,230 +7,228 @@
|
||||
/// <reference types="event-kit" />
|
||||
|
||||
declare global {
|
||||
namespace AtomKeymap {
|
||||
/** Objects that appear as parameters to callbacks. */
|
||||
namespace Events {
|
||||
interface FullKeybindingMatch {
|
||||
/** The string of keystrokes that matched the binding. */
|
||||
keystrokes: string;
|
||||
namespace AtomKeymap {
|
||||
/** The event objects that are passed into the callbacks which the user provides to
|
||||
* specific API calls.
|
||||
*/
|
||||
namespace Events {
|
||||
/** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding
|
||||
* method, as well as versions of the ::stopPropagation methods that record the
|
||||
* intent to stop propagation so event bubbling can be properly simulated for
|
||||
* detached elements.
|
||||
*/
|
||||
interface CommandEvent extends CustomEvent {
|
||||
keyBindingAborted: boolean;
|
||||
propagationStopped: boolean;
|
||||
|
||||
/** The KeyBinding that the keystrokes matched. */
|
||||
binding: KeyBinding;
|
||||
abortKeyBinding(): void;
|
||||
stopPropagation(): CustomEvent;
|
||||
stopImmediatePropagation(): CustomEvent;
|
||||
}
|
||||
|
||||
/** The DOM element that was the target of the most recent keyboard event. */
|
||||
keyboardEventTarget: Element;
|
||||
}
|
||||
interface FullKeybindingMatch {
|
||||
/** The string of keystrokes that matched the binding. */
|
||||
keystrokes: string;
|
||||
|
||||
interface PartialKeybindingMatch {
|
||||
/** The string of keystrokes that matched the binding. */
|
||||
keystrokes: string;
|
||||
/** The KeyBinding that the keystrokes matched. */
|
||||
binding: KeyBinding;
|
||||
|
||||
/** The KeyBindings that the keystrokes partially matched. */
|
||||
partiallyMatchedBindings: KeyBinding[];
|
||||
/** The DOM element that was the target of the most recent keyboard event. */
|
||||
keyboardEventTarget: Element;
|
||||
}
|
||||
|
||||
/** DOM element that was the target of the most recent keyboard event. */
|
||||
keyboardEventTarget: Element;
|
||||
}
|
||||
interface PartialKeybindingMatch {
|
||||
/** The string of keystrokes that matched the binding. */
|
||||
keystrokes: string;
|
||||
|
||||
interface FailedKeybindingMatch {
|
||||
/** The string of keystrokes that failed to match the binding. */
|
||||
keystrokes: string;
|
||||
/** The KeyBindings that the keystrokes partially matched. */
|
||||
partiallyMatchedBindings: KeyBinding[];
|
||||
|
||||
/** The DOM element that was the target of the most recent keyboard event. */
|
||||
keyboardEventTarget: Element;
|
||||
}
|
||||
/** DOM element that was the target of the most recent keyboard event. */
|
||||
keyboardEventTarget: Element;
|
||||
}
|
||||
|
||||
interface FailedKeymapFileRead {
|
||||
/** The error message. */
|
||||
message: string;
|
||||
interface FailedKeybindingMatch {
|
||||
/** The string of keystrokes that failed to match the binding. */
|
||||
keystrokes: string;
|
||||
|
||||
/** The error stack trace. */
|
||||
stack: string;
|
||||
}
|
||||
/** The DOM element that was the target of the most recent keyboard event. */
|
||||
keyboardEventTarget: Element;
|
||||
}
|
||||
|
||||
interface KeymapLoaded {
|
||||
/** The path of the keymap file. */
|
||||
path: string;
|
||||
}
|
||||
interface FailedKeymapFileRead {
|
||||
/** The error message. */
|
||||
message: string;
|
||||
|
||||
interface AddedKeystrokeResolver {
|
||||
/** The currently resolved keystroke string. If your function returns a falsy
|
||||
* value, this is how Atom will resolve your keystroke.
|
||||
*/
|
||||
keystroke: string;
|
||||
/** The error stack trace. */
|
||||
stack: string;
|
||||
}
|
||||
|
||||
/** The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation
|
||||
* for more details.
|
||||
*/
|
||||
event: KeyboardEvent;
|
||||
interface KeymapLoaded {
|
||||
/** The path of the keymap file. */
|
||||
path: string;
|
||||
}
|
||||
|
||||
/** The OS-specific name of the current keyboard layout. */
|
||||
layoutName: string;
|
||||
interface AddedKeystrokeResolver {
|
||||
/** The currently resolved keystroke string. If your function returns a falsy
|
||||
* value, this is how Atom will resolve your keystroke.
|
||||
*/
|
||||
keystroke: string;
|
||||
|
||||
/** An object mapping DOM 3 `KeyboardEvent.code` values to objects with the
|
||||
* typed character for that key in each modifier state, based on the current
|
||||
* operating system layout.
|
||||
*/
|
||||
keymap: object;
|
||||
}
|
||||
}
|
||||
/** The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation
|
||||
* for more details.
|
||||
*/
|
||||
event: KeyboardEvent;
|
||||
|
||||
/** Objects that appear as parameters to functions. */
|
||||
namespace Options {
|
||||
interface BuildKeyEvent {
|
||||
ctrl?: boolean;
|
||||
alt?: boolean;
|
||||
shift?: boolean;
|
||||
cmd?: boolean;
|
||||
which?: number;
|
||||
target?: Element;
|
||||
}
|
||||
}
|
||||
/** The OS-specific name of the current keyboard layout. */
|
||||
layoutName: string;
|
||||
|
||||
/** The static side to each exported class. Should generally only be used internally. */
|
||||
namespace Statics {
|
||||
/* tslint:disable:no-unnecessary-qualifier */
|
||||
/** The static side to the KeymapManager class. */
|
||||
interface KeymapManager {
|
||||
/** Create a keydown DOM event. */
|
||||
buildKeydownEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void;
|
||||
/** An object mapping DOM 3 `KeyboardEvent.code` values to objects with the
|
||||
* typed character for that key in each modifier state, based on the current
|
||||
* operating system layout.
|
||||
*/
|
||||
keymap: object;
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a keyup DOM event. */
|
||||
buildKeyupEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void;
|
||||
/** The option objects that the user is expected to fill out and provide to
|
||||
* specific API calls.
|
||||
*/
|
||||
namespace Options {
|
||||
interface BuildKeyEvent {
|
||||
ctrl?: boolean;
|
||||
alt?: boolean;
|
||||
shift?: boolean;
|
||||
cmd?: boolean;
|
||||
which?: number;
|
||||
target?: Element;
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a new KeymapManager. */
|
||||
new (options?: { defaultTarget?: HTMLElement }): AtomKeymap.KeymapManager;
|
||||
}
|
||||
/* tslint:enable:no-unnecessary-qualifier */
|
||||
}
|
||||
interface KeyBinding {
|
||||
// Properties
|
||||
enabled: boolean;
|
||||
source: string;
|
||||
command: string;
|
||||
keystrokes: string;
|
||||
keystrokeArray: string[];
|
||||
keystrokeCount: number;
|
||||
selector: string;
|
||||
specificity: number;
|
||||
|
||||
/** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding
|
||||
* method, as well as versions of the ::stopPropagation methods that record the
|
||||
* intent to stop propagation so event bubbling can be properly simulated for
|
||||
* detached elements.
|
||||
*/
|
||||
interface CommandEvent extends CustomEvent {
|
||||
keyBindingAborted: boolean;
|
||||
propagationStopped: boolean;
|
||||
// Comparison
|
||||
/** Determines whether the given keystroke matches any contained within this binding. */
|
||||
matches(keystroke: string): boolean;
|
||||
|
||||
abortKeyBinding(): void;
|
||||
stopPropagation(): CustomEvent;
|
||||
stopImmediatePropagation(): CustomEvent;
|
||||
}
|
||||
/** Compare another KeyBinding to this instance.
|
||||
* Returns <= -1 if the argument is considered lesser or of lower priority.
|
||||
* Returns 0 if this binding is equivalent to the argument.
|
||||
* Returns >= 1 if the argument is considered greater or of higher priority.
|
||||
*/
|
||||
compare(other: KeyBinding): number;
|
||||
}
|
||||
|
||||
interface KeyBinding {
|
||||
// Properties
|
||||
enabled: boolean;
|
||||
source: string;
|
||||
command: string;
|
||||
keystrokes: string;
|
||||
keystrokeArray: string[];
|
||||
keystrokeCount: number;
|
||||
selector: string;
|
||||
specificity: number;
|
||||
/** Allows commands to be associated with keystrokes in a context-sensitive way.
|
||||
* In Atom, you can access a global instance of this object via `atom.keymaps`.
|
||||
*/
|
||||
interface KeymapManager {
|
||||
defaultTarget: HTMLElement;
|
||||
|
||||
// Comparison
|
||||
/** Determines whether the given keystroke matches any contained within this binding. */
|
||||
matches(keystroke: string): boolean;
|
||||
partialMatchTimeout: number;
|
||||
|
||||
/** Compare another KeyBinding to this instance.
|
||||
* Returns <= -1 if the argument is considered lesser or of lower priority.
|
||||
* Returns 0 if this binding is equivalent to the argument.
|
||||
* Returns >= 1 if the argument is considered greater or of higher priority.
|
||||
*/
|
||||
compare(other: KeyBinding): number;
|
||||
}
|
||||
/** Clear all registered key bindings and enqueued keystrokes. For use in tests. */
|
||||
clear(): void;
|
||||
|
||||
/** Allows commands to be associated with keystrokes in a context-sensitive way.
|
||||
* In Atom, you can access a global instance of this object via `atom.keymaps`.
|
||||
*/
|
||||
/** Instance side of KeymapManager class. */
|
||||
interface KeymapManager {
|
||||
defaultTarget: HTMLElement;
|
||||
/** Unwatch all watched paths. */
|
||||
destroy(): void;
|
||||
|
||||
partialMatchTimeout: number;
|
||||
// Event Subscription
|
||||
/** Invoke the given callback when one or more keystrokes completely match a key binding. */
|
||||
onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void):
|
||||
EventKit.Disposable;
|
||||
|
||||
/** Clear all registered key bindings and enqueued keystrokes. For use in tests. */
|
||||
clear(): void;
|
||||
/** Invoke the given callback when one or more keystrokes partially match a binding. */
|
||||
onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) =>
|
||||
void): EventKit.Disposable;
|
||||
|
||||
/** Unwatch all watched paths. */
|
||||
destroy(): void;
|
||||
/** Invoke the given callback when one or more keystrokes fail to match any bindings. */
|
||||
onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) =>
|
||||
void): EventKit.Disposable;
|
||||
|
||||
// Event Subscription
|
||||
/** Invoke the given callback when one or more keystrokes completely match a key binding. */
|
||||
onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void):
|
||||
EventKit.Disposable;
|
||||
/** Invoke the given callback when a keymap file is reloaded. */
|
||||
onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void):
|
||||
EventKit.Disposable;
|
||||
|
||||
/** Invoke the given callback when one or more keystrokes partially match a binding. */
|
||||
onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) =>
|
||||
void): EventKit.Disposable;
|
||||
/** Invoke the given callback when a keymap file is unloaded. */
|
||||
onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void):
|
||||
EventKit.Disposable;
|
||||
|
||||
/** Invoke the given callback when one or more keystrokes fail to match any bindings. */
|
||||
onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) =>
|
||||
void): EventKit.Disposable;
|
||||
/** Invoke the given callback when a keymap file not able to be loaded. */
|
||||
onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void):
|
||||
EventKit.Disposable;
|
||||
|
||||
/** Invoke the given callback when a keymap file is reloaded. */
|
||||
onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void):
|
||||
EventKit.Disposable;
|
||||
// Adding and Removing Bindings
|
||||
/** Construct KeyBindings from an object grouping them by CSS selector. */
|
||||
build(source: string, bindings: { [key: string]: { [key: string]: string }},
|
||||
priority?: number): KeyBinding[];
|
||||
|
||||
/** Invoke the given callback when a keymap file is unloaded. */
|
||||
onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void):
|
||||
EventKit.Disposable;
|
||||
/** Add sets of key bindings grouped by CSS selector. */
|
||||
add(source: string, bindings: { [key: string]: { [key: string]: string }},
|
||||
priority?: number): EventKit.Disposable;
|
||||
|
||||
/** Invoke the given callback when a keymap file not able to be loaded. */
|
||||
onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void):
|
||||
EventKit.Disposable;
|
||||
// Accessing Bindings
|
||||
/** Get all current key bindings. */
|
||||
getKeyBindings(): KeyBinding[];
|
||||
|
||||
// Adding and Removing Bindings
|
||||
/** Construct KeyBindings from an object grouping them by CSS selector. */
|
||||
build(source: string, bindings: { [key: string]: { [key: string]: string }},
|
||||
priority?: number): KeyBinding[];
|
||||
/** Get the key bindings for a given command and optional target. */
|
||||
findKeyBindings(params?: {
|
||||
keystrokes?: string, // e.g. 'ctrl-x ctrl-s'
|
||||
command?: string, // e.g. 'editor:backspace'
|
||||
target?: Element,
|
||||
}): KeyBinding[];
|
||||
|
||||
/** Add sets of key bindings grouped by CSS selector. */
|
||||
add(source: string, bindings: { [key: string]: { [key: string]: string }},
|
||||
priority?: number): EventKit.Disposable;
|
||||
// Managing Keymap Files
|
||||
/** Load the key bindings from the given path. */
|
||||
loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }):
|
||||
void;
|
||||
|
||||
// Accessing Bindings
|
||||
/** Get all current key bindings. */
|
||||
getKeyBindings(): KeyBinding[];
|
||||
/** Cause the keymap to reload the key bindings file at the given path whenever
|
||||
* it changes.
|
||||
*/
|
||||
watchKeymap(filePath: string, options?: { priority: number }): void;
|
||||
|
||||
/** Get the key bindings for a given command and optional target. */
|
||||
findKeyBindings(params?: {
|
||||
keystrokes?: string, // e.g. 'ctrl-x ctrl-s'
|
||||
command?: string, // e.g. 'editor:backspace'
|
||||
target?: Element,
|
||||
}): KeyBinding[];
|
||||
// Managing Keyboard Events
|
||||
/** Dispatch a custom event associated with the matching key binding for the
|
||||
* given `KeyboardEvent` if one can be found.
|
||||
*/
|
||||
handleKeyboardEvent(event: KeyboardEvent): void;
|
||||
|
||||
// Managing Keymap Files
|
||||
/** Load the key bindings from the given path. */
|
||||
loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }):
|
||||
void;
|
||||
/** Translates a keydown event to a keystroke string. */
|
||||
keystrokeForKeyboardEvent(event: KeyboardEvent): string;
|
||||
|
||||
/** Cause the keymap to reload the key bindings file at the given path whenever
|
||||
* it changes.
|
||||
*/
|
||||
watchKeymap(filePath: string, options?: { priority: number }): void;
|
||||
/** Customize translation of raw keyboard events to keystroke strings. */
|
||||
addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string):
|
||||
EventKit.Disposable;
|
||||
|
||||
// Managing Keyboard Events
|
||||
/** Dispatch a custom event associated with the matching key binding for the
|
||||
* given `KeyboardEvent` if one can be found.
|
||||
*/
|
||||
handleKeyboardEvent(event: KeyboardEvent): void;
|
||||
/** Get the number of milliseconds allowed before pending states caused by
|
||||
* partial matches of multi-keystroke bindings are terminated.
|
||||
*/
|
||||
getPartialMatchTimeout(): number;
|
||||
}
|
||||
|
||||
/** Translates a keydown event to a keystroke string. */
|
||||
keystrokeForKeyboardEvent(event: KeyboardEvent): string;
|
||||
/** The static side to the KeymapManager class. */
|
||||
interface KeymapManagerStatic {
|
||||
/** Create a keydown DOM event. */
|
||||
buildKeydownEvent(key: string, options?: Options.BuildKeyEvent): void;
|
||||
|
||||
/** Customize translation of raw keyboard events to keystroke strings. */
|
||||
addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string):
|
||||
EventKit.Disposable;
|
||||
/** Create a keyup DOM event. */
|
||||
buildKeyupEvent(key: string, options?: Options.BuildKeyEvent): void;
|
||||
|
||||
/** Get the number of milliseconds allowed before pending states caused by
|
||||
* partial matches of multi-keystroke bindings are terminated.
|
||||
*/
|
||||
getPartialMatchTimeout(): number;
|
||||
}
|
||||
}
|
||||
/** Create a new KeymapManager. */
|
||||
new (options?: { defaultTarget?: HTMLElement }): KeymapManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare const KeymapManager: AtomKeymap.Statics.KeymapManager;
|
||||
declare const KeymapManager: AtomKeymap.KeymapManagerStatic;
|
||||
export = KeymapManager;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// Custom rules.
|
||||
"class-name": true,
|
||||
"indent": [true, "tabs"],
|
||||
"indent": [true, "spaces", 4],
|
||||
"jsdoc-format": true,
|
||||
"max-line-length": [true, 100],
|
||||
"max-line-length": [true, 110],
|
||||
"quotemark": [true, "double", "avoid-escape"],
|
||||
"trailing-comma": [true, {
|
||||
"multiline": { "objects": "always", "arrays": "always", "functions": "never" },
|
||||
|
||||
@@ -2,37 +2,37 @@ import { createRunner } from "atom-mocha-test-runner";
|
||||
import defaultMochaRunner = require("atom-mocha-test-runner");
|
||||
|
||||
const extraOptions = {
|
||||
testSuffixes: ["-spec.js", "-spec.coffee"],
|
||||
testSuffixes: ["-spec.js", "-spec.coffee"],
|
||||
};
|
||||
|
||||
function mochaSetup(mocha: Mocha) {
|
||||
mocha.addFile("test.file");
|
||||
mocha.addFile("test.file");
|
||||
}
|
||||
|
||||
let testRunner = createRunner();
|
||||
testRunner = createRunner(extraOptions);
|
||||
testRunner = createRunner(extraOptions, mochaSetup);
|
||||
testRunner = createRunner({
|
||||
colors: true,
|
||||
globalAtom: true,
|
||||
htmlTitle: "Test Title",
|
||||
reporter: "dot",
|
||||
testSuffixes: ["test.file"],
|
||||
colors: true,
|
||||
globalAtom: true,
|
||||
htmlTitle: "Test Title",
|
||||
reporter: "dot",
|
||||
testSuffixes: ["test.file"],
|
||||
});
|
||||
|
||||
declare const atom: Atom.AtomEnvironment;
|
||||
declare const atom: AtomCore.AtomEnvironment;
|
||||
declare const blob: object;
|
||||
declare let num: number;
|
||||
|
||||
async function runTests(): Promise<number> {
|
||||
const runnerArgs: Atom.Structures.TestRunnerArgs = {
|
||||
testPaths: ["/var/test"],
|
||||
logFile: "/var/log",
|
||||
headless: false,
|
||||
buildDefaultApplicationDelegate: () => blob,
|
||||
buildAtomEnvironment: () => atom,
|
||||
};
|
||||
const runnerArgs: AtomCore.Structures.TestRunnerArgs = {
|
||||
testPaths: ["/var/test"],
|
||||
logFile: "/var/log",
|
||||
headless: false,
|
||||
buildDefaultApplicationDelegate: () => blob,
|
||||
buildAtomEnvironment: () => atom,
|
||||
};
|
||||
|
||||
num = await defaultMochaRunner(runnerArgs);
|
||||
return await testRunner(runnerArgs);
|
||||
num = await defaultMochaRunner(runnerArgs);
|
||||
return testRunner(runnerArgs);
|
||||
}
|
||||
|
||||
+13
-13
@@ -4,24 +4,24 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="atom" />
|
||||
/// <reference types="mocha" />
|
||||
/// <reference types="atom" />
|
||||
|
||||
interface AtomMochaOptions {
|
||||
/** Which reporter to use on the terminal. */
|
||||
reporter?: string;
|
||||
/** Which reporter to use on the terminal. */
|
||||
reporter?: string;
|
||||
|
||||
/** Whether or not to assign the created Atom environment to `global.atom`. */
|
||||
globalAtom?: boolean;
|
||||
/** Whether or not to assign the created Atom environment to `global.atom`. */
|
||||
globalAtom?: boolean;
|
||||
|
||||
/** File extensions that indicate that the file contains tests. */
|
||||
testSuffixes?: string[];
|
||||
/** File extensions that indicate that the file contains tests. */
|
||||
testSuffixes?: string[];
|
||||
|
||||
/** Whether or not to colorize output on the terminal. */
|
||||
colors?: boolean;
|
||||
/** Whether or not to colorize output on the terminal. */
|
||||
colors?: boolean;
|
||||
|
||||
/** The string to use for the window title in the HTML reporter. */
|
||||
htmlTitle?: string;
|
||||
/** The string to use for the window title in the HTML reporter. */
|
||||
htmlTitle?: string;
|
||||
}
|
||||
|
||||
// The test runner function is augmented on export by:
|
||||
@@ -31,8 +31,8 @@ interface AtomMochaOptions {
|
||||
// module.exports.createRunner = createRunner
|
||||
// Which is what we're trying to model here.
|
||||
interface TestRunnerExport extends AtomCore.TestRunner {
|
||||
createRunner(options?: AtomMochaOptions, mochaConfigFunction?:
|
||||
(mocha: Mocha) => void): AtomCore.TestRunner;
|
||||
createRunner(options?: AtomMochaOptions, mochaConfigFunction?:
|
||||
(mocha: Mocha) => void): AtomCore.TestRunner;
|
||||
}
|
||||
|
||||
declare const runner: TestRunnerExport;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// Custom rules.
|
||||
"class-name": true,
|
||||
"indent": [true, "tabs"],
|
||||
"indent": [true, "spaces", 4],
|
||||
"jsdoc-format": true,
|
||||
"max-line-length": [true, 100],
|
||||
"quotemark": [true, "double", "avoid-escape"],
|
||||
|
||||
+23
-5
@@ -30,13 +30,31 @@ function example(cursor: AtomCore.Cursor) {}
|
||||
|
||||
### Service Type Definitions
|
||||
|
||||
There are many services provided by other Atom packages that you may want to use within your own Atom package. We bundle type definitions for several of these services with these type definitions.
|
||||
There are many services provided by other Atom packages that you may want to use within your own Atom package. We bundle type definitions for several of these services with these type definitions. All type definitions for services are available only through ES6 imports.
|
||||
|
||||
```ts
|
||||
/// <reference types="atom/services" />
|
||||
let completionProvider: Atom.Services.Autocomplete.Provider;
|
||||
import { AutocompleteProvider } from "atom/autocomplete-plus";
|
||||
let completionProvider: AutocompleteProvider;
|
||||
```
|
||||
|
||||
The currently supported services are:
|
||||
- [Autocomplete](https://github.com/atom/autocomplete-plus)
|
||||
- [Status Bar](https://github.com/atom/status-bar)
|
||||
- [Autocomplete](https://github.com/atom/autocomplete-plus) (atom/autocomplete-plus)
|
||||
- [Linter](https://github.com/atom/linter) (atom/linter)
|
||||
- [Status Bar](https://github.com/atom/status-bar) (atom/status-bar)
|
||||
|
||||
### Exposing Private Methods and Properties
|
||||
|
||||
[Declaration Merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to augment any of the types used within Atom. As an example, if we wanted to reveal the private ```triggerActivationHook``` method within the PackageManager class, then we would create a file with the following contents:
|
||||
|
||||
```ts
|
||||
// <<filename>>.d.ts
|
||||
|
||||
declare namespace AtomCore {
|
||||
interface PackageManager {
|
||||
triggerActivationHook(name: string): void;
|
||||
triggerDeferredActivationHooks(): void;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Once this file is either referenced or included within your project, then this new member function would be freely usable on instances of the PackageManager class without TypeScript reporting errors.
|
||||
|
||||
+3059
-2014
File diff suppressed because it is too large
Load Diff
Vendored
+137
@@ -0,0 +1,137 @@
|
||||
// Autocomplete Plus 2.x
|
||||
// https://atom.io/packages/autocomplete-plus
|
||||
|
||||
/** The parameters passed into getSuggestions by Autocomplete+. */
|
||||
export interface SuggestionsRequestedEvent {
|
||||
/** The current TextEditor. */
|
||||
editor: AtomCore.TextEditor;
|
||||
|
||||
/** The position of the cursor. */
|
||||
bufferPosition: TextBuffer.Point;
|
||||
|
||||
/** The scope descriptor for the current cursor position. */
|
||||
scopeDescriptor: AtomCore.ScopeDescriptor;
|
||||
|
||||
/** The prefix for the word immediately preceding the current cursor position. */
|
||||
prefix: string;
|
||||
|
||||
/** Whether the autocomplete request was initiated by the user. */
|
||||
activatedManually: boolean;
|
||||
}
|
||||
|
||||
/** The parameters passed into onDidInsertSuggestion by Autocomplete+. */
|
||||
export interface SuggestionInsertedEvent {
|
||||
editor: AtomCore.TextEditor;
|
||||
triggerPosition: TextBuffer.Point;
|
||||
suggestion: TextSuggestion|SnippetSuggestion;
|
||||
}
|
||||
|
||||
/** An autocompletion suggestion for the user.
|
||||
* Primary data type for the Atom Autocomplete+ service.
|
||||
*/
|
||||
export interface Suggestion<T extends { text: string }|{ snippet: string }> {
|
||||
/** A string that will show in the UI for this suggestion.
|
||||
* When not set, snippet || text is displayed.
|
||||
*/
|
||||
displayText?: string;
|
||||
|
||||
/** The text immediately preceding the cursor, which will be replaced by the text.
|
||||
* If not provided, the prefix passed into getSuggestions will be used.
|
||||
*/
|
||||
replacementPrefix?: string;
|
||||
|
||||
/** The suggestion type. It will be converted into an icon shown against the
|
||||
* suggestion.
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/** This is shown before the suggestion. Useful for return values. */
|
||||
leftLabel?: string;
|
||||
|
||||
/** Use this instead of leftLabel if you want to use html for the left label. */
|
||||
leftLabelHTML?: string;
|
||||
|
||||
/** An indicator (e.g. function, variable) denoting the "kind" of suggestion this
|
||||
* represents.
|
||||
*/
|
||||
rightLabel?: string;
|
||||
|
||||
/** Use this instead of rightLabel if you want to use html for the right label. */
|
||||
rightLabelHTML?: string;
|
||||
|
||||
/** Class name for the suggestion in the suggestion list. Allows you to style your
|
||||
* suggestion via CSS, if desired.
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/** If you want complete control over the icon shown against the suggestion.
|
||||
* e.g. iconHTML: <i class="icon-move-right"></i>
|
||||
*/
|
||||
iconHTML?: string;
|
||||
|
||||
/** A doc-string summary or short description of the suggestion. When specified, it
|
||||
* will be displayed at the bottom of the suggestions list.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/** A url to the documentation or more information about this suggestion.
|
||||
* When specified, a More.. link will be displayed in the description area.
|
||||
*/
|
||||
descriptionMoreURL?: string;
|
||||
}
|
||||
|
||||
export interface TextSuggestion extends Suggestion<TextSuggestion> {
|
||||
/** The text which will be inserted into the editor, in place of the prefix. */
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface SnippetSuggestion extends Suggestion<SnippetSuggestion> {
|
||||
/** A snippet string. This will allow users to tab through function arguments
|
||||
* or other options.
|
||||
*/
|
||||
snippet: string;
|
||||
}
|
||||
|
||||
export type Suggestions = Array<TextSuggestion|SnippetSuggestion>;
|
||||
|
||||
/** The interface that all Autocomplete+ providers must implement. */
|
||||
export interface AutocompleteProvider {
|
||||
/** Defines the scope selector(s) (can be comma-separated) for which your provider
|
||||
* should receive suggestion requests.
|
||||
*/
|
||||
selector: string;
|
||||
|
||||
/** Is called when a suggestion request has been dispatched by autocomplete+ to
|
||||
* your provider. Return an array of suggestions (if any) in the order you would
|
||||
* like them displayed to the user. Returning a Promise of an array of suggestions
|
||||
* is also supported.
|
||||
*/
|
||||
getSuggestions(params: SuggestionsRequestedEvent): Suggestions|Promise<Suggestions>;
|
||||
|
||||
/** Defines the scope selector(s) (can be comma-separated) for which your provider
|
||||
* should not be used.
|
||||
*/
|
||||
disableForSelector?: string;
|
||||
|
||||
/** A number to indicate its priority to be included in a suggestions request.
|
||||
* The default provider has an inclusion priority of 0. Higher priority providers
|
||||
* can suppress lower priority providers with excludeLowerPriority.
|
||||
*/
|
||||
inclusionPriority?: number;
|
||||
|
||||
/** Will not use lower priority providers when this provider is used. */
|
||||
excludeLowerPriority?: boolean;
|
||||
|
||||
/** A number to determine the sort order of suggestions. The default provider has
|
||||
* an suggestion priority of 1.
|
||||
*/
|
||||
suggestionPriority?: number;
|
||||
|
||||
/** Function that is called when a suggestion from your provider was inserted
|
||||
* into the buffer.
|
||||
*/
|
||||
onDidInsertSuggestion?(params: SuggestionInsertedEvent): void;
|
||||
|
||||
/** Will be called if your provider is being destroyed by autocomplete+ */
|
||||
dispose?(): void;
|
||||
}
|
||||
Vendored
+3836
-3992
File diff suppressed because it is too large
Load Diff
Vendored
+77
@@ -0,0 +1,77 @@
|
||||
// Linter 2.x
|
||||
// https://atom.io/packages/linter
|
||||
|
||||
export interface ReplacementSolution {
|
||||
title?: string;
|
||||
position: TextBuffer.Range;
|
||||
priority?: number;
|
||||
currentText?: string;
|
||||
replaceWith: string;
|
||||
}
|
||||
|
||||
export interface CallbackSolution {
|
||||
title?: string;
|
||||
position: TextBuffer.Range;
|
||||
priority?: number;
|
||||
// tslint:disable-next-line:no-any
|
||||
apply(): any;
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
/** The location of the issue (aka where to highlight). */
|
||||
location: {
|
||||
/** The path to the file to which the message applies. */
|
||||
file: string;
|
||||
|
||||
/** The range of the message in the editor. */
|
||||
position: TextBuffer.Range;
|
||||
};
|
||||
|
||||
/** A reference to a different location in the editor. */
|
||||
reference?: {
|
||||
/** The path to the file being referenced. */
|
||||
file: string;
|
||||
|
||||
/** The point being referenced in that file. */
|
||||
position?: TextBuffer.Point;
|
||||
};
|
||||
|
||||
/** An HTTP link to a resource explaining the issue. Default is a google search. */
|
||||
url?: string;
|
||||
|
||||
/** The name of the octicon to show in the gutter. */
|
||||
icon?: string;
|
||||
|
||||
/** The text for the message. */
|
||||
excerpt: string;
|
||||
|
||||
/** The severity level for the message. */
|
||||
severity: "error"|"warning"|"info";
|
||||
|
||||
/** Possible solutions (which the user can invoke at will). */
|
||||
solutions?: Array<ReplacementSolution|CallbackSolution>;
|
||||
|
||||
/** Markdown long description of the error. Accepts a callback so that you can
|
||||
* do things like HTTP requests.
|
||||
*/
|
||||
description?: string|(() => Promise<string>|string);
|
||||
}
|
||||
|
||||
export interface IndieDelegate {
|
||||
name: string;
|
||||
getMessages(): Message[];
|
||||
clearMessages(): void;
|
||||
setMessages(filePath: string, messages: Message[]): void;
|
||||
setAllMessages(messages: Message[]): void;
|
||||
onDidUpdate(callback: () => void): EventKit.Disposable;
|
||||
onDidDestroy(callback: () => void): EventKit.Disposable;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export interface LinterProvider {
|
||||
name: string;
|
||||
scope: "file"|"project";
|
||||
lintsOnChange: boolean;
|
||||
grammarScopes: string[];
|
||||
lint(textEditor: AtomCore.TextEditor): Message[]|void|Promise<Message[]|undefined>;
|
||||
}
|
||||
Vendored
-190
@@ -1,190 +0,0 @@
|
||||
/* tslint:disable:no-unnecessary-qualifier */
|
||||
declare namespace Atom {
|
||||
namespace Services {
|
||||
/** Type definitions for autocomplete+ 2 */
|
||||
namespace Autocomplete {
|
||||
/** Objects that appear as parameters to callbacks. */
|
||||
namespace Events {
|
||||
/** The parameters passed into getSuggestions by Autocomplete+. */
|
||||
interface SuggestionsRequested {
|
||||
/** The current TextEditor. */
|
||||
editor: Atom.TextEditor;
|
||||
|
||||
/** The position of the cursor. */
|
||||
bufferPosition: Atom.Point;
|
||||
|
||||
/** The scope descriptor for the current cursor position. */
|
||||
scopeDescriptor: Atom.ScopeDescriptor;
|
||||
|
||||
/** The prefix for the word immediately preceding the current cursor position. */
|
||||
prefix: string;
|
||||
|
||||
/** Whether the autocomplete request was initiated by the user. */
|
||||
activatedManually: boolean;
|
||||
}
|
||||
|
||||
/** The parameters passed into onDidInsertSuggestion by Autocomplete+. */
|
||||
interface SuggestionInserted {
|
||||
editor: Atom.TextEditor;
|
||||
triggerPosition: Atom.Point;
|
||||
suggestion: TextSuggestion|SnippetSuggestion;
|
||||
}
|
||||
}
|
||||
|
||||
/** An autocompletion suggestion for the user.
|
||||
* Primary data type for the Atom Autocomplete+ service.
|
||||
*/
|
||||
interface Suggestion {
|
||||
/** A string that will show in the UI for this suggestion.
|
||||
* When not set, snippet || text is displayed.
|
||||
*/
|
||||
displayText?: string;
|
||||
|
||||
/** The text immediately preceding the cursor, which will be replaced by the text.
|
||||
* If not provided, the prefix passed into getSuggestions will be used.
|
||||
*/
|
||||
replacementPrefix?: string;
|
||||
|
||||
/** The suggestion type. It will be converted into an icon shown against the suggestion. */
|
||||
type?: string;
|
||||
|
||||
/** This is shown before the suggestion. Useful for return values. */
|
||||
leftLabel?: string;
|
||||
|
||||
/** Use this instead of leftLabel if you want to use html for the left label. */
|
||||
leftLabelHTML?: string;
|
||||
|
||||
/** An indicator (e.g. function, variable) denoting the "kind" of suggestion this represents. */
|
||||
rightLabel?: string;
|
||||
|
||||
/** Use this instead of rightLabel if you want to use html for the right label. */
|
||||
rightLabelHTML?: string;
|
||||
|
||||
/** Class name for the suggestion in the suggestion list. Allows you to style your suggestion
|
||||
* via CSS, if desired.
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/** If you want complete control over the icon shown against the suggestion. e.g. iconHTML:
|
||||
* <i class="icon-move-right"></i>
|
||||
*/
|
||||
iconHTML?: string;
|
||||
|
||||
/** A doc-string summary or short description of the suggestion. When specified, it will be
|
||||
* displayed at the bottom of the suggestions list.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/** A url to the documentation or more information about this suggestion. When specified,
|
||||
* a More.. link will be displayed in the description area.
|
||||
*/
|
||||
descriptionMoreURL?: string;
|
||||
}
|
||||
|
||||
interface TextSuggestion extends Suggestion {
|
||||
/** The text which will be inserted into the editor, in place of the prefix. */
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface SnippetSuggestion extends Suggestion {
|
||||
/** A snippet string. This will allow users to tab through function arguments or other
|
||||
* options.
|
||||
*/
|
||||
snippet: string;
|
||||
}
|
||||
|
||||
type Suggestions = Array<TextSuggestion|SnippetSuggestion>;
|
||||
|
||||
interface Provider {
|
||||
/** Defines the scope selector(s) (can be comma-separated) for which your provider
|
||||
* should receive suggestion requests.
|
||||
*/
|
||||
selector: string;
|
||||
|
||||
/** Is called when a suggestion request has been dispatched by autocomplete+ to your
|
||||
* provider. Return an array of suggestions (if any) in the order you would like them
|
||||
* displayed to the user. Returning a Promise of an array of suggestions is also
|
||||
* supported.
|
||||
*/
|
||||
getSuggestions(params: Events.SuggestionsRequested): Suggestions|Promise<Suggestions>;
|
||||
|
||||
/** Defines the scope selector(s) (can be comma-separated) for which your provider
|
||||
* should not be used.
|
||||
*/
|
||||
disableForSelector?: string;
|
||||
|
||||
/** A number to indicate its priority to be included in a suggestions request.
|
||||
* The default provider has an inclusion priority of 0. Higher priority providers
|
||||
* can suppress lower priority providers with excludeLowerPriority.
|
||||
*/
|
||||
inclusionPriority?: number;
|
||||
|
||||
/** Will not use lower priority providers when this provider is used. */
|
||||
excludeLowerPriority?: boolean;
|
||||
|
||||
/** A number to determine the sort order of suggestions. The default provider has
|
||||
* an suggestion priority of 1.
|
||||
*/
|
||||
suggestionPriority?: number;
|
||||
|
||||
/** Function that is called when a suggestion from your provider was inserted
|
||||
* into the buffer.
|
||||
*/
|
||||
onDidInsertSuggestion?(params: Events.SuggestionInserted): void;
|
||||
|
||||
/** Will be called if your provider is being destroyed by autocomplete+ */
|
||||
dispose?(): void;
|
||||
}
|
||||
}
|
||||
|
||||
/** Type definitions for status-bar 1.8 */
|
||||
namespace StatusBar {
|
||||
/** Objects that appear as parameters to functions. */
|
||||
namespace Options {
|
||||
interface AddTile {
|
||||
/** A DOM element, a jQuery object, or a model object for which a view provider
|
||||
* has been registered in the the view registry.
|
||||
*/
|
||||
item: object;
|
||||
|
||||
/** Determines the placement of the tile within the status bar. Lower priority
|
||||
* will result in closer placement to the anchor.
|
||||
*/
|
||||
priority: number;
|
||||
}
|
||||
}
|
||||
|
||||
interface Tile {
|
||||
/** Retrieve the priority that was assigned to the Tile when it was created. */
|
||||
getPriority(): number;
|
||||
|
||||
/** Retrieve the Tile's item. */
|
||||
getItem(): object;
|
||||
|
||||
/** Remove the Tile from the status bar. */
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface StatusBar {
|
||||
/** Add a tile to the left side of the status bar. Lower priority tiles are placed
|
||||
* further to the left.
|
||||
*/
|
||||
addLeftTile(options: Options.AddTile): Tile;
|
||||
|
||||
/** Add a tile to the right side of the status bar. Lower priority tiles are placed
|
||||
* further to the right.
|
||||
*/
|
||||
addRightTile(options: Options.AddTile): Tile;
|
||||
|
||||
/** Retrieve all of the tiles on the left side of the status bar. */
|
||||
getLeftTiles(): Tile[];
|
||||
|
||||
/** Retrieve all of the tiles on the right side of the status bar. */
|
||||
getRightTiles(): Tile[];
|
||||
}
|
||||
|
||||
type Consumer = (statusBar: StatusBar) => void;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* tslint:enable:no-unnecessary-qualifier */
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
// Status Bar 1.x
|
||||
// https://atom.io/packages/status-bar
|
||||
|
||||
export interface AddTileOptions {
|
||||
/** A DOM element, a jQuery object, or a model object for which a view provider
|
||||
* has been registered in the the view registry.
|
||||
*/
|
||||
item: object;
|
||||
|
||||
/** Determines the placement of the tile within the status bar. Lower priority
|
||||
* will result in closer placement to the anchor.
|
||||
*/
|
||||
priority: number;
|
||||
}
|
||||
|
||||
export interface Tile {
|
||||
/** Retrieve the priority that was assigned to the Tile when it was created. */
|
||||
getPriority(): number;
|
||||
|
||||
/** Retrieve the Tile's item. */
|
||||
getItem(): object;
|
||||
|
||||
/** Remove the Tile from the status bar. */
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export interface StatusBar {
|
||||
/** Add a tile to the left side of the status bar. Lower priority tiles are placed
|
||||
* further to the left.
|
||||
*/
|
||||
addLeftTile(options: AddTileOptions): Tile;
|
||||
|
||||
/** Add a tile to the right side of the status bar. Lower priority tiles are placed
|
||||
* further to the right.
|
||||
*/
|
||||
addRightTile(options: AddTileOptions): Tile;
|
||||
|
||||
/** Retrieve all of the tiles on the left side of the status bar. */
|
||||
getLeftTiles(): Tile[];
|
||||
|
||||
/** Retrieve all of the tiles on the right side of the status bar. */
|
||||
getRightTiles(): Tile[];
|
||||
}
|
||||
@@ -20,6 +20,8 @@
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"atom-tests.ts",
|
||||
"services/index.d.ts"
|
||||
"autocomplete-plus.d.ts",
|
||||
"linter.d.ts",
|
||||
"status-bar.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// Custom rules.
|
||||
"await-promise": [true, "CancellablePromise"],
|
||||
"class-name": true,
|
||||
"indent": [true, "tabs"],
|
||||
"indent": [true, "spaces", 4],
|
||||
"jsdoc-format": true,
|
||||
"max-line-length": [true, 100],
|
||||
"max-line-length": [true, 110],
|
||||
"quotemark": [true, "double", "avoid-escape"],
|
||||
"trailing-comma": [true, {
|
||||
"multiline": { "objects": "always", "arrays": "always", "functions": "never" },
|
||||
|
||||
@@ -151,7 +151,7 @@ webAuth.client.login({
|
||||
|
||||
webAuth.popup.buildPopupHandler();
|
||||
webAuth.popup.preload({});
|
||||
webAuth.popup.authorize({}, (err, data) => {
|
||||
webAuth.popup.authorize({ domain: "", redirectUri: "", responseType: "code" }, (err, data) => {
|
||||
if (err) /* handle error */ return;
|
||||
// do something with data
|
||||
});
|
||||
@@ -159,11 +159,11 @@ webAuth.popup.loginWithCredentials({}, (err, data) => {
|
||||
if (err) /* handle error */ return;
|
||||
// do something with data
|
||||
});
|
||||
webAuth.popup.passwordlessVerify({}, (err, data) => {
|
||||
webAuth.popup.passwordlessVerify({ type: "sms", phoneNumber: "", connection: "", verificationCode: "" }, (err, data) => {
|
||||
if (err) /* handle error */ return;
|
||||
// do something with data
|
||||
});
|
||||
webAuth.popup.signupAndLogin({}, (err, data) => {
|
||||
webAuth.popup.signupAndLogin({ email: "", password: "", connection: "" }, (err, data) => {
|
||||
if (err) /* handle error */ return;
|
||||
// do something with data
|
||||
});
|
||||
|
||||
Vendored
+139
-137
@@ -15,82 +15,68 @@ export class Authentication {
|
||||
/**
|
||||
* Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction
|
||||
*
|
||||
* @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db
|
||||
*/
|
||||
buildAuthorizeUrl(options: any): string;
|
||||
|
||||
/**
|
||||
* Builds and returns the Logout url in order to initialize a new authN/authZ transaction
|
||||
*
|
||||
* @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#get--v2-logout
|
||||
*/
|
||||
buildLogoutUrl(options?: LogoutOptions): string;
|
||||
|
||||
/**
|
||||
* Makes a call to the `oauth/token` endpoint with `password` grant type
|
||||
*
|
||||
* @param {DefaultDirectoryLoginOptions} options: https://auth0.com/docs/api-auth/grant/password
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api-auth/grant/password
|
||||
*/
|
||||
loginWithDefaultDirectory(options: DefaultDirectoryLoginOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Makes a call to the `/ro` endpoint
|
||||
* @param {ResourceOwnerLoginOptions} options
|
||||
* @param {Function} callback
|
||||
* @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead.
|
||||
*/
|
||||
loginWithResourceOwner(options: ResourceOwnerLoginOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Makes a call to the `oauth/token` endpoint with `password-realm` grant type
|
||||
* @param {DefaultLoginOptions} options
|
||||
* @param {Function} callback
|
||||
*/
|
||||
login(options: DefaultLoginOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Makes a call to the `oauth/token` endpoint
|
||||
* @param {any} options
|
||||
* @param {Function} callback
|
||||
*/
|
||||
oauthToken(options: any, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Makes a call to the `/ssodata` endpoint
|
||||
*
|
||||
* @param {Function} callback
|
||||
*/
|
||||
getSSOData(callback?: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Makes a call to the `/ssodata` endpoint
|
||||
*
|
||||
* @param {Boolean} withActiveDirectories
|
||||
* @param {Function} callback
|
||||
*/
|
||||
getSSOData(withActiveDirectories: boolean, callback?: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Makes a call to the `/userinfo` endpoint and returns the user profile
|
||||
*
|
||||
* @param {String} accessToken
|
||||
* @param {Function} callback
|
||||
*/
|
||||
userInfo(accessToken: string, callback: Auth0Callback<Auth0UserProfile>): void;
|
||||
|
||||
/**
|
||||
* Makes a call to the `/delegation` endpoint
|
||||
*
|
||||
* @param {DelegationOptions} options: https://auth0.com/docs/api/authentication#!#post--delegation
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#post--delegation
|
||||
*/
|
||||
delegation(options: DelegationOptions, callback: Auth0Callback<Auth0DelegationToken>): any;
|
||||
|
||||
/**
|
||||
* Fetches the user country based on the ip.
|
||||
*
|
||||
* @param {Function} callback
|
||||
*/
|
||||
getUserCountry(callback: Auth0Callback<{ countryCode: string }>): void;
|
||||
}
|
||||
@@ -101,24 +87,19 @@ export class PasswordlessAuthentication {
|
||||
/**
|
||||
* Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction
|
||||
*
|
||||
* @param {PasswordlessVerifyOptions} options
|
||||
* @param {Function} callback
|
||||
*/
|
||||
buildVerifyUrl(options: PasswordlessVerifyOptions): string;
|
||||
|
||||
/**
|
||||
* Initializes a new passwordless authN/authZ transaction
|
||||
*
|
||||
* @param {Object} options: https://auth0.com/docs/api/authentication#passwordless
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api/authentication#passwordless
|
||||
*/
|
||||
start(options: PasswordlessStartOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Verifies the passwordless TOTP and returns an error if any.
|
||||
*
|
||||
* @param {PasswordlessVerifyOptions} options
|
||||
* @param {Function} callback
|
||||
*/
|
||||
verify(options: PasswordlessVerifyOptions, callback: Auth0Callback<any>): void;
|
||||
}
|
||||
@@ -129,16 +110,14 @@ export class DBConnection {
|
||||
/**
|
||||
* Signup a new user
|
||||
*
|
||||
* @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
|
||||
* @param {Function} calback
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
|
||||
*/
|
||||
signup(options: DbSignUpOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Initializes the change password flow
|
||||
*
|
||||
* @param {ChangePasswordOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
|
||||
*/
|
||||
changePassword(options: ChangePasswordOptions, callback: Auth0Callback<any>): void;
|
||||
}
|
||||
@@ -146,15 +125,12 @@ export class DBConnection {
|
||||
export class Management {
|
||||
/**
|
||||
* Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant.
|
||||
* @param {ManagementOptions} options
|
||||
*/
|
||||
constructor(options: ManagementOptions);
|
||||
|
||||
/**
|
||||
* Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id
|
||||
*
|
||||
* @param {String} userId
|
||||
* @param {Function} callback
|
||||
*/
|
||||
getUser(userId: string, callback: Auth0Callback<Auth0UserProfile>): void;
|
||||
|
||||
@@ -162,18 +138,12 @@ export class Management {
|
||||
* Updates the user metdata. It will patch the user metdata with the attributes sent.
|
||||
* https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
|
||||
*
|
||||
* @param {String} userId
|
||||
* @param {Object} userMetadata
|
||||
* @param {Function} callback
|
||||
*/
|
||||
patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback<Auth0UserProfile>): void;
|
||||
|
||||
/**
|
||||
* Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities
|
||||
*
|
||||
* @param {String} userId
|
||||
* @param {String} secondaryUserToken
|
||||
* @param {Function} callback
|
||||
*/
|
||||
linkUser(userId: string, secondaryUserToken: string, callback: Auth0Callback<any>): void;
|
||||
}
|
||||
@@ -188,7 +158,7 @@ export class WebAuth {
|
||||
/**
|
||||
* Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction
|
||||
*
|
||||
* @param {AuthorizeOptions} options: https://auth0.com/docs/api/authentication#!#get--authorize_db
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db
|
||||
*/
|
||||
authorize(options?: AuthorizeOptions): void;
|
||||
|
||||
@@ -199,8 +169,7 @@ export class WebAuth {
|
||||
* by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be
|
||||
* accepted.
|
||||
*
|
||||
* @param {ParseHashOptions} options
|
||||
* @param {Function} callback: any(err, token_payload)
|
||||
* @param callback: any(err, token_payload)
|
||||
*/
|
||||
parseHash(callback: Auth0Callback<Auth0DecodedHash>): void;
|
||||
|
||||
@@ -211,17 +180,14 @@ export class WebAuth {
|
||||
* by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be
|
||||
* accepted.
|
||||
*
|
||||
* @param {ParseHashOptions} options
|
||||
* @param {Function} callback: any(err, token_payload)
|
||||
* @param callback: any(err, token_payload)
|
||||
*/
|
||||
parseHash(options: ParseHashOptions, callback: Auth0Callback<Auth0DecodedHash>): void;
|
||||
|
||||
/**
|
||||
* Decodes the id_token and verifies the nonce.
|
||||
*
|
||||
* @param {String} token
|
||||
* @param {String} nonce
|
||||
* @param {Function} callback: function(err, {payload, transaction})
|
||||
* @param callback: function(err, {payload, transaction})
|
||||
*/
|
||||
validateToken(token: string, nonce: string, callback: Auth0Callback<any>): void;
|
||||
|
||||
@@ -231,24 +197,21 @@ export class WebAuth {
|
||||
* Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social).
|
||||
* If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method.
|
||||
*
|
||||
* @param {RenewAuthOptions} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint
|
||||
* @param {Function} callback
|
||||
* @param options: any valid oauth2 parameter to be sent to the `/authorize` endpoint
|
||||
*/
|
||||
renewAuth(options: RenewAuthOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Initialices a change password transaction
|
||||
*
|
||||
* @param {ChangePasswordOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
|
||||
*/
|
||||
changePassword(options: ChangePasswordOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Signs up a new user
|
||||
*
|
||||
* @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
|
||||
*/
|
||||
signup(options: DbSignUpOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
@@ -256,8 +219,7 @@ export class WebAuth {
|
||||
* Signs up a new user, automatically logs the user in after the signup and returns the user token.
|
||||
* The login will be done using /oauth/token with password-realm grant type.
|
||||
*
|
||||
* @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
|
||||
*/
|
||||
signupAndAuthorize(options: DbSignUpOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
@@ -268,8 +230,8 @@ export class WebAuth {
|
||||
* This only works when 3rd party cookies are enabled in the browser.
|
||||
* After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor.
|
||||
*
|
||||
* @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired
|
||||
* @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs.
|
||||
* @param options options used in the {@link authorize} call after the login_ticket is acquired
|
||||
* @param cb Callback function called only when an authentication error, like invalid username or password, occurs.
|
||||
* For other types of errors, there will be a redirect to the `redirectUri`.
|
||||
*/
|
||||
login(options: CrossOriginLoginOptions, callback: Auth0Callback<any>): void;
|
||||
@@ -288,7 +250,6 @@ export class WebAuth {
|
||||
* - If the client_id parameter is included, the returnTo URL must be listed in the Allowed Logout URLs set at the client level (see Setting Allowed Logout URLs at the App Level).
|
||||
* - If the client_id parameter is NOT included, the returnTo URL must be listed in the Allowed Logout URLs set at the account level (see Setting Allowed Logout URLs at the Account Level).
|
||||
*
|
||||
* @param {LogoutOptions} options
|
||||
* @see {@link https://auth0.com/docs/api/authentication#logout}
|
||||
*/
|
||||
logout(options: LogoutOptions): void;
|
||||
@@ -296,17 +257,14 @@ export class WebAuth {
|
||||
/**
|
||||
* Initialices a passwordless authentication transaction
|
||||
*
|
||||
* @param {PasswordlessStartOptions} options: https://auth0.com/docs/api/authentication#passwordless
|
||||
* @param {Function} callback
|
||||
* @param options: https://auth0.com/docs/api/authentication#passwordless
|
||||
*/
|
||||
passwordlessStart(options: PasswordlessStartOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Verifies the passwordless TOTP and redirects to finish the passwordless transaction
|
||||
*
|
||||
* @method passwordlessVerify
|
||||
* @param {PasswordlessVerifyOptions} options:
|
||||
* @param {Function} callback
|
||||
* @param options:
|
||||
*/
|
||||
passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback<any>): void;
|
||||
}
|
||||
@@ -319,28 +277,35 @@ export class Redirect {
|
||||
*
|
||||
* This method is not compatible with API Auth so if you need to fetch API tokens with audience
|
||||
* you should use {@link authorize} or {@link login}.
|
||||
*
|
||||
* @method loginWithCredentials
|
||||
* @param {Object} options
|
||||
* @param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorization Response
|
||||
* @param {String} [options.responseType] type of the response used. It can be any of the values `code` and `token`
|
||||
* @param {String} [options.responseMode] how the AuthN response is encoded and redirected back to the client. Supported values are `query` and `fragment`
|
||||
* @param {String} [options.scope] scopes to be requested during AuthN. e.g. `openid email`
|
||||
* @param {credentialsCallback} cb
|
||||
*/
|
||||
loginWithCredentials(options: any, callback: Auth0Callback<any>): void;
|
||||
loginWithCredentials(
|
||||
options: {
|
||||
/** url that the Auth0 will redirect after Auth with the Authorization Response */
|
||||
redirectUri?: string,
|
||||
/** type of the response used. It can be any of the values `code` and `token` */
|
||||
responseType?: string,
|
||||
/** how the AuthN response is encoded and redirected back to the client. */
|
||||
responseMode?: "query" | "fragment",
|
||||
/** scopes to be requested during AuthN. e.g. `openid email` */
|
||||
scope: string,
|
||||
},
|
||||
callback: Auth0Callback<any>,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Signs up a new user and automatically logs the user in after the signup.
|
||||
*
|
||||
* @method signupAndLogin
|
||||
* @param {Object} options
|
||||
* @param {String} options.email user email address
|
||||
* @param {String} options.password user password
|
||||
* @param {String} options.connection name of the connection where the user will be created
|
||||
* @param {credentialsCallback} cb
|
||||
*/
|
||||
signupAndLogin(options: any, callback: Auth0Callback<any>): void;
|
||||
signupAndLogin(
|
||||
options: {
|
||||
/** user email address */
|
||||
email: string,
|
||||
/** user password */
|
||||
password: string,
|
||||
/** name of the connection where the user will be created */
|
||||
connection: string,
|
||||
},
|
||||
callback: Auth0Callback<any>,
|
||||
): void;
|
||||
}
|
||||
|
||||
export class Popup {
|
||||
@@ -349,98 +314,135 @@ export class Popup {
|
||||
/**
|
||||
* Returns a new instance of the popup handler
|
||||
*
|
||||
* @method buildPopupHandler
|
||||
*/
|
||||
buildPopupHandler(): any;
|
||||
|
||||
/**
|
||||
* Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.
|
||||
*
|
||||
* @method preload
|
||||
* @param {Object} options: receives the window height and width and any other window feature to be sent to window.open
|
||||
* @param options: receives the window height and width and any other window feature to be sent to window.open
|
||||
*/
|
||||
preload(options: any): any;
|
||||
|
||||
/**
|
||||
* Handles the popup logic for the callback page.
|
||||
*
|
||||
* @method callback
|
||||
* @param {Object} options
|
||||
* @param {String} options.hash the url hash. If not provided it will extract from window.location.hash
|
||||
* @param {String} [options.state] value originally sent in `state` parameter to {@link authorize} to mitigate XSRF
|
||||
* @param {String} [options.nonce] value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks
|
||||
* @param {String} [options._idTokenVerification] makes parseHash perform or skip `id_token` verification.
|
||||
* We **strongly** recommend validating the `id_token` yourself if you disable the verification.
|
||||
* @see {@link parseHash}
|
||||
* @see {@link parseHash}
|
||||
*/
|
||||
callback(options: any): void;
|
||||
callback(options: {
|
||||
/**
|
||||
* the url hash.
|
||||
* @default window.location.hash
|
||||
*/
|
||||
hash: string,
|
||||
/** value originally sent in `state` parameter to {@link authorize} to mitigate XSRF */
|
||||
state?: string,
|
||||
/** value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks */
|
||||
nonce?: string,
|
||||
/**
|
||||
* makes parseHash perform or skip `id_token` verification.
|
||||
* We **strongly** recommend validating the `id_token` yourself if you disable the verification.
|
||||
*/
|
||||
_idTokenVerification?: string,
|
||||
}): void;
|
||||
|
||||
/**
|
||||
* Shows inside a new window the hosted login page (`/authorize`) in order to start a new authN/authZ transaction and post its result using `postMessage`.
|
||||
*
|
||||
* @method authorize
|
||||
* @param {Object} options
|
||||
* @param {String} [options.domain] your Auth0 domain
|
||||
* @param {String} [options.clientID] your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard
|
||||
* @param {String} options.redirectUri url that the Auth0 will redirect after Auth with the Authorization Response
|
||||
* @param {String} options.responseType type of the response used by OAuth 2.0 flow.
|
||||
* It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0}
|
||||
* @param {String} [options.responseMode] how the Auth response is encoded and redirected back to the client.
|
||||
* Supported values are `query`, `fragment` and `form_post`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes}
|
||||
* @param {String} [options.state] value used to mitigate XSRF attacks. {@link https://auth0.com/docs/protocols/oauth2/oauth-state}
|
||||
* @param {String} [options.nonce] value used to mitigate replay attacks when using Implicit Grant. {@link https://auth0.com/docs/api-auth/tutorials/nonce}
|
||||
* @param {String} [options.scope] scopes to be requested during Auth. e.g. `openid email`
|
||||
* @param {String} [options.audience] identifier of the resource server who will consume the access token issued after Auth
|
||||
* @param {Boolean} [options.owp] determines if Auth0 should render the relay page or not and the caller is responsible of handling the response.
|
||||
* @param {authorizeCallback} cb
|
||||
* @see {@link https://auth0.com/docs/api/authentication#authorize-client}
|
||||
*/
|
||||
authorize(options: any, callback: Auth0Callback<any>): void;
|
||||
authorize(
|
||||
options: {
|
||||
/** your Auth0 domain */
|
||||
domain: string,
|
||||
/** your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard */
|
||||
clientId?: string,
|
||||
/** url that the Auth0 will redirect after Auth with the Authorization Response */
|
||||
redirectUri: string,
|
||||
/**
|
||||
* type of the response used by OAuth 2.0 flow.
|
||||
* It can be any space separated list of the values `code`, `token`, `id_token`.
|
||||
* {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0}
|
||||
*/
|
||||
responseType: string,
|
||||
/**
|
||||
* how the Auth response is encoded and redirected back to the client.
|
||||
* {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes}
|
||||
*/
|
||||
responseMode?: "query" | "fragment" | "form_post",
|
||||
/**
|
||||
* value used to mitigate XSRF attacks.
|
||||
* {@link https://auth0.com/docs/protocols/oauth2/oauth-state}
|
||||
*/
|
||||
state?: string,
|
||||
/**
|
||||
* value used to mitigate replay attacks when using Implicit Grant.
|
||||
* {@link https://auth0.com/docs/api-auth/tutorials/nonce}
|
||||
*/
|
||||
nonce?: string,
|
||||
/** scopes to be requested during Auth. e.g. `openid email` */
|
||||
scope?: string,
|
||||
/** identifier of the resource server who will consume the access token issued after Auth */
|
||||
audience?: string,
|
||||
/** determines if Auth0 should render the relay page or not and the caller is responsible of handling the response. */
|
||||
owp?: boolean,
|
||||
},
|
||||
callback: Auth0Callback<any>,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Performs authentication with username/email and password with a database connection inside a new window
|
||||
*
|
||||
* This method is not compatible with API Auth so if you need to fetch API tokens with audience
|
||||
* you should use {@link authorize} or {@link login}.
|
||||
*
|
||||
* @method loginWithCredentials
|
||||
* @param {Object} options
|
||||
* @param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorization Response
|
||||
* @param {String} [options.responseType] type of the response used. It can be any of the values `code` and `token`
|
||||
* @param {String} [options.responseMode] how the AuthN response is encoded and redirected back to the client. Supported values are `query` and `fragment`
|
||||
* @param {String} [options.scope] scopes to be requested during AuthN. e.g. `openid email`
|
||||
* @param {credentialsCallback} cb
|
||||
*/
|
||||
loginWithCredentials(options: any, callback: Auth0Callback<any>): void;
|
||||
loginWithCredentials(
|
||||
options: {
|
||||
/** url that the Auth0 will redirect after Auth with the Authorization Response */
|
||||
redirectUri?: string,
|
||||
/** type of the response used. */
|
||||
responseType?: "code" | "token",
|
||||
/** how the AuthN response is encoded and redirected back to the client. */
|
||||
responseMode?: "query" | "fragment",
|
||||
/** scopes to be requested during AuthN. e.g. `openid email` */
|
||||
scope?: string,
|
||||
},
|
||||
callback: Auth0Callback<any>,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Verifies the passwordless TOTP and returns the requested token
|
||||
*
|
||||
* @method passwordlessVerify
|
||||
* @param {Object} options:
|
||||
* @param {Object} options.type: `sms` or `email`
|
||||
* @param {Object} options.phoneNumber: only if type = sms
|
||||
* @param {Object} options.email: only if type = email
|
||||
* @param {Object} options.connection: the connection name
|
||||
* @param {Object} options.verificationCode: the TOTP code
|
||||
* @param {Function} callback
|
||||
*/
|
||||
passwordlessVerify(options: any, callback: Auth0Callback<any>): void;
|
||||
passwordlessVerify(
|
||||
options: {
|
||||
type: "sms" | "email",
|
||||
/** only if type = sms */
|
||||
phoneNumber?: string,
|
||||
/** only if type = email */
|
||||
email?: string,
|
||||
/** the connection name */
|
||||
connection: string,
|
||||
/** the TOTP code */
|
||||
verificationCode: string,
|
||||
},
|
||||
callback: Auth0Callback<any>,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Signs up a new user and automatically logs the user in after the signup.
|
||||
*
|
||||
* This method is not compatible with API Auth so if you need to fetch API tokens with audience
|
||||
* you should use {@link authorize} or {@link signupAndAuthorize}.
|
||||
*
|
||||
* @method signupAndLogin
|
||||
* @param {Object} options
|
||||
* @param {String} options.email user email address
|
||||
* @param {String} options.password user password
|
||||
* @param {String} options.connection name of the connection where the user will be created
|
||||
* @param {credentialsCallback} cb
|
||||
*/
|
||||
signupAndLogin(options: any, callback: Auth0Callback<any>): void;
|
||||
signupAndLogin(
|
||||
options: {
|
||||
/** user email address */
|
||||
email: string,
|
||||
/** user password */
|
||||
password: string,
|
||||
/** name of the connection where the user will be created */
|
||||
connection: string,
|
||||
},
|
||||
callback: Auth0Callback<any>,
|
||||
): void;
|
||||
}
|
||||
|
||||
export class CrossOriginAuthentication {
|
||||
@@ -452,8 +454,8 @@ export class CrossOriginAuthentication {
|
||||
* This only works when 3rd party cookies are enabled in the browser.
|
||||
* After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor.
|
||||
*
|
||||
* @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired
|
||||
* @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs.
|
||||
* @param options options used in the {@link authorize} call after the login_ticket is acquired
|
||||
* @param cb Callback function called only when an authentication error, like invalid username or password, occurs.
|
||||
* For other types of errors, there will be a redirect to the `redirectUri`.
|
||||
*/
|
||||
login(options: CrossOriginLoginOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
Vendored
-9
@@ -8,17 +8,14 @@
|
||||
|
||||
/**
|
||||
* Attach autosize to NodeList
|
||||
* @param elements
|
||||
*/
|
||||
declare function autosize(elements: NodeList): NodeList;
|
||||
/**
|
||||
* Attach autosize to Element
|
||||
* @param element
|
||||
*/
|
||||
declare function autosize(element: Element): Element;
|
||||
/**
|
||||
* Attach autosize to JQuery collection
|
||||
* @param collection
|
||||
*/
|
||||
declare function autosize(collection: JQuery): JQuery;
|
||||
|
||||
@@ -27,37 +24,31 @@ declare namespace autosize {
|
||||
* Triggers the height adjustment for an assigned textarea element.
|
||||
* Autosize will automatically adjust the textarea height on keyboard and window resize events.
|
||||
* There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element.
|
||||
* @param elements
|
||||
*/
|
||||
function update(elements: NodeList): NodeList;
|
||||
/**
|
||||
* Triggers the height adjustment for an assigned textarea element.
|
||||
* Autosize will automatically adjust the textarea height on keyboard and window resize events.
|
||||
* There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element.
|
||||
* @param element
|
||||
*/
|
||||
function update(element: Element): Element;
|
||||
/**
|
||||
* Triggers the height adjustment for an assigned textarea element.
|
||||
* Autosize will automatically adjust the textarea height on keyboard and window resize events.
|
||||
* There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element.
|
||||
* @param collection
|
||||
*/
|
||||
function update(collection: JQuery): JQuery;
|
||||
|
||||
/**
|
||||
* Removes Autosize and reverts any changes it made to the textarea element.
|
||||
* @param elements
|
||||
*/
|
||||
function destroy(elements: NodeList): NodeList;
|
||||
/**
|
||||
* Removes Autosize and reverts any changes it made to the textarea element.
|
||||
* @param element
|
||||
*/
|
||||
function destroy(element: Element): Element;
|
||||
/**
|
||||
* Removes Autosize and reverts any changes it made to the textarea element.
|
||||
* @param collection
|
||||
*/
|
||||
function destroy(collection: JQuery): JQuery;
|
||||
}
|
||||
|
||||
Vendored
+3
-2
@@ -162,8 +162,9 @@ export interface TransformOptions {
|
||||
/** Indicate the mode the code should be parsed in. Can be either “script” or “module”. Default: "module" */
|
||||
sourceType?: "script" | "module";
|
||||
|
||||
/** An optional callback that can be used to wrap visitor methods.
|
||||
* NOTE: This is useful for things like introspection, and not really needed for implementing anything.
|
||||
/**
|
||||
* An optional callback that can be used to wrap visitor methods.
|
||||
* NOTE: This is useful for things like introspection, and not really needed for implementing anything.
|
||||
*/
|
||||
wrapPluginVisitorMethod?(pluginAlias: string, visitorType: 'enter' | 'exit', callback: (path: NodePath, state: any) => void): (path: NodePath, state: any) => void ;
|
||||
}
|
||||
|
||||
Vendored
+5
-5
@@ -691,7 +691,7 @@ export class Region extends Object implements DomMixin {
|
||||
* Render a template with data by passing in the template selector and the
|
||||
* data to render. This is the default renderer that is used by Marionette.
|
||||
*/
|
||||
export class Renderer {
|
||||
export namespace Renderer {
|
||||
/**
|
||||
* This method returns a string containing the result of applying the
|
||||
* template using the data object as the context.
|
||||
@@ -703,7 +703,7 @@ export class Renderer {
|
||||
* that returns valid HTML as a string from the data parameter passed to
|
||||
* the function.
|
||||
*/
|
||||
static render(template: any, data: any): string;
|
||||
function render(template: any, data: any): string;
|
||||
}
|
||||
|
||||
export interface ViewOptions<TModel extends Backbone.Model> extends Backbone.ViewOptions<TModel>, ViewMixinOptions {
|
||||
@@ -1614,11 +1614,11 @@ export class Behavior extends Object {
|
||||
/**
|
||||
* DEPRECATED
|
||||
*/
|
||||
export class Behaviors {
|
||||
export namespace Behaviors {
|
||||
/**
|
||||
* This method defines where your behavior classes are stored. Override this to provide another lookup.
|
||||
*/
|
||||
static behaviorsLookup(): any;
|
||||
function behaviorsLookup(): any;
|
||||
|
||||
/**
|
||||
* This method has a default implementation that is simple to override. It
|
||||
@@ -1626,5 +1626,5 @@ export class Behaviors {
|
||||
* Behaviors.behaviorsLookup or elsewhere. Note that it should return the type of the
|
||||
* class to instantiate, not an instance of that class.
|
||||
*/
|
||||
static getBehaviorClass(options: any, key: string): any;
|
||||
function getBehaviorClass(options: any, key: string): any;
|
||||
}
|
||||
|
||||
@@ -115,6 +115,8 @@ class Employee extends Backbone.Model {
|
||||
super(options);
|
||||
this.reports = new EmployeeCollection();
|
||||
this.reports.url = '../api/employees/' + this.id + '/reports';
|
||||
// Test that collection url property can be set as a function returning a string.
|
||||
this.reports.url = () => { return ""; };
|
||||
}
|
||||
|
||||
more() {
|
||||
|
||||
Vendored
+15
-1
@@ -100,7 +100,6 @@ declare namespace Backbone {
|
||||
}
|
||||
|
||||
class ModelBase extends Events {
|
||||
url: any;
|
||||
parse(response: any, options?: any): any;
|
||||
toJSON(options?: any): any;
|
||||
sync(...arg: any[]): JQueryXHR;
|
||||
@@ -133,6 +132,13 @@ declare namespace Backbone {
|
||||
id: any;
|
||||
idAttribute: string;
|
||||
validationError: any;
|
||||
|
||||
/**
|
||||
* Returns the relative URL where the model's resource would be located on the server.
|
||||
* @memberof Model
|
||||
*/
|
||||
url: () => string;
|
||||
|
||||
urlRoot: any;
|
||||
|
||||
constructor(attributes?: any, options?: any);
|
||||
@@ -314,6 +320,14 @@ declare namespace Backbone {
|
||||
take(): TModel;
|
||||
take(n: number): TModel[];
|
||||
toArray(): TModel[];
|
||||
|
||||
/**
|
||||
* Sets the url property (or function) on a collection to reference its location on the server.
|
||||
*
|
||||
* @memberof Collection
|
||||
*/
|
||||
url: string | (() => string);
|
||||
|
||||
without(...values: TModel[]): TModel[];
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-2
@@ -4,7 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface FittingContext {
|
||||
/** The input defined in the fitting definition
|
||||
/**
|
||||
* The input defined in the fitting definition
|
||||
* (string, number, object, array)
|
||||
*/
|
||||
input: any;
|
||||
@@ -56,7 +57,7 @@ export type Fitting = (
|
||||
* Executed during parsing
|
||||
* @see {@link https://github.com/apigee-127/bagpipes#fittings|Docs}
|
||||
*
|
||||
* @param {Object} fittingDef Fitting Definition
|
||||
* @param fittingDef Fitting Definition
|
||||
*/
|
||||
export type FittingFactory = (fittingDef: FittingDef, bagpipes: any) => Fitting;
|
||||
|
||||
|
||||
Vendored
+3
-1
@@ -62,10 +62,12 @@ export class Block {
|
||||
}
|
||||
|
||||
export class ECPair {
|
||||
constructor(d: BigInteger, Q?: null | undefined, options?: { compressed?: boolean, network?: Network });
|
||||
constructor(d: BigInteger, Q?: null, options?: { compressed?: boolean, network?: Network });
|
||||
|
||||
constructor(d: null | undefined, Q: any, options?: { compressed?: boolean, network?: Network }); // Q should be ECPoint, but not sure how to define such type
|
||||
|
||||
d: BigInteger;
|
||||
|
||||
getAddress(): string;
|
||||
|
||||
getNetwork(): Network;
|
||||
|
||||
Vendored
-22
@@ -14,59 +14,43 @@ export function createBlob(parts: any[], options?: { type: string }): Blob;
|
||||
|
||||
/**
|
||||
* Shim for URL.createObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4).
|
||||
*
|
||||
* @param blob
|
||||
*/
|
||||
export function createObjectURL(blob: Blob): string;
|
||||
|
||||
/**
|
||||
* Shim for URL.revokeObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4).
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
export function revokeObjectURL(url: string): void;
|
||||
|
||||
/**
|
||||
* Convert a Blob to a binary string.
|
||||
*
|
||||
* @param blob
|
||||
*/
|
||||
export function blobToBinaryString(blob: Blob): Promise<string>;
|
||||
|
||||
/**
|
||||
* Convert a binary string to a Blob.
|
||||
*
|
||||
* @param binary
|
||||
* @param type the content type
|
||||
*/
|
||||
export function binaryStringToBlob(binary: string, type?: string): Promise<Blob>;
|
||||
|
||||
/**
|
||||
* Convert a Blob to a base-64 string.
|
||||
*
|
||||
* @param blob
|
||||
*/
|
||||
export function blobToBase64String(blob: Blob): Promise<string>;
|
||||
|
||||
/**
|
||||
* Convert a base-64 string to a Blob.
|
||||
*
|
||||
* @param base64
|
||||
* @param type the content type
|
||||
*/
|
||||
export function base64StringToBlob(base64: string, type?: string): Promise<Blob>;
|
||||
|
||||
/**
|
||||
* Convert a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`) to a Blob.
|
||||
*
|
||||
* @param dataURL
|
||||
*/
|
||||
export function dataURLToBlob(dataURL: string): Promise<Blob>;
|
||||
|
||||
/**
|
||||
* Convert a Blob to a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`).
|
||||
*
|
||||
* @param blob
|
||||
*/
|
||||
export function blobToDataURL(blob: Blob): Promise<string>;
|
||||
|
||||
@@ -75,7 +59,6 @@ export function blobToDataURL(blob: Blob): Promise<string>;
|
||||
*
|
||||
* Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF.
|
||||
*
|
||||
* @param src
|
||||
* @param type the content type (optional, defaults to 'image/png')
|
||||
* @param crossOrigin for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors
|
||||
* @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp'
|
||||
@@ -85,7 +68,6 @@ export function imgSrcToDataURL(src: string, type?: string, crossOrigin?: string
|
||||
/**
|
||||
* Convert a canvas to a Blob.
|
||||
*
|
||||
* @param src
|
||||
* @param type the content type (optional, defaults to 'image/png')
|
||||
* @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp'
|
||||
*/
|
||||
@@ -96,7 +78,6 @@ export function canvasToBlob(canvas: HTMLCanvasElement, type?: string, quality?:
|
||||
*
|
||||
* Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF.
|
||||
*
|
||||
* @param src
|
||||
* @param type the content type (optional, defaults to 'image/png')
|
||||
* @param crossOrigin for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors
|
||||
* @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp'
|
||||
@@ -106,14 +87,11 @@ export function imgSrcToBlob(src: string, type?: string, crossOrigin?: string, q
|
||||
/**
|
||||
* Convert an ArrayBuffer to a Blob.
|
||||
*
|
||||
* @param arrayBuff
|
||||
* @param type the content type
|
||||
*/
|
||||
export function arrayBufferToBlob(arrayBuff: ArrayBuffer, type?: string): Promise<Blob>;
|
||||
|
||||
/**
|
||||
* Convert a Blob to an ArrayBuffer.
|
||||
*
|
||||
* @param blob
|
||||
*/
|
||||
export function blobToArrayBuffer(blob: Blob): Promise<ArrayBuffer>;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"array-type": false,
|
||||
"unified-signatures": false,
|
||||
"ban-types": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"max-line-length": [true, 490],
|
||||
"no-redundant-undefined": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-void-expression": false,
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/expressjs/body-parser
|
||||
// Definitions by: Santi Albo <https://github.com/santialbo>, Vilic Vane <https://github.com/vilic>, Jonathan Häberle <https://github.com/dreampulse>, Gevik Babakhani <https://github.com/blendsdk>, Tomasz Łaziuk <https://github.com/tlaziuk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
@@ -90,6 +90,56 @@ $(() => {
|
||||
$('#ex16a').slider({ min: 0, max: 10, value: 0, focus: true });
|
||||
$('#ex16b').slider({ min: 0, max: 10, value: [0, 10], focus: true });
|
||||
|
||||
$("#ex17a").slider({
|
||||
min: 0,
|
||||
max: 10,
|
||||
value: 0,
|
||||
tooltip_position: 'bottom'
|
||||
});
|
||||
$("#ex17b").slider({
|
||||
min: 0,
|
||||
max: 10,
|
||||
value: 0,
|
||||
orientation: 'vertical',
|
||||
tooltip_position: 'left'
|
||||
});
|
||||
|
||||
$("#ex18a").slider({
|
||||
min: 0,
|
||||
max: 10,
|
||||
value: 5,
|
||||
labelledby: 'ex18-label-1'
|
||||
});
|
||||
$("#ex18b").slider({
|
||||
min: 0,
|
||||
max: 10,
|
||||
value: [3, 6],
|
||||
labelledby: ['ex18-label-2a', 'ex18-label-2b']
|
||||
});
|
||||
|
||||
$('#ex22').slider({
|
||||
id: 'slider22',
|
||||
min: 0,
|
||||
max: 20,
|
||||
step: 1,
|
||||
value: 14,
|
||||
rangeHighlights: [{ start: 2, end: 5, class: "category1" },
|
||||
{ start: 7, end: 8, class: "category2" },
|
||||
{ start: 17, end: 19 },
|
||||
{ start: 17, end: 24 },
|
||||
{ start: -3, end: 19 }]});
|
||||
|
||||
$("#ex23").slider({
|
||||
ticks: [0, 1, 2, 3, 4],
|
||||
ticks_positions: [0, 30, 60, 70, 90, 100],
|
||||
ticks_snap_bounds: 200,
|
||||
formatter(value) {
|
||||
return 'Current value: ' + value;
|
||||
},
|
||||
ticks_tooltip: true,
|
||||
step: 0.01
|
||||
});
|
||||
|
||||
// examples from https://github.com/seiyria/bootstrap-slider/blob/master/README.md
|
||||
|
||||
{
|
||||
|
||||
Vendored
+61
-9
@@ -1,4 +1,4 @@
|
||||
// Type definitions for bootstrap-slider.js 9.8
|
||||
// Type definitions for bootstrap-slider.js 9.9
|
||||
// Project: https://github.com/seiyria/bootstrap-slider
|
||||
// Definitions by: Daniel Beckwith <https://github.com/dbeckwith>
|
||||
// Leonard Thieu <https://github.com/leonard-thieu>
|
||||
@@ -7,6 +7,19 @@
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
interface RangeHighlight {
|
||||
class?: string;
|
||||
start?: number;
|
||||
end?: number;
|
||||
}
|
||||
|
||||
type SliderEventType = 'slide' |
|
||||
'slideStart' |
|
||||
'slideStop' |
|
||||
'change' |
|
||||
'slideEnabled' |
|
||||
'slideDisabled';
|
||||
|
||||
interface SliderOptions {
|
||||
/**
|
||||
* Default: ''
|
||||
@@ -63,6 +76,14 @@ interface SliderOptions {
|
||||
* if false show one tootip if true show two tooltips one for each handler
|
||||
*/
|
||||
tooltip_split?: boolean;
|
||||
/**
|
||||
* Default: null
|
||||
* Position of tooltip, relative to slider. Accepts 'top'/'bottom' for
|
||||
* horizontal sliders and 'left'/'right' for vertically orientated sliders.
|
||||
* Default positions are 'top' for horizontal and 'right' for vertical
|
||||
* slider.
|
||||
*/
|
||||
tooltip_position?: 'top' | 'bottom' | 'left' | 'right';
|
||||
/**
|
||||
* Default: 'round'
|
||||
* handle shape. Accepts: 'round', 'square', 'triangle' or 'custom'
|
||||
@@ -73,6 +94,10 @@ interface SliderOptions {
|
||||
* whether or not the slider should be reversed
|
||||
*/
|
||||
reversed?: boolean;
|
||||
/**
|
||||
* Default: 'auto'
|
||||
*/
|
||||
rtl?: boolean | 'auto';
|
||||
/**
|
||||
* Default: true
|
||||
* whether or not the slider is initially enabled
|
||||
@@ -111,16 +136,34 @@ interface SliderOptions {
|
||||
* Used to define the snap bounds of a tick. Snaps to the tick if value is within these bounds.
|
||||
*/
|
||||
ticks_snap_bounds?: number;
|
||||
/**
|
||||
* Default: false
|
||||
* Used to allow for a user to hover over a given tick to see it's value.
|
||||
* Useful if custom formatter passed in
|
||||
*/
|
||||
ticks_tooltip?: boolean;
|
||||
/**
|
||||
* Default: 'linear'
|
||||
* Set to 'logarithmic' to use a logarithmic scale.
|
||||
*/
|
||||
scale?: string;
|
||||
scale?: 'linear' | 'logarithmic';
|
||||
/**
|
||||
* Default: false
|
||||
* Focus the appropriate slider handle after a value change.
|
||||
*/
|
||||
focus?: boolean;
|
||||
/**
|
||||
* Default: null
|
||||
* ARIA labels for the slider handle's, Use array for multiple values in a
|
||||
* range slider.
|
||||
*/
|
||||
labelledby?: string | string[];
|
||||
/**
|
||||
* Default: []
|
||||
* Defines a range array that you want to highlight, for example:
|
||||
* [{'start':val1, 'end': val2, 'class': 'optionalAdditionalClassName'}].
|
||||
*/
|
||||
rangeHighlights?: RangeHighlight[];
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
@@ -134,7 +177,6 @@ interface SliderPlugin<TJQuery> {
|
||||
(methodName: string, ...args: any[]): TJQuery;
|
||||
/**
|
||||
* Creates a slider from the current element.
|
||||
* @param options
|
||||
*/
|
||||
(options?: SliderOptions): TJQuery;
|
||||
}
|
||||
@@ -163,11 +205,12 @@ declare class Slider {
|
||||
/**
|
||||
* Set a new value for the slider. If optional triggerSlideEvent parameter is true, 'slide' events will be triggered.
|
||||
* If optional triggerChangeEvent parameter is true, 'change' events will be triggered.
|
||||
* @param newValue
|
||||
* @param triggerSlideEvent
|
||||
* @param triggerChangeEvent
|
||||
*/
|
||||
setValue(newValue: number, triggerSlideEvent?: boolean, triggerChangeEvent?: boolean): this;
|
||||
/**
|
||||
* Get the div slider element
|
||||
*/
|
||||
getElement(): HTMLDivElement;
|
||||
/**
|
||||
* Properly clean up and remove the slider instance
|
||||
*/
|
||||
@@ -180,25 +223,34 @@ declare class Slider {
|
||||
* Enables the slider
|
||||
*/
|
||||
enable(): this;
|
||||
/**
|
||||
* Toggles the slider between enabled and disabled
|
||||
*/
|
||||
toggle(): this;
|
||||
/**
|
||||
* Returns true if enabled, false if disabled
|
||||
*/
|
||||
isEnabled(): boolean;
|
||||
/**
|
||||
* Updates the slider's attributes
|
||||
* @param attribute
|
||||
* @param value
|
||||
*/
|
||||
setAttribute(attribute: string, value: any): this;
|
||||
/**
|
||||
* Get the slider's attributes
|
||||
* @param attribute
|
||||
*/
|
||||
getAttribute(attribute: string): any;
|
||||
/**
|
||||
* Refreshes the current slider
|
||||
*/
|
||||
refresh(): this;
|
||||
/**
|
||||
* When the slider event eventType is triggered, the callback function will be invoked
|
||||
*/
|
||||
on(eventType: SliderEventType, callback: (val: number | undefined) => void): this;
|
||||
/**
|
||||
* Removes the callback function from the slider event eventType
|
||||
*/
|
||||
off(eventType: SliderEventType, callback: (val: number | undefined) => void): void;
|
||||
/**
|
||||
* Renders the tooltip again, after initialization. Useful in situations when the slider and tooltip are initially hidden.
|
||||
*/
|
||||
|
||||
+112
-57
@@ -24,7 +24,8 @@ export interface Datetimepicker {
|
||||
clear(): void;
|
||||
/** Returns the component's model current date, a moment object or null if not set. */
|
||||
date(): moment.Moment;
|
||||
/** Takes string, Date, moment, null parameter and sets the components model current moment to it.
|
||||
/**
|
||||
* Takes string, Date, moment, null parameter and sets the components model current moment to it.
|
||||
* Passing a null value unsets the components model current moment.
|
||||
* Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.
|
||||
* Throws:
|
||||
@@ -36,14 +37,16 @@ export interface Datetimepicker {
|
||||
date(date: moment.Moment | Date | string | null): void;
|
||||
/** Destroys the widget and removes all attached event listeners */
|
||||
destroy(): void;
|
||||
/** Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden.
|
||||
/**
|
||||
* Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden.
|
||||
* Emits:
|
||||
* - dp.hide - if the widget was visible before that call
|
||||
*/
|
||||
disable(): void;
|
||||
/** Enables the input element, the component is attached to, by removing disabled attribute from it. */
|
||||
enable(): void;
|
||||
/** Hides the widget
|
||||
/**
|
||||
* Hides the widget
|
||||
* Emits:
|
||||
* - dp.hide - if the widget was visible before that call
|
||||
*/
|
||||
@@ -55,13 +58,15 @@ export interface Datetimepicker {
|
||||
options(): DatetimepickerOptions;
|
||||
/** Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component. */
|
||||
options(options: DatetimepickerOptions): void;
|
||||
/** Shows the widget
|
||||
/**
|
||||
* Shows the widget
|
||||
* Emits:
|
||||
* - dp.show - if the widget was hidden before that call
|
||||
* - dp.change - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value
|
||||
*/
|
||||
show(): void;
|
||||
/** Shows or hides the widget
|
||||
/**
|
||||
* Shows or hides the widget
|
||||
* Emits:
|
||||
* - dp.hide - if the widget is hidden after the toggle call
|
||||
* - dp.show - if the widget is show after the toggle call
|
||||
@@ -90,7 +95,8 @@ export interface Datetimepicker {
|
||||
* IMPORTANT! Throws exception if not set explicitly https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1459
|
||||
*/
|
||||
daysOfWeekDisabled(): number[];
|
||||
/** Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array.
|
||||
/**
|
||||
* Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array.
|
||||
* This has lower priority over the options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration settings.
|
||||
* Emits:
|
||||
* - dp.change - if the currently selected moment falls in the values passed on the daysOfWeek parameter.
|
||||
@@ -133,13 +139,15 @@ export interface Datetimepicker {
|
||||
* Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false.
|
||||
*/
|
||||
disabledHours(value: boolean | number[]): void;
|
||||
/** Returns the options.disabledTimeIntervals option, or... not exactly
|
||||
/**
|
||||
* Returns the options.disabledTimeIntervals option, or... not exactly
|
||||
* IMPORTANT! Creates an object from the options.disabledTimeIntervals with the keys being numbers, the values being the moment arrays.
|
||||
* eg { "0": [<moment.Moment1>, <moment.Moment2>], "1": [...] }
|
||||
* https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1498
|
||||
*/
|
||||
disabledTimeIntervals(): boolean | moment.Moment[][];
|
||||
/** Disables time selection between the given moments
|
||||
/**
|
||||
* Disables time selection between the given moments
|
||||
* eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]
|
||||
*/
|
||||
disabledTimeIntervals(value: boolean | moment.Moment[][]): void;
|
||||
@@ -148,7 +156,8 @@ export interface Datetimepicker {
|
||||
* NOTES: probably should be: enabledDates(): boolean | Array<moment.Moment>; see: DatetimepickerOptions
|
||||
*/
|
||||
enabledDates(): boolean | any;
|
||||
/** Takes an array of values and allows the user to select only from those days.
|
||||
/**
|
||||
* Takes an array of values and allows the user to select only from those days.
|
||||
* Setting this takes precedence over options.minDate, options.maxDate configuration.
|
||||
* Also calling this function removes the configuration of options.disabledDates if such exist.
|
||||
* Note: These values are matched with Day granularity.
|
||||
@@ -174,7 +183,8 @@ export interface Datetimepicker {
|
||||
focusOnShow(value: boolean): void;
|
||||
/** Returns the component's options.format string */
|
||||
format(): boolean | string | moment.MomentBuiltinFormat;
|
||||
/** Takes a moment.js format string and sets the components options.format.
|
||||
/**
|
||||
* Takes a moment.js format string and sets the components options.format.
|
||||
* This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function.
|
||||
* The parameter can also be a boolean:false in which case the format is set to the locale's L LT.
|
||||
* Note: this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if "a" or "h" exists in the passed string then a 12 hour mode is set)
|
||||
@@ -184,7 +194,8 @@ export interface Datetimepicker {
|
||||
format(format: boolean | string | moment.MomentBuiltinFormat): void;
|
||||
/** Returns options.icons */
|
||||
icons(): Icons;
|
||||
/** Takes an Object of strings.
|
||||
/**
|
||||
* Takes an Object of strings.
|
||||
* Throws:
|
||||
* - TypeError - if icons parameter is not an Object
|
||||
*/
|
||||
@@ -209,14 +220,16 @@ export interface Datetimepicker {
|
||||
keyBinds(value: any): void;
|
||||
/** Returns the currently set locale of the options.locale */
|
||||
locale(): string;
|
||||
/** Takes a string of any valid moment locale e.g. de for German.
|
||||
/**
|
||||
* Takes a string of any valid moment locale e.g. de for German.
|
||||
* Throws:
|
||||
* - TypeError - if the locale is not loaded via a separate script or moment-with-locale
|
||||
*/
|
||||
locale(newLocale: string): void;
|
||||
/** Returns the currently set moment of the options.maxDate or false if not set */
|
||||
maxDate(): moment.Moment | boolean;
|
||||
/** Takes a parameter and disallows the user to select a moment that is after that moment.
|
||||
/**
|
||||
* Takes a parameter and disallows the user to select a moment that is after that moment.
|
||||
* If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select.
|
||||
* Note: If the parameter is before the currently selected moment the currently selected moment changes to maxDate
|
||||
* Throws:
|
||||
@@ -230,7 +243,8 @@ export interface Datetimepicker {
|
||||
maxDate(date: moment.Moment | Date | string | boolean): void;
|
||||
/** Returns the currently set moment of the options.minDate or false if not set */
|
||||
minDate(): moment.Moment | boolean;
|
||||
/** Takes a parameter and disallows the user to select a moment that is before that moment.
|
||||
/**
|
||||
* Takes a parameter and disallows the user to select a moment that is before that moment.
|
||||
* If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the miminum moment the user can select.
|
||||
* Note: If the parameter is after the currently selected moment the currently selected moment changes to minDate parameter
|
||||
* Throws:
|
||||
@@ -244,7 +258,8 @@ export interface Datetimepicker {
|
||||
minDate(date: moment.Moment | Date | string | boolean): void;
|
||||
/** Returns the options.parseInputDate option */
|
||||
parseInputDate(): InputParser | undefined;
|
||||
/** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago".
|
||||
/**
|
||||
* Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago".
|
||||
* {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate}
|
||||
*/
|
||||
parseInputDate(value: InputParser): void;
|
||||
@@ -270,14 +285,16 @@ export interface Datetimepicker {
|
||||
stepping(step: number): void;
|
||||
/** Returns a string of options.timeZone */
|
||||
timeZone(): string | null;
|
||||
/** Takes a null or a string of a valid timezone.
|
||||
/**
|
||||
* Takes a null or a string of a valid timezone.
|
||||
* Throws:
|
||||
* - TypeError - if tooltips parameter is not a string or null
|
||||
*/
|
||||
timeZone(timeZone: string | null): void;
|
||||
/** Returns the options.toolbarplacement option. */
|
||||
toolbarPlacement(): string;
|
||||
/** Changes the placement of the toolbar where the today, clear, component switch icon are located.
|
||||
/**
|
||||
* Changes the placement of the toolbar where the today, clear, component switch icon are located.
|
||||
* See valid values at DatetimepickerOptions.toolbarplacement
|
||||
* Throws:
|
||||
* - TypeError - if the parameter is not a valid value
|
||||
@@ -285,14 +302,16 @@ export interface Datetimepicker {
|
||||
toolbarPlacement(value: string): void;
|
||||
/** Returns the options.tooltips option */
|
||||
tooltips(): Tooltips;
|
||||
/** Sets the tooltips for icons.
|
||||
/**
|
||||
* Sets the tooltips for icons.
|
||||
* Throws:
|
||||
* - TypeError - if tooltips parameter is not an Object
|
||||
*/
|
||||
tooltips(value: Tooltips): void;
|
||||
/** Returns the options.useCurrent option configuration */
|
||||
useCurrent(): boolean | string;
|
||||
/** Takes a boolean or string.
|
||||
/**
|
||||
* Takes a boolean or string.
|
||||
* If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to)
|
||||
* then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action.
|
||||
* If a false boolean is passed then no initialization happens on the input element.
|
||||
@@ -312,7 +331,8 @@ export interface Datetimepicker {
|
||||
viewDate(value: string | Date | moment.Moment | boolean): void;
|
||||
/** Returns the options.viewMode. */
|
||||
viewMode(): string;
|
||||
/** Takes a string. See valid values at DatetimepickerOptions.viewMode
|
||||
/**
|
||||
* Takes a string. See valid values at DatetimepickerOptions.viewMode
|
||||
* Throws:
|
||||
* - TypeError - if the parameter is not a string or not a valid value
|
||||
*/
|
||||
@@ -323,7 +343,8 @@ export interface Datetimepicker {
|
||||
widgetParent(widgetParent: string | JQuery | null): void;
|
||||
/** Returns the options.widgetPositioning object */
|
||||
widgetPositioning(): WidgetPositioningOptions;
|
||||
/** WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to.
|
||||
/**
|
||||
* WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to.
|
||||
* "auto" is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user.
|
||||
* Usually you should not override those options unless you have a special need in your layout.
|
||||
*/
|
||||
@@ -331,7 +352,6 @@ export interface Datetimepicker {
|
||||
|
||||
/**
|
||||
* JQuery plugin function.
|
||||
* @param {DatetimepickerOptions} options
|
||||
*/
|
||||
(options?: DatetimepickerOptions): JQuery;
|
||||
|
||||
@@ -343,91 +363,109 @@ export interface Datetimepicker {
|
||||
}
|
||||
|
||||
export interface DatetimepickerOptions {
|
||||
/** If true, the picker will show on textbox focus and icon click when used in a button group
|
||||
/**
|
||||
* If true, the picker will show on textbox focus and icon click when used in a button group
|
||||
* @default: false
|
||||
*/
|
||||
allowInputToggle?: boolean;
|
||||
/** Shows the week of the year to the left of first day of the week.
|
||||
/**
|
||||
* Shows the week of the year to the left of first day of the week.
|
||||
* @default: false
|
||||
*/
|
||||
calendarWeeks?: boolean;
|
||||
/** Using a Bootstraps collapse to switch between date/time pickers.
|
||||
/**
|
||||
* Using a Bootstraps collapse to switch between date/time pickers.
|
||||
* @default: true
|
||||
*/
|
||||
collapse?: boolean;
|
||||
/** Disables the section of days of the week, e.g. weekends.
|
||||
/**
|
||||
* Disables the section of days of the week, e.g. weekends.
|
||||
* Accepts: array of numbers from 0-6
|
||||
* @default: false
|
||||
*/
|
||||
daysOfWeekDisabled?: number[] | boolean;
|
||||
/** Changes the heading of the datepicker when in "days" view.
|
||||
/**
|
||||
* Changes the heading of the datepicker when in "days" view.
|
||||
* @default: "MMMM YYYY"
|
||||
*/
|
||||
dayViewHeaderFormat?: string;
|
||||
/** Will cause the date picker to stay open after a blur event.
|
||||
/**
|
||||
* Will cause the date picker to stay open after a blur event.
|
||||
* @default: false
|
||||
*/
|
||||
debug?: boolean;
|
||||
/** Sets the picker default date/time. Overrides useCurrent
|
||||
/**
|
||||
* Sets the picker default date/time. Overrides useCurrent
|
||||
* @default: false
|
||||
*/
|
||||
defaultDate?: boolean | moment.Moment | Date | string;
|
||||
/** Disables selection of dates in the array, e.g. holidays
|
||||
/**
|
||||
* Disables selection of dates in the array, e.g. holidays
|
||||
* @default: false
|
||||
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
|
||||
* eg disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true }
|
||||
* https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499
|
||||
*/
|
||||
disabledDates?: boolean | Array<moment.Moment | Date | string> | any;
|
||||
/** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days
|
||||
/**
|
||||
* Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days
|
||||
* @default: false
|
||||
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true.
|
||||
* eg disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true }
|
||||
* https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499
|
||||
*/
|
||||
disabledHours?: boolean | number[] | any;
|
||||
/** Disables time selection between the given moments
|
||||
/**
|
||||
* Disables time selection between the given moments
|
||||
* eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]]
|
||||
* @default: false
|
||||
*/
|
||||
disabledTimeIntervals?: boolean | moment.Moment[][];
|
||||
/** Disables selection of dates NOT in the array, e.g. holidays
|
||||
/**
|
||||
* Disables selection of dates NOT in the array, e.g. holidays
|
||||
* @default: false
|
||||
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true.
|
||||
* eg enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true }
|
||||
* https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499
|
||||
*/
|
||||
enabledDates?: boolean | Array<moment.Moment | Date | string> | any;
|
||||
/** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days
|
||||
/**
|
||||
* Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days
|
||||
* @default: false
|
||||
* IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true.
|
||||
* eg enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true }
|
||||
* https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499
|
||||
*/
|
||||
enabledHours?: boolean | number[];
|
||||
/** Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666
|
||||
/**
|
||||
* Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666
|
||||
* @default: false
|
||||
*/
|
||||
extraFormats?: boolean | Array<string | moment.MomentBuiltinFormat>;
|
||||
/** If false, the textbox will not be given focus when the picker is shown
|
||||
/**
|
||||
* If false, the textbox will not be given focus when the picker is shown
|
||||
* @default: true
|
||||
*/
|
||||
focusOnShow?: boolean;
|
||||
/** See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker.
|
||||
/**
|
||||
* See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker.
|
||||
* @default: false
|
||||
*/
|
||||
format?: boolean | string | moment.MomentBuiltinFormat;
|
||||
/** Change the default icons for the pickers functions. */
|
||||
icons?: Icons;
|
||||
/** Allow date picker show event to fire even when the associated input element has the readonly="readonly"property.
|
||||
/**
|
||||
* Allow date picker show event to fire even when the associated input element has the readonly="readonly"property.
|
||||
* @default: false
|
||||
*/
|
||||
ignoreReadonly?: boolean;
|
||||
/** Will display the picker inline without the need of a input field. This will also hide borders and shadows.
|
||||
/**
|
||||
* Will display the picker inline without the need of a input field. This will also hide borders and shadows.
|
||||
* @default: false
|
||||
*/
|
||||
inline?: boolean;
|
||||
/** Allows for custom events to fire on keyboard press.
|
||||
/**
|
||||
* Allows for custom events to fire on keyboard press.
|
||||
* eg: keybinds: {
|
||||
* up: (widget) => console.log(widget),
|
||||
* "control up": (widget) => console.log(widget)
|
||||
@@ -435,52 +473,63 @@ export interface DatetimepickerOptions {
|
||||
* The widget parameter is false, if the datepicker is closed.
|
||||
*/
|
||||
keyBinds?: { [key: string]: (widget: boolean | JQuery) => void };
|
||||
/** Will cause the date picker to not revert or overwrite invalid dates.
|
||||
/**
|
||||
* Will cause the date picker to not revert or overwrite invalid dates.
|
||||
* @default: false
|
||||
*/
|
||||
keepInvalid?: boolean;
|
||||
/** Will cause the date picker to stay open after selecting a date if no time components are being used.
|
||||
/**
|
||||
* Will cause the date picker to stay open after selecting a date if no time components are being used.
|
||||
* @default: false
|
||||
*/
|
||||
keepOpen?: boolean;
|
||||
/** See momentjs for valid locales. You must include moment-with-locales.js or a local js file.
|
||||
/**
|
||||
* See momentjs for valid locales. You must include moment-with-locales.js or a local js file.
|
||||
* @default: moment.locale()
|
||||
*/
|
||||
locale?: string;
|
||||
/** Prevents date/time selections after this date.
|
||||
/**
|
||||
* Prevents date/time selections after this date.
|
||||
* maxDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected.
|
||||
* @default: false
|
||||
*/
|
||||
maxDate?: boolean | moment.Moment | Date | string;
|
||||
/** Prevents date/time selections before this date.
|
||||
/**
|
||||
* Prevents date/time selections before this date.
|
||||
* minDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected.
|
||||
* @default: false
|
||||
*/
|
||||
minDate?: boolean | moment.Moment | Date | string;
|
||||
/** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago".
|
||||
/**
|
||||
* Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago".
|
||||
* {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate}
|
||||
*/
|
||||
parseInputDate?: InputParser;
|
||||
/** Show the "Clear" button in the icon toolbar.
|
||||
/**
|
||||
* Show the "Clear" button in the icon toolbar.
|
||||
* Clicking the "Clear" button will set the calendar to null.
|
||||
* @default: false
|
||||
*/
|
||||
showClear?: boolean;
|
||||
/** Show the "Close" button in the icon toolbar.
|
||||
/**
|
||||
* Show the "Close" button in the icon toolbar.
|
||||
* Clicking the "Close" button will call hide()
|
||||
* @default: false
|
||||
*/
|
||||
showClose?: boolean;
|
||||
/** Show the "Today" button in the icon toolbar.
|
||||
/**
|
||||
* Show the "Today" button in the icon toolbar.
|
||||
* Clicking the "Today" button will set the calendar view and set the date to now.
|
||||
* @default: false
|
||||
*/
|
||||
showTodayButton?: boolean;
|
||||
/** Shows the picker side by side when using the time and date together.
|
||||
/**
|
||||
* Shows the picker side by side when using the time and date together.
|
||||
* @default: false
|
||||
*/
|
||||
sideBySide?: boolean;
|
||||
/** Number of minutes the up/down arrow's will move the minutes value in the time picker
|
||||
/**
|
||||
* Number of minutes the up/down arrow's will move the minutes value in the time picker
|
||||
* @default: 1
|
||||
*/
|
||||
stepping?: number;
|
||||
@@ -489,30 +538,36 @@ export interface DatetimepickerOptions {
|
||||
* @default: ""
|
||||
*/
|
||||
timeZone?: string | null;
|
||||
/** Changes the placement of the icon toolbar.
|
||||
/**
|
||||
* Changes the placement of the icon toolbar.
|
||||
* @default: "default"
|
||||
*/
|
||||
toolbarPlacement?: "default" | "top" | "bottom";
|
||||
/** This will change the tooltips over each icon to a custom string */
|
||||
tooltips?: Tooltips;
|
||||
/** On show, will set the picker to the current date/time
|
||||
/**
|
||||
* On show, will set the picker to the current date/time
|
||||
* @default: true
|
||||
*/
|
||||
useCurrent?: boolean;
|
||||
/** Defines if moment should use strict date parsing when considering a date to be valid
|
||||
/**
|
||||
* Defines if moment should use strict date parsing when considering a date to be valid
|
||||
* @default: false
|
||||
*/
|
||||
useStrict?: boolean;
|
||||
/** This will change the viewDate without changing or setting the selected date.
|
||||
/**
|
||||
* This will change the viewDate without changing or setting the selected date.
|
||||
* @default: false
|
||||
*/
|
||||
viewDate?: boolean | moment.Moment | Date | string;
|
||||
/** The default view to display when the picker is shown.
|
||||
/**
|
||||
* The default view to display when the picker is shown.
|
||||
* Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY
|
||||
* @default: "days"
|
||||
*/
|
||||
viewMode?: "decades" | "years" | "months" | "days";
|
||||
/** On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative"
|
||||
/**
|
||||
* On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative"
|
||||
* @default: null
|
||||
*/
|
||||
widgetParent?: string | JQuery | null;
|
||||
|
||||
Vendored
+2
-2
@@ -88,13 +88,13 @@ declare namespace Bull {
|
||||
|
||||
/**
|
||||
* Removes a job from the queue and from any lists it may be included in.
|
||||
* @returns {Promise} A promise that resolves when the job is removed.
|
||||
* @returns A promise that resolves when the job is removed.
|
||||
*/
|
||||
remove(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Re-run a job that has failed.
|
||||
* @returns {Promise} A promise that resolves when the job is scheduled for retry.
|
||||
* @returns A promise that resolves when the job is scheduled for retry.
|
||||
*/
|
||||
retry(): Promise<void>;
|
||||
|
||||
|
||||
Vendored
+8
-11
@@ -17,8 +17,8 @@ declare namespace bunnymq {
|
||||
/**
|
||||
* Handle messages from a named queue.
|
||||
*
|
||||
* @param {string} queue A named queue.
|
||||
* @param {ConsumerCallback} callback A callback.
|
||||
* @param queue A named queue.
|
||||
* @param callback A callback.
|
||||
*/
|
||||
consume<T>(queue: string, callback: ConsumerCallback<T>): void;
|
||||
}
|
||||
@@ -31,16 +31,15 @@ declare namespace bunnymq {
|
||||
/**
|
||||
* Subscriber to handle messages from a named queue.
|
||||
*
|
||||
* @param {string} queue A named queue.
|
||||
* @param {ConsumerCallback} callback A callback.
|
||||
* @param queue A named queue.
|
||||
* @param callback A callback.
|
||||
*/
|
||||
subscribe<T>(queueName: string, callback: ConsumerCallback<T>): void;
|
||||
|
||||
/**
|
||||
* Publisher to send messages to a named queue.
|
||||
*
|
||||
* @type {Producer}
|
||||
* @return {Promise} The consumer response.
|
||||
* @return The consumer response.
|
||||
*/
|
||||
publish<T>(queueName: string, message: any, options?: ProducerOptions): Promise<T>;
|
||||
}
|
||||
@@ -61,14 +60,12 @@ declare namespace bunnymq {
|
||||
/**
|
||||
* Number of fetched messages at once on the channel.
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
prefetch?: number;
|
||||
|
||||
/**
|
||||
* Requeue put back message into the broker if consumer crashes/trigger exception.
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
requeue?: boolean;
|
||||
rpcTimeout?: number;
|
||||
@@ -80,9 +77,9 @@ declare namespace bunnymq {
|
||||
/**
|
||||
* Send messages to a named queue.
|
||||
*
|
||||
* @param {string} queue A named queue.
|
||||
* @param {any} message A message.
|
||||
* @return {Promise} The consumer response.
|
||||
* @param queue A named queue.
|
||||
* @param message A message.
|
||||
* @return The consumer response.
|
||||
*/
|
||||
produce<T>(queue: string, message: any, options?: ProducerOptions): Promise<T>;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -7,8 +7,8 @@ import * as Logger from "bunyan";
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param {string} [name] name of the blackhole Logger
|
||||
* @return {Logger} A bunyan logger .
|
||||
* @param name name of the blackhole Logger
|
||||
* @return A bunyan logger .
|
||||
*/
|
||||
declare function bunyanBlackHole(name: string): Logger;
|
||||
export = bunyanBlackHole;
|
||||
|
||||
Vendored
+6
-27
@@ -9,12 +9,7 @@
|
||||
declare global {
|
||||
namespace Chai {
|
||||
interface Assertion {
|
||||
/**
|
||||
* Assert that the object matches the snapshot
|
||||
* @param snapshotFilename
|
||||
* @param snapshotName
|
||||
* @param update
|
||||
*/
|
||||
/** Assert that the object matches the snapshot */
|
||||
matchSnapshot(snapshotFilename?: string, snapshotName?: string, update?: boolean): Assertion;
|
||||
matchSnapshot(update: boolean): Assertion;
|
||||
}
|
||||
@@ -22,40 +17,24 @@ declare global {
|
||||
}
|
||||
|
||||
interface ChaiJestSnapshot {
|
||||
/**
|
||||
* Chai bootstrapper
|
||||
* @param chai
|
||||
* @param utils
|
||||
*/
|
||||
/** Chai bootstrapper */
|
||||
(chai: any, utils: any): void;
|
||||
|
||||
/**
|
||||
* Set snapshot file name
|
||||
* @param filename
|
||||
*/
|
||||
/** Set snapshot file name */
|
||||
setFileName(filename: string): void;
|
||||
|
||||
/**
|
||||
* Set snapshot test name
|
||||
* @param testname
|
||||
*/
|
||||
setTestName(testname: string): void;
|
||||
|
||||
/**
|
||||
* Configure snapshot name using mocha context
|
||||
* @param context
|
||||
*/
|
||||
/** Configure snapshot name using mocha context */
|
||||
configureUsingMochaContext(context: Mocha.IBeforeAndAfterContext): void;
|
||||
|
||||
/**
|
||||
* Reset snapshot registry
|
||||
*/
|
||||
/** Reset snapshot registry */
|
||||
resetSnapshotRegistry(): void;
|
||||
|
||||
/**
|
||||
* Add a serializer plugin
|
||||
* @param serializer
|
||||
*/
|
||||
/** Add a serializer plugin */
|
||||
addSerializer(serializer: any): void;
|
||||
}
|
||||
|
||||
|
||||
Vendored
-3
@@ -34,9 +34,6 @@ declare namespace chroma {
|
||||
/**
|
||||
* Create a color in the specified color space using a, b and c as values.
|
||||
*
|
||||
* @param a
|
||||
* @param b
|
||||
* @param c
|
||||
* @param colorSpace The color space to use. Defaults to "rgb".
|
||||
* @return the color object.
|
||||
*/
|
||||
|
||||
Vendored
+7
-8
@@ -8,7 +8,7 @@ declare class Clipboard {
|
||||
|
||||
/**
|
||||
* Subscribes to events that indicate the result of a copy/cut operation.
|
||||
* @param type {"success" | "error"} Event type ('success' or 'error').
|
||||
* @param type Event type ('success' or 'error').
|
||||
* @param handler Callback function.
|
||||
*/
|
||||
on(type: "success" | "error", handler: (e: Clipboard.Event) => void): this;
|
||||
@@ -29,22 +29,21 @@ declare namespace Clipboard {
|
||||
interface Options {
|
||||
/**
|
||||
* Overwrites default command ('cut' or 'copy').
|
||||
* @param {Element} elem Current element
|
||||
* @returns {String} Only 'cut' or 'copy'.
|
||||
* @param elem Current element
|
||||
*/
|
||||
action?(elem: Element): string;
|
||||
action?(elem: Element): "cut" | "copy";
|
||||
|
||||
/**
|
||||
* Overwrites default target input element.
|
||||
* @param {Element} elem Current element
|
||||
* @returns {Element} <input> element to use.
|
||||
* @param elem Current element
|
||||
* @returns <input> element to use.
|
||||
*/
|
||||
target?(elem: Element): Element;
|
||||
|
||||
/**
|
||||
* Returns the explicit text to copy.
|
||||
* @param {Element} elem Current element
|
||||
* @returns {String} Text to be copied.
|
||||
* @param elem Current element
|
||||
* @returns Text to be copied.
|
||||
*/
|
||||
text?(elem: Element): string;
|
||||
}
|
||||
|
||||
Vendored
+11
-7
@@ -3,13 +3,15 @@
|
||||
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** Add source maps of multiple files, offset them and then combine them into one source map.
|
||||
/**
|
||||
* Add source maps of multiple files, offset them and then combine them into one source map.
|
||||
* (documentation based on project's README file)
|
||||
*/
|
||||
declare class Combiner {
|
||||
constructor(file?: string, sourceRoot?: string);
|
||||
|
||||
/** Adds map to underlying source map.
|
||||
/**
|
||||
* Adds map to underlying source map.
|
||||
* If source contains a source map comment that has the source of the original file inlined it will offset these
|
||||
* mappings and include them.
|
||||
* If no source map comment is found or it has no source inlined, mappings for the file will be generated and included
|
||||
@@ -18,12 +20,14 @@ declare class Combiner {
|
||||
*/
|
||||
addFile(opts: { sourceFile: string; source: string }, offset?: Combiner.Offset): Combiner;
|
||||
|
||||
/** output the combined source map in base64 format
|
||||
/**
|
||||
* output the combined source map in base64 format
|
||||
* @return base64 encoded combined source map
|
||||
*/
|
||||
base64(): string;
|
||||
|
||||
/** generate a base64 encoded sourceMappingURL comment
|
||||
/**
|
||||
* generate a base64 encoded sourceMappingURL comment
|
||||
* @return base64 encoded sourceMappingUrl comment of the combined source map
|
||||
*/
|
||||
comment(): string;
|
||||
@@ -40,15 +44,15 @@ declare namespace Combiner {
|
||||
column?: number;
|
||||
}
|
||||
|
||||
/** Create a source map combiner that accepts multiple files, offsets them and then combines them into one source map.
|
||||
/**
|
||||
* Create a source map combiner that accepts multiple files, offsets them and then combines them into one source map.
|
||||
* @param file optional name of the generated file
|
||||
* @param sourceRoot optional sourceRoot of the map to be generated
|
||||
* @return Combiner instance to which source maps can be added and later combined
|
||||
*/
|
||||
function create(file?: string, sourceRoot?: string): Combiner;
|
||||
|
||||
/** removeComments
|
||||
* @param src
|
||||
/**
|
||||
* @return src with all sourceMappingUrl comments removed
|
||||
*/
|
||||
function removeComments(src: string): string;
|
||||
|
||||
Vendored
+12
-6
@@ -3,7 +3,8 @@
|
||||
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar>, Melvin Groenhoff <https://github.com/mgroenhoff>, TeamworkGuy2 <https://github.com/TeamworkGuy2>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** Converts a source-map from/to different formats and allows adding/changing properties.
|
||||
/**
|
||||
* Converts a source-map from/to different formats and allows adding/changing properties.
|
||||
* (documentation based on project's README file)
|
||||
*/
|
||||
export interface SourceMapConverter {
|
||||
@@ -19,7 +20,8 @@ export interface SourceMapConverter {
|
||||
/** Converts source map to base64 encoded json string */
|
||||
toBase64(): string;
|
||||
|
||||
/** Converts source map to an inline comment that can be appended to the source-file.
|
||||
/**
|
||||
* Converts source map to an inline comment that can be appended to the source-file.
|
||||
* By default, the comment is formatted like: //# sourceMappingURL=..., which you would normally see in a JS source file.
|
||||
* When options.multiline == true, the comment is formatted like: /*# sourceMappingURL=... *\/, which you would find in a CSS source file
|
||||
*/
|
||||
@@ -47,16 +49,19 @@ export function fromBase64(base64: string): SourceMapConverter;
|
||||
/** Returns source map converter from given base64 encoded json string prefixed with //# sourceMappingURL=... */
|
||||
export function fromComment(comment: string): SourceMapConverter;
|
||||
|
||||
/** Returns source map converter from given filename by parsing //# sourceMappingURL=filename.
|
||||
/**
|
||||
* Returns source map converter from given filename by parsing //# sourceMappingURL=filename.
|
||||
* filename must point to a file that is found inside the mapFileDir. Most tools store this file right next to the generated file, i.e. the one containing the source map.
|
||||
*/
|
||||
export function fromMapFileComment(comment: string, commentFileDir: string): SourceMapConverter;
|
||||
|
||||
/** Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
|
||||
/**
|
||||
* Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
|
||||
*/
|
||||
export function fromSource(content: string): SourceMapConverter | null;
|
||||
|
||||
/** Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
|
||||
/**
|
||||
* Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
|
||||
* The sourcemap will be read from the map file found by parsing # sourceMappingURL=file comment. For more info see fromMapFileComment.
|
||||
*/
|
||||
export function fromMapFileSource(content: string, commentFileDir: string): SourceMapConverter | null;
|
||||
@@ -73,7 +78,8 @@ export const commentRegex: RegExp;
|
||||
/** Returns a new regex used to find source map comments pointing to map files */
|
||||
export const mapFileCommentRegex: RegExp;
|
||||
|
||||
/** Returns a comment that links to an external source map via file.
|
||||
/**
|
||||
* Returns a comment that links to an external source map via file.
|
||||
* By default, the comment is formatted like: //# sourceMappingURL=..., which you would normally see in a JS source file.
|
||||
* When options.multiline == true, the comment is formatted like: /*# sourceMappingURL=... *\/, which you would find in a CSS source file.
|
||||
*/
|
||||
|
||||
Vendored
+4
-12
@@ -69,48 +69,40 @@ declare namespace convict {
|
||||
* Sets the value of name to value. name can use dot notation to reference
|
||||
* nested values, e.g. "database.port". If objects in the chain don't yet
|
||||
* exist, they will be initialized to empty objects
|
||||
*
|
||||
* @return {Config} instance
|
||||
*/
|
||||
set(name: string, value: any): Config;
|
||||
/**
|
||||
* Loads and merges a JavaScript object into config
|
||||
*
|
||||
* @return {Config} instance
|
||||
*/
|
||||
load(conf: Object): Config;
|
||||
/**
|
||||
* Loads and merges JSON configuration file(s) into config
|
||||
*
|
||||
* @return {Config} instance
|
||||
*/
|
||||
loadFile(files: string | string[]): Config;
|
||||
/**
|
||||
* Validates config against the schema used to initialize it
|
||||
*
|
||||
* @param options
|
||||
*/
|
||||
validate(options?: ValidateOptions): Config;
|
||||
/**
|
||||
* Exports all the properties (that is the keys and their current values) as a {JSON} {Object}
|
||||
* @returns {Object} A {JSON} compliant {Object}
|
||||
* @returns A {JSON} compliant {Object}
|
||||
*/
|
||||
getProperties(): Object;
|
||||
/**
|
||||
* Exports the schema as a {JSON} {Object}
|
||||
* @returns {Object} A {JSON} compliant {Object}
|
||||
* @returns A {JSON} compliant {Object}
|
||||
*/
|
||||
getSchema(): Object;
|
||||
|
||||
/**
|
||||
* Exports all the properties (that is the keys and their current values) as a JSON string.
|
||||
* @returns {String} a string representing this object
|
||||
* @returns A string representing this object
|
||||
*/
|
||||
toString(): string;
|
||||
|
||||
/**
|
||||
* Exports the schema as a JSON string.
|
||||
* @returns {String} a string representing the schema of this {Config}
|
||||
* @returns A string representing the schema of this {Config}
|
||||
*/
|
||||
getSchemaString(): string;
|
||||
}
|
||||
|
||||
Vendored
+1
-9
@@ -3,19 +3,11 @@
|
||||
// Definitions by: François Nguyen <https://github.com/lith-light-g>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Sign the given `val` with `secret`.
|
||||
* @param {string} val
|
||||
* @param {string} secret
|
||||
* @return {string}
|
||||
*/
|
||||
/** Sign the given `val` with `secret`. */
|
||||
export function sign(value: string, secret: string): string;
|
||||
|
||||
/**
|
||||
* Unsign and decode the given `val` with `secret`,
|
||||
* returning `false` if the signature is invalid.
|
||||
* @param {string} val
|
||||
* @param {string} secret
|
||||
* @return {string|boolean}
|
||||
*/
|
||||
export function unsign(value: string, secret: string): string | boolean;
|
||||
|
||||
-18
@@ -6,7 +6,6 @@ interface NativeKeyboard {
|
||||
/**
|
||||
* Show the messenger, the bare minimum which has to be passed to the function is
|
||||
* the onSubmit callback
|
||||
* @param options
|
||||
*/
|
||||
showMessenger(
|
||||
options: NativeKeyboardShowOptions
|
||||
@@ -16,10 +15,6 @@ interface NativeKeyboard {
|
||||
* It's likely your app only has 1 one page where you want to show the messenger,
|
||||
* so you want to hide it when the user navigates away. You can choose to do this
|
||||
* either animated (a quick slide down animation) or not.
|
||||
*
|
||||
* @param options
|
||||
* @param onSuccess
|
||||
* @param onError
|
||||
*/
|
||||
hideMessenger(
|
||||
options?: NativeKeyboardHideOptions,
|
||||
@@ -29,9 +24,6 @@ interface NativeKeyboard {
|
||||
|
||||
/**
|
||||
* Show a previously hidden keyboard
|
||||
*
|
||||
* @param onSuccess
|
||||
* @param onError
|
||||
*/
|
||||
showMessengerKeyboard(
|
||||
onSuccess?: () => void,
|
||||
@@ -40,9 +32,6 @@ interface NativeKeyboard {
|
||||
|
||||
/**
|
||||
* Hide the keyboard, but not the messenger bar
|
||||
*
|
||||
* @param onSuccess
|
||||
* @param onError
|
||||
*/
|
||||
hideMessengerKeyboard(
|
||||
onSuccess?: () => void,
|
||||
@@ -53,10 +42,6 @@ interface NativeKeyboard {
|
||||
* Manipulate the messenger while it's open. For instance if you want to
|
||||
* update the text programmatically based on what the user typed (by responding to
|
||||
* onTextChanged events).
|
||||
*
|
||||
* @param options
|
||||
* @param onSuccess
|
||||
* @param onError
|
||||
*/
|
||||
updateMessenger(
|
||||
options: NativeKeyboardUpdateOptions,
|
||||
@@ -92,7 +77,6 @@ interface NativeKeyboardHideOptions {
|
||||
interface NativeKeyboardShowOptions {
|
||||
/**
|
||||
* Callback function, which is being called as soon as the user submits
|
||||
* @param text
|
||||
*/
|
||||
onSubmit(text: string): void;
|
||||
|
||||
@@ -119,8 +103,6 @@ interface NativeKeyboardShowOptions {
|
||||
/**
|
||||
* Callback function which is being executed as soon as the entered text changes. Will
|
||||
* return the new text
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
onTextChanged?(text: string): void;
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import * as cpx from "cpx";
|
||||
|
||||
const SRC = "**/.js";
|
||||
const DEST = ".tmp/";
|
||||
const callback = (error: Error | null) => { };
|
||||
const ASYNC_OPTIONS: cpx.AsyncOptions = { includeEmptyDirs: true };
|
||||
const SYNC_OPTIONS: cpx.SyncOptions = { preserve: true };
|
||||
const WATCH_OPTIONS: cpx.WatchOptions = { initialCopy: true };
|
||||
|
||||
cpx.copy(SRC, DEST);
|
||||
cpx.copy(SRC, DEST, callback);
|
||||
cpx.copy(SRC, DEST, ASYNC_OPTIONS);
|
||||
cpx.copy(SRC, DEST, ASYNC_OPTIONS, callback);
|
||||
|
||||
cpx.copySync(SRC, DEST, SYNC_OPTIONS);
|
||||
cpx.copySync(SRC, DEST);
|
||||
|
||||
const watch = cpx.watch(SRC, DEST, WATCH_OPTIONS);
|
||||
watch.close();
|
||||
watch.open();
|
||||
watch.on("copy", (x) => x);
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
// Type definitions for cpx 1.5
|
||||
// Project: https://github.com/mysticatea/cpx
|
||||
// Definitions by: Alan Agius <https://github.com/alan-agius4>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as stream from "stream";
|
||||
|
||||
export interface SyncOptions {
|
||||
/** remove files that copied on past before copy. */
|
||||
clean?: boolean;
|
||||
/** Follow symbolic links when copying from them. */
|
||||
dereference?: boolean;
|
||||
/** Copy empty directories which is matched with the glob. */
|
||||
includeEmptyDirs?: boolean;
|
||||
/** Preserve UID, GID, ATIME, and MTIME of files. */
|
||||
preserve?: boolean;
|
||||
/** Do not overwrite files on destination if the source file is older. */
|
||||
update?: boolean;
|
||||
}
|
||||
|
||||
export interface AsyncOptions extends SyncOptions {
|
||||
/** Function that creates a `stream.Transform` object to transform each copying file. */
|
||||
transform?(filepath: string): stream.Transform[];
|
||||
}
|
||||
|
||||
export interface WatchOptions extends AsyncOptions, SyncOptions {
|
||||
/** Flag to not copy at the initial time of watch. */
|
||||
initialCopy?: boolean;
|
||||
}
|
||||
|
||||
export class Watcher extends NodeJS.EventEmitter {
|
||||
constructor(options: WatchOptions);
|
||||
open(): void;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
export function copy(source: string, dest: string, options?: AsyncOptions, callback?: (error: Error | null) => void): void;
|
||||
export function copy(source: string, dest: string, callback?: (error: Error | null) => void): void;
|
||||
|
||||
export function copySync(source: string, dest: string, options?: SyncOptions): void;
|
||||
|
||||
export function watch(source: string, dest: string, options?: WatchOptions): Watcher;
|
||||
@@ -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",
|
||||
"cpx-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as Cropper from 'cropperjs';
|
||||
|
||||
var image = <HTMLImageElement>document.getElementById('image');
|
||||
var cropper = new Cropper(image, {
|
||||
const image = <HTMLImageElement> document.getElementById('image');
|
||||
const cropper = new Cropper(image, {
|
||||
aspectRatio: 16 / 9,
|
||||
crop: function(e) {
|
||||
crop(e) {
|
||||
console.log(e.detail.x);
|
||||
console.log(e.detail.y);
|
||||
console.log(e.detail.width);
|
||||
|
||||
Vendored
+273
-269
@@ -1,259 +1,260 @@
|
||||
// Type definitions for cropperjs
|
||||
// Type definitions for cropperjs 1.1
|
||||
// Project: https://github.com/fengyuanchen/cropperjs
|
||||
// Definitions by: Stepan Mikhaylyuk <https://github.com/stepancar>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare namespace cropperjs {
|
||||
export enum CropperViewMods {
|
||||
enum CropperViewMods {
|
||||
CropBoxIsJustWithInTheContainer = 0,
|
||||
CropBoxShouldBeWithInTheCanvas = 1,
|
||||
CanvasShouldNotBeWithInTheContainer = 2,
|
||||
ContainerSshouldBeWithInTheCanvas = 3
|
||||
}
|
||||
export interface CropperReadyEvent extends CustomEvent { }
|
||||
export interface CropperCropEvent extends CustomEvent {
|
||||
type CropperReadyEvent = CustomEvent;
|
||||
interface CropperCropEvent extends CustomEvent {
|
||||
detail: Data;
|
||||
}
|
||||
export interface CropperCropStepEvent extends CustomEvent {
|
||||
interface CropperCropStepEvent extends CustomEvent {
|
||||
detail: CropStepData;
|
||||
}
|
||||
export interface CropperZoomEvent extends CustomEvent {
|
||||
interface CropperZoomEvent extends CustomEvent {
|
||||
detail: ZoomData;
|
||||
}
|
||||
export interface CropperOptions {
|
||||
interface CropperOptions {
|
||||
/**
|
||||
* Function called when crop box is ready
|
||||
*/
|
||||
ready?: (event: CropperReadyEvent) => void;
|
||||
* Function called when crop box is ready
|
||||
*/
|
||||
ready?(event: CropperReadyEvent): void;
|
||||
/**
|
||||
* Function called when crop box is moved or resized
|
||||
*/
|
||||
crop?: (event: CropperCropEvent) => void;
|
||||
* Function called when crop box is moved or resized
|
||||
*/
|
||||
crop?(event: CropperCropEvent): void;
|
||||
/**
|
||||
* Function called at start of crop box being moved or resized
|
||||
*/
|
||||
cropstart?: (event: CropperCropStepEvent) => void;
|
||||
* Function called at start of crop box being moved or resized
|
||||
*/
|
||||
cropstart?(event: CropperCropStepEvent): void;
|
||||
/**
|
||||
* Function called when crop box is moved
|
||||
*/
|
||||
cropmove?: (event: CropperCropStepEvent) => void;
|
||||
* Function called when crop box is moved
|
||||
*/
|
||||
cropmove?(event: CropperCropStepEvent): void;
|
||||
/**
|
||||
* Function called when crop box is finished being moved or resized
|
||||
*/
|
||||
cropend?: (event: CropperCropStepEvent) => void;
|
||||
* Function called when crop box is finished being moved or resized
|
||||
*/
|
||||
cropend?(event: CropperCropStepEvent): void;
|
||||
/**
|
||||
* Function called when a cropper instance starts to zoom in or zoom out its canvas (image wrapper).
|
||||
*/
|
||||
zoom?: (event: CropperZoomEvent) => void;
|
||||
zoom?(event: CropperZoomEvent): void;
|
||||
/**
|
||||
* Define the view mode of the cropper.
|
||||
* @default 0
|
||||
*/
|
||||
* Define the view mode of the cropper.
|
||||
* @default 0
|
||||
*/
|
||||
viewMode?: CropperViewMods;
|
||||
/**
|
||||
* Define the dragging mode of the cropper.
|
||||
* 'crop': create a new crop box
|
||||
* 'move': move the canvas
|
||||
* 'none': do nothing
|
||||
*/
|
||||
* Define the dragging mode of the cropper.
|
||||
* 'crop': create a new crop box
|
||||
* 'move': move the canvas
|
||||
* 'none': do nothing
|
||||
*/
|
||||
dragMode?: string;
|
||||
/**
|
||||
* Set the aspect ratio of the crop box. By default, the crop box is free ratio.
|
||||
* @default Nan
|
||||
*/
|
||||
* Set the aspect ratio of the crop box. By default, the crop box is free ratio.
|
||||
* @default Nan
|
||||
*/
|
||||
aspectRatio?: number;
|
||||
/**
|
||||
* The previous cropped data if you had stored, will be passed to setData method automatically.
|
||||
* @default null
|
||||
*/
|
||||
data?: Object;
|
||||
* The previous cropped data if you had stored, will be passed to setData method automatically.
|
||||
* @default null
|
||||
*/
|
||||
data?: object;
|
||||
/**
|
||||
* Add extra elements (containers) for previewing.
|
||||
* Valid selector for Document.querySelectorAll
|
||||
* @default ''
|
||||
*/
|
||||
* Add extra elements (containers) for previewing.
|
||||
* Valid selector for Document.querySelectorAll
|
||||
* @default ''
|
||||
*/
|
||||
preview?: string;
|
||||
/**
|
||||
* Rebuild the cropper when resize the window.
|
||||
* @default true
|
||||
*/
|
||||
* Rebuild the cropper when resize the window.
|
||||
* @default true
|
||||
*/
|
||||
responsive?: boolean;
|
||||
/**
|
||||
* By default, the plugin will check the image origin, and if it is a cross-origin image,
|
||||
* a crossOrigin attribute will be added to the image element and a timestamp will be added to the image url to reload the image for "getCroppedCanvas".
|
||||
* By adding crossOrigin attribute to image will stop adding timestamp to image url, and stop reload of image.
|
||||
* @default true
|
||||
*/
|
||||
* By default, the plugin will check the image origin, and if it is a cross-origin image,
|
||||
* a crossOrigin attribute will be added to the image element and a timestamp will be added to the image url to reload the image for "getCroppedCanvas".
|
||||
* By adding crossOrigin attribute to image will stop adding timestamp to image url, and stop reload of image.
|
||||
* @default true
|
||||
*/
|
||||
checkCrossOrigin?: boolean;
|
||||
/**
|
||||
* Check the current image's Exif Orientation information.
|
||||
* More exactly, read the Orientation value for rotating or flipping the image, and then override the Orientation
|
||||
* value with 1 (the default value) to avoid some issues (1, 2) on iOS devices.
|
||||
* Requires to set both the rotatable and scalable options to true at the same time.
|
||||
* Note: Don't trust this all the time as some JPG images have incorrect (not standard) Orientation values.
|
||||
* @default true
|
||||
*/
|
||||
* Check the current image's Exif Orientation information.
|
||||
* More exactly, read the Orientation value for rotating or flipping the image, and then override the Orientation
|
||||
* value with 1 (the default value) to avoid some issues (1, 2) on iOS devices.
|
||||
* Requires to set both the rotatable and scalable options to true at the same time.
|
||||
* Note: Don't trust this all the time as some JPG images have incorrect (not standard) Orientation values.
|
||||
* @default true
|
||||
*/
|
||||
checkOrientation?: boolean;
|
||||
/**
|
||||
* Show the black modal above the image and under the crop box.
|
||||
* @default true
|
||||
*/
|
||||
* Show the black modal above the image and under the crop box.
|
||||
* @default true
|
||||
*/
|
||||
modal?: boolean;
|
||||
/**
|
||||
* Show the dashed lines above the crop box.
|
||||
* @default true
|
||||
*/
|
||||
* Show the dashed lines above the crop box.
|
||||
* @default true
|
||||
*/
|
||||
guides?: boolean;
|
||||
/**
|
||||
* Show the center indicator above the crop box.
|
||||
* @default true
|
||||
*/
|
||||
* Show the center indicator above the crop box.
|
||||
* @default true
|
||||
*/
|
||||
center?: boolean;
|
||||
/**
|
||||
* Show the white modal above the crop box (highlight the crop box).
|
||||
* @default true
|
||||
*/
|
||||
* Show the white modal above the crop box (highlight the crop box).
|
||||
* @default true
|
||||
*/
|
||||
highlight?: boolean;
|
||||
/**
|
||||
* Show the grid background of the container.
|
||||
* @default true
|
||||
*/
|
||||
* Show the grid background of the container.
|
||||
* @default true
|
||||
*/
|
||||
background?: boolean;
|
||||
/**
|
||||
* Enable to crop the image automatically when initialize.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to crop the image automatically when initialize.
|
||||
* @default true
|
||||
*/
|
||||
autoCrop?: boolean;
|
||||
/**
|
||||
* A number between 0 and 1. Define the automatic cropping area size (percentage).
|
||||
* @default 0.8 (80% of the image)
|
||||
*/
|
||||
* A number between 0 and 1. Define the automatic cropping area size (percentage).
|
||||
* @default 0.8 (80% of the image)
|
||||
*/
|
||||
autoCropArea?: number;
|
||||
/**
|
||||
* Enable to move the image.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to move the image.
|
||||
* @default true
|
||||
*/
|
||||
movable?: boolean;
|
||||
/**
|
||||
* Enable to rotate the image.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to rotate the image.
|
||||
* @default true
|
||||
*/
|
||||
rotatable?: boolean;
|
||||
/**
|
||||
* Enable to restore the cropped area after resizing the window.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to restore the cropped area after resizing the window.
|
||||
* @default true
|
||||
*/
|
||||
restore?: boolean;
|
||||
/**
|
||||
* Enable to scale the image.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to scale the image.
|
||||
* @default true
|
||||
*/
|
||||
scalable?: boolean;
|
||||
/**
|
||||
* Enable to zoom the image.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to zoom the image.
|
||||
* @default true
|
||||
*/
|
||||
zoomable?: boolean;
|
||||
/**
|
||||
* Enable to zoom the image by dragging touch.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to zoom the image by dragging touch.
|
||||
* @default true
|
||||
*/
|
||||
zoomOnTouch?: boolean;
|
||||
/**
|
||||
* Enable to zoom the image by wheeling mouse.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to zoom the image by wheeling mouse.
|
||||
* @default true
|
||||
*/
|
||||
zoomOnWheel?: boolean;
|
||||
/**
|
||||
* Define zoom ratio when zoom the image by wheeling mouse.
|
||||
* @default 0.1
|
||||
*/
|
||||
* Define zoom ratio when zoom the image by wheeling mouse.
|
||||
* @default 0.1
|
||||
*/
|
||||
wheelZoomRatio?: number;
|
||||
/**
|
||||
* Enable to move the crop box.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to move the crop box.
|
||||
* @default true
|
||||
*/
|
||||
cropBoxMovable?: boolean;
|
||||
/**
|
||||
* Enable to resize the crop box.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to resize the crop box.
|
||||
* @default true
|
||||
*/
|
||||
cropBoxResizable?: boolean;
|
||||
/**
|
||||
* Enable to toggle drag mode between "crop" and "move" when click twice on the cropper.
|
||||
* @default true
|
||||
*/
|
||||
* Enable to toggle drag mode between "crop" and "move" when click twice on the cropper.
|
||||
* @default true
|
||||
*/
|
||||
toggleDragModeOnDblclick?: boolean;
|
||||
/**
|
||||
* The minimum width of the container
|
||||
* @default 200
|
||||
*/
|
||||
* The minimum width of the container
|
||||
* @default 200
|
||||
*/
|
||||
minContainerWidth?: number;
|
||||
/**
|
||||
* The minimum height of the container.
|
||||
* @default 100
|
||||
*/
|
||||
* The minimum height of the container.
|
||||
* @default 100
|
||||
*/
|
||||
minContainerHeight?: number;
|
||||
/**
|
||||
* The minimum width of the canvas (image wrapper).
|
||||
* @default 0
|
||||
*/
|
||||
* The minimum width of the canvas (image wrapper).
|
||||
* @default 0
|
||||
*/
|
||||
minCanvasWidth?: number;
|
||||
/**
|
||||
* The minimum height of the canvas (image wrapper).
|
||||
* @default 0
|
||||
*/
|
||||
* The minimum height of the canvas (image wrapper).
|
||||
* @default 0
|
||||
*/
|
||||
minCanvasHeight?: number;
|
||||
/**
|
||||
* The minimum width of the crop box.
|
||||
* @default 0
|
||||
*/
|
||||
* The minimum width of the crop box.
|
||||
* @default 0
|
||||
*/
|
||||
minCropBoxWidth?: number;
|
||||
/**
|
||||
* The minimum height of the crop box.
|
||||
* @default 0
|
||||
*/
|
||||
* The minimum height of the crop box.
|
||||
* @default 0
|
||||
*/
|
||||
minCropBoxHeight?: number;
|
||||
/**
|
||||
* This function will be called when a cropper instance starts to load an image.
|
||||
* Return false to prevent to build
|
||||
* @default null
|
||||
*/
|
||||
build?: () => boolean;
|
||||
* This function will be called when a cropper instance starts to load an image.
|
||||
* Return false to prevent to build
|
||||
* @default null
|
||||
*/
|
||||
build?(): boolean;
|
||||
/**
|
||||
* This function will be called when a cropper instance has built completely.
|
||||
* @default null
|
||||
*/
|
||||
built?: () => void;
|
||||
* This function will be called when a cropper instance has built completely.
|
||||
* @default null
|
||||
*/
|
||||
built?(): void;
|
||||
}
|
||||
interface Data {
|
||||
/**
|
||||
* the offset left of the cropped area
|
||||
*/
|
||||
* the offset left of the cropped area
|
||||
*/
|
||||
x: number;
|
||||
/**
|
||||
* the offset top of the cropped area
|
||||
*/
|
||||
* the offset top of the cropped area
|
||||
*/
|
||||
y: number;
|
||||
/**
|
||||
* the width of the cropped area
|
||||
*/
|
||||
* the width of the cropped area
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* the height of the cropped area
|
||||
*/
|
||||
* the height of the cropped area
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* the rotated degrees of the image
|
||||
*/
|
||||
* the rotated degrees of the image
|
||||
*/
|
||||
rotate: number;
|
||||
/**
|
||||
* the scaling factor to apply on the abscissa of the image
|
||||
*/
|
||||
* the scaling factor to apply on the abscissa of the image
|
||||
*/
|
||||
scaleX: number;
|
||||
/**
|
||||
* the scaling factor to apply on the ordinate of the image
|
||||
*/
|
||||
* the scaling factor to apply on the ordinate of the image
|
||||
*/
|
||||
scaleY: number;
|
||||
}
|
||||
interface CropStepData {
|
||||
@@ -284,7 +285,7 @@ declare namespace cropperjs {
|
||||
}
|
||||
interface ZoomData {
|
||||
/**
|
||||
* The original event that was triggered
|
||||
* The original event that was triggered
|
||||
* Options: wheel, touchmove
|
||||
*/
|
||||
originalEvent: Event;
|
||||
@@ -299,104 +300,108 @@ declare namespace cropperjs {
|
||||
}
|
||||
interface ContainerData {
|
||||
/**
|
||||
* The current width of the container
|
||||
*/
|
||||
* The current width of the container
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* The current height of the container
|
||||
*/
|
||||
* The current height of the container
|
||||
*/
|
||||
height: number;
|
||||
}
|
||||
interface CropBoxData {
|
||||
/**
|
||||
* the offset left of the crop box
|
||||
*/
|
||||
left: number;
|
||||
* the offset left of the crop box
|
||||
*/
|
||||
left?: number;
|
||||
/**
|
||||
* the offset top of the crop box
|
||||
*/
|
||||
top: number;
|
||||
* the offset top of the crop box
|
||||
*/
|
||||
top?: number;
|
||||
/**
|
||||
* the width of the crop box
|
||||
*/
|
||||
width: number;
|
||||
* the width of the crop box
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* the height of the crop box
|
||||
*/
|
||||
height: number;
|
||||
* the height of the crop box
|
||||
*/
|
||||
height?: number;
|
||||
}
|
||||
interface CanvasData {
|
||||
/**
|
||||
* offset left of the canvas
|
||||
*/
|
||||
* offset left of the canvas
|
||||
*/
|
||||
left: number;
|
||||
/**
|
||||
* new offset top of the canvas
|
||||
*/
|
||||
* new offset top of the canvas
|
||||
*/
|
||||
top: number;
|
||||
/**
|
||||
* new width of the canvas
|
||||
*/
|
||||
* new width of the canvas
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* new height of the canvas
|
||||
*/
|
||||
* new height of the canvas
|
||||
*/
|
||||
height: number;
|
||||
}
|
||||
interface ImageData {
|
||||
/**
|
||||
* the offset left of the image
|
||||
*/
|
||||
* the offset left of the image
|
||||
*/
|
||||
left: number;
|
||||
/**
|
||||
* the offset top of the image
|
||||
*/
|
||||
* the offset top of the image
|
||||
*/
|
||||
top: number;
|
||||
/**
|
||||
* the width of the image
|
||||
*/
|
||||
* the width of the image
|
||||
*/
|
||||
width: number;
|
||||
/**
|
||||
* the height of the image
|
||||
*/
|
||||
* the height of the image
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* the natural width of the image
|
||||
*/
|
||||
* the natural width of the image
|
||||
*/
|
||||
naturalWidth: number;
|
||||
/**
|
||||
* the natural height of the image
|
||||
*/
|
||||
* the natural height of the image
|
||||
*/
|
||||
naturalHeight: number;
|
||||
/**
|
||||
* the aspect ratio of the image
|
||||
*/
|
||||
* the aspect ratio of the image
|
||||
*/
|
||||
aspectRatio: number;
|
||||
/**
|
||||
* the rotated degrees of the image if rotated
|
||||
*/
|
||||
* the rotated degrees of the image if rotated
|
||||
*/
|
||||
rotate: number;
|
||||
/**
|
||||
* the scaling factor to apply on the abscissa of the image if scaled
|
||||
*/
|
||||
* the scaling factor to apply on the abscissa of the image if scaled
|
||||
*/
|
||||
scaleX: number;
|
||||
/**
|
||||
* the scaling factor to apply on the ordinate of the image if scaled
|
||||
*/
|
||||
* the scaling factor to apply on the ordinate of the image if scaled
|
||||
*/
|
||||
scaleY: number;
|
||||
}
|
||||
interface CroppedCanvasOptions {
|
||||
/**
|
||||
* the destination width of the output canvas
|
||||
*/
|
||||
* the destination width of the output canvas
|
||||
*/
|
||||
width?: number;
|
||||
minWidth?: number;
|
||||
maxWidth?: number;
|
||||
/**
|
||||
* the destination height of the output canvas
|
||||
*/
|
||||
* the destination height of the output canvas
|
||||
*/
|
||||
height?: number;
|
||||
minHeight?: number;
|
||||
maxHeight?: number;
|
||||
/**
|
||||
* a color to fill any alpha values in the output canvas
|
||||
*/
|
||||
* a color to fill any alpha values in the output canvas
|
||||
*/
|
||||
fillColor?: string;
|
||||
}
|
||||
}
|
||||
@@ -409,144 +414,143 @@ declare class cropperjs {
|
||||
crop(): void;
|
||||
|
||||
/**
|
||||
* Clear the crop box.
|
||||
*/
|
||||
* Clear the crop box.
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
/**
|
||||
* Replace the image's src and rebuild the cropper.
|
||||
* @param url A new image url
|
||||
*/
|
||||
* Replace the image's src and rebuild the cropper.
|
||||
* @param url A new image url
|
||||
*/
|
||||
replace(url: string): void;
|
||||
|
||||
/**
|
||||
* Enable (unfreeze) the cropper.
|
||||
*/
|
||||
* Enable (unfreeze) the cropper.
|
||||
*/
|
||||
enable(): void;
|
||||
|
||||
/**
|
||||
* Disable (freeze) the cropper
|
||||
*/
|
||||
* Disable (freeze) the cropper
|
||||
*/
|
||||
disable(): void;
|
||||
|
||||
/**
|
||||
* Destroy the cropper and remove the instance from the image.
|
||||
*/
|
||||
* Destroy the cropper and remove the instance from the image.
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Move the canvas (image wrapper) with relative offsets.
|
||||
* @param offsetX Moving size (px) in the horizontal direction.
|
||||
* @param offsetY Moving size (px) in the vertical direction.
|
||||
* If not present, its default value is offsetX.
|
||||
*/
|
||||
* Move the canvas (image wrapper) with relative offsets.
|
||||
* @param offsetX Moving size (px) in the horizontal direction.
|
||||
* @param offsetY Moving size (px) in the vertical direction.
|
||||
* If not present, its default value is offsetX.
|
||||
*/
|
||||
move(offsetX: number, offsetY?: number): void;
|
||||
|
||||
/**
|
||||
* Move the canvas (image wrapper) to an absolute point.
|
||||
* @param x The left value of the canvas
|
||||
* @param y The top value of the canvas
|
||||
* If not present, its default value is x.
|
||||
*/
|
||||
* Move the canvas (image wrapper) to an absolute point.
|
||||
* @param x The left value of the canvas
|
||||
* @param y The top value of the canvas
|
||||
* If not present, its default value is x.
|
||||
*/
|
||||
moveTo(x: number, y?: number): void;
|
||||
|
||||
/**
|
||||
* Zoom the canvas (image wrapper) with a relative ratio.
|
||||
* Zoom in: requires a positive number (ratio > 0)
|
||||
* Zoom out: requires a negative number (ratio < 0)
|
||||
*/
|
||||
* Zoom the canvas (image wrapper) with a relative ratio.
|
||||
* Zoom in: requires a positive number (ratio > 0)
|
||||
* Zoom out: requires a negative number (ratio < 0)
|
||||
*/
|
||||
zoom(ratio: number): void;
|
||||
|
||||
/**
|
||||
* Zoom the canvas (image wrapper) to an absolute ratio.
|
||||
* Zoom in: requires a positive number (ratio > 0)
|
||||
* Zoom out: requires a negative number (ratio < 0)
|
||||
*/
|
||||
* Zoom the canvas (image wrapper) to an absolute ratio.
|
||||
* Zoom in: requires a positive number (ratio > 0)
|
||||
* Zoom out: requires a negative number (ratio < 0)
|
||||
*/
|
||||
zoomTo(ratio: number): void;
|
||||
|
||||
/**
|
||||
* Rotate the canvas (image wrapper) with a relative degree.
|
||||
* Rotate right: requires a positive number (degree > 0)
|
||||
* Rotate left: requires a negative number (degree < 0)
|
||||
*/
|
||||
* Rotate the canvas (image wrapper) with a relative degree.
|
||||
* Rotate right: requires a positive number (degree > 0)
|
||||
* Rotate left: requires a negative number (degree < 0)
|
||||
*/
|
||||
rotate(degree: number): void;
|
||||
|
||||
/**
|
||||
* Rotate the canvas (image wrapper) to an absolute degree.
|
||||
* Rotate right: requires a positive number (degree > 0)
|
||||
* Rotate left: requires a negative number (degree < 0)
|
||||
*/
|
||||
* Rotate the canvas (image wrapper) to an absolute degree.
|
||||
* Rotate right: requires a positive number (degree > 0)
|
||||
* Rotate left: requires a negative number (degree < 0)
|
||||
*/
|
||||
rotateTo(degree: number): void;
|
||||
|
||||
/**
|
||||
* Clear the crop box.
|
||||
*/
|
||||
* Clear the crop box.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
* Output the cropped area position and size data (base on the original image).
|
||||
*/
|
||||
* Output the cropped area position and size data (base on the original image).
|
||||
*/
|
||||
getData(rounded?: boolean): cropperjs.Data;
|
||||
|
||||
/**
|
||||
* Change the cropped area position and size with new data (base on the original image).
|
||||
*/
|
||||
* Change the cropped area position and size with new data (base on the original image).
|
||||
*/
|
||||
setData(data: cropperjs.Data): void;
|
||||
|
||||
/**
|
||||
* Output the container size data.
|
||||
*/
|
||||
* Output the container size data.
|
||||
*/
|
||||
getContainerData(): cropperjs.ContainerData;
|
||||
|
||||
/**
|
||||
* Output the image position, size and other related data.
|
||||
*/
|
||||
* Output the image position, size and other related data.
|
||||
*/
|
||||
getImageData(): cropperjs.ImageData;
|
||||
|
||||
/**
|
||||
* Output the canvas (image wrapper) position and size data.
|
||||
*/
|
||||
* Output the canvas (image wrapper) position and size data.
|
||||
*/
|
||||
getCanvasData(): cropperjs.CanvasData & {
|
||||
/**
|
||||
* the natural width of the canvas (read only)
|
||||
*/
|
||||
* the natural width of the canvas (read only)
|
||||
*/
|
||||
naturalWidth: number;
|
||||
/**
|
||||
* the natural height of the canvas (read only)
|
||||
*/
|
||||
* the natural height of the canvas (read only)
|
||||
*/
|
||||
naturalHeight: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Change the canvas (image wrapper) position and size with new data.
|
||||
*/
|
||||
* Change the canvas (image wrapper) position and size with new data.
|
||||
*/
|
||||
setCanvasData(data: cropperjs.CanvasData): void;
|
||||
|
||||
/**
|
||||
* Output the crop box position and size data.
|
||||
*/
|
||||
* Output the crop box position and size data.
|
||||
*/
|
||||
getCropBoxData(): cropperjs.CropBoxData;
|
||||
|
||||
/**
|
||||
* Change the crop box position and size with new data.
|
||||
*/
|
||||
* Change the crop box position and size with new data.
|
||||
*/
|
||||
setCropBoxData(data: cropperjs.CropBoxData): void;
|
||||
|
||||
/**
|
||||
* Get a canvas drawn the cropped image.
|
||||
*/
|
||||
* Get a canvas drawn the cropped image.
|
||||
*/
|
||||
getCroppedCanvas(options?: cropperjs.CroppedCanvasOptions): HTMLCanvasElement;
|
||||
|
||||
/**
|
||||
* Change the aspect ratio of the crop box.
|
||||
*/
|
||||
* Change the aspect ratio of the crop box.
|
||||
*/
|
||||
setAspectRatio(aspectRatio: number): void;
|
||||
|
||||
/**
|
||||
* Change the drag mode.
|
||||
*/
|
||||
* Change the drag mode.
|
||||
*/
|
||||
setDragMode(mode?: 'none' | 'crop' | 'move'): void;
|
||||
|
||||
}
|
||||
|
||||
export = cropperjs;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+3
-20
@@ -17,44 +17,27 @@ interface TokensOptions {
|
||||
}
|
||||
|
||||
declare class Tokens {
|
||||
/**
|
||||
* Token generation/verification class.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @param {number} [options.saltLength=8] The string length of the salt
|
||||
* @param {number} [options.secretLength=18] The byte length of the secret key
|
||||
* @public
|
||||
*/
|
||||
/** Token generation/verification class. */
|
||||
constructor(options?: TokensOptions)
|
||||
|
||||
/**
|
||||
* Create a new CSRF token.
|
||||
*
|
||||
* @param {string} secret The secret for the token.
|
||||
* @public
|
||||
* @param secret The secret for the token.
|
||||
*/
|
||||
create(secret: string): string;
|
||||
|
||||
/**
|
||||
* Create a new secret key.
|
||||
*
|
||||
* @param {function} [callback]
|
||||
* @public
|
||||
*/
|
||||
/** Create a new secret key. */
|
||||
secret(callback?: SecretCallback): Promise<string>;
|
||||
|
||||
/**
|
||||
* Create a new secret key synchronously.
|
||||
* @public
|
||||
*/
|
||||
secretSync(): string;
|
||||
|
||||
/**
|
||||
* Verify if a given token is valid for a given secret.
|
||||
*
|
||||
* @param {string} secret
|
||||
* @param {string} token
|
||||
* @public
|
||||
*/
|
||||
verify(secret: string, token: string): boolean;
|
||||
}
|
||||
|
||||
Vendored
+26
-26
@@ -179,50 +179,50 @@ declare namespace csvtojson {
|
||||
class Converter extends stream.Transform {
|
||||
/**
|
||||
* Initializes a new instance of a Converter
|
||||
* @param {ConverterOptions} options converter options
|
||||
* @param {StreamOptions} streamOptions stream options
|
||||
* @param options converter options
|
||||
* @param streamOptions stream options
|
||||
*/
|
||||
constructor(options?: ConverterOptions, streamOptions?: StreamOptions);
|
||||
|
||||
/**
|
||||
* Reads in a CSV from a string.
|
||||
* @param {string} str the string to convert
|
||||
* @return {Converter} returns this object for chaining
|
||||
* @param str the string to convert
|
||||
* @return returns this object for chaining
|
||||
*/
|
||||
fromString(str: string): this;
|
||||
|
||||
/**
|
||||
* Reads in a CSV from a string.
|
||||
* @param {string} str the string to convert
|
||||
* @param {ParseResultHandler} callback callback function to handle result or error
|
||||
* @param str the string to convert
|
||||
* @param callback callback function to handle result or error
|
||||
*/
|
||||
fromString(str: string, callback: ParseResultHandler): void;
|
||||
|
||||
/**
|
||||
* Reads in a CSV from a file.
|
||||
* @param {string} filePath the path to the CSV file
|
||||
* @return {Converter} returns this object for chaining
|
||||
* @param filePath the path to the CSV file
|
||||
* @return returns this object for chaining
|
||||
*/
|
||||
fromFile(filePath: string): this;
|
||||
|
||||
/**
|
||||
* Reads in a CSV from a file.
|
||||
* @param {string} filePath the path to the CSV file
|
||||
* @param {ParseResultHandler} callback callback function to handle result or error
|
||||
* @param filePath the path to the CSV file
|
||||
* @param callback callback function to handle result or error
|
||||
*/
|
||||
fromFile(filePath: string, callback: ParseResultHandler): void;
|
||||
|
||||
/**
|
||||
* Reads in a CSV from a stream.
|
||||
* @param {Stream} stream the stream
|
||||
* @return {Converter} returns this object for chaining
|
||||
* @param stream the stream
|
||||
* @return returns this object for chaining
|
||||
*/
|
||||
fromStream(stream: NodeJS.ReadableStream): this;
|
||||
|
||||
/**
|
||||
* Reads in a CSV from a stream.
|
||||
* @param {Stream} stream the stream
|
||||
* @param {ParseResultHandler} callback callback function to handle result or error
|
||||
* @param stream the stream
|
||||
* @param callback callback function to handle result or error
|
||||
*/
|
||||
fromStream(stream: stream.Stream, callback: ParseResultHandler): void;
|
||||
|
||||
@@ -237,9 +237,9 @@ declare namespace csvtojson {
|
||||
* - end
|
||||
* - end_parsed
|
||||
* - done
|
||||
* @param {Event} event name of event
|
||||
* @param {Function} listener listener function
|
||||
* @return {this} returns this object for chaining
|
||||
* @param event name of event
|
||||
* @param listener listener function
|
||||
* @return returns this object for chaining
|
||||
*/
|
||||
// tslint:disable-next-line ban-types
|
||||
on(event: string, listener: Function | JsonEventHandler | CsvEventHandler | DataEventHandler | ErrorEventHandler
|
||||
@@ -247,22 +247,22 @@ declare namespace csvtojson {
|
||||
|
||||
/**
|
||||
* Transform objects after CSV parsing but before result being emitted or pushed downstream.
|
||||
* @param {Function} callback transform function
|
||||
* @return {this} returns this object for chaining
|
||||
* @param callback transform function
|
||||
* @return returns this object for chaining
|
||||
*/
|
||||
transf(callback: (jsonObj: any, csvRow: string[], rowNumber: number) => void): this;
|
||||
|
||||
/**
|
||||
* The function in preRawData will be called directly with the string from upper stream.
|
||||
* @param {Function} callback callback function
|
||||
* @return {this} returns this object for chaining
|
||||
* @param callback callback function
|
||||
* @return returns this object for chaining
|
||||
*/
|
||||
preRawData(callback: (csvRawData: string, cb: (newData: any) => void) => void): this;
|
||||
|
||||
/**
|
||||
* The function is called each time a file line being found in csv stream.
|
||||
* @param {Function} callback callback function
|
||||
* @return {this} returns this object for chaining
|
||||
* @param callback callback function
|
||||
* @return returns this object for chaining
|
||||
*/
|
||||
preFileLine(callback: (line: string, rowNumber: number) => string): this;
|
||||
}
|
||||
@@ -270,9 +270,9 @@ declare namespace csvtojson {
|
||||
|
||||
/**
|
||||
* Factory function which creates an instance of a Converter object.
|
||||
* @param {ConverterOptions} options converter options
|
||||
* @param {StreamOptions} streamOptions stream options
|
||||
* @return {csvtojson.Converter} Converter object
|
||||
* @param options converter options
|
||||
* @param streamOptions stream options
|
||||
* @return Converter object
|
||||
*/
|
||||
declare function csvtojson(options?: csvtojson.ConverterOptions, streamOptions?: csvtojson.StreamOptions): csvtojson.Converter;
|
||||
|
||||
|
||||
Vendored
+18
-9
@@ -2711,7 +2711,8 @@ declare namespace cytoscape {
|
||||
* http://js.cytoscape.org/#eles.degreeCentrality
|
||||
*/
|
||||
interface SearchDegreeCentralityOptions {
|
||||
/** The root node (selector or collection) for which the
|
||||
/**
|
||||
* The root node (selector or collection) for which the
|
||||
* centrality calculation is made.
|
||||
*/
|
||||
root: NodeSingular | Selector;
|
||||
@@ -2725,7 +2726,8 @@ declare namespace cytoscape {
|
||||
* in the centrality calculation.
|
||||
*/
|
||||
alpha?: number;
|
||||
/** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
/**
|
||||
* Whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
* whether the undirected centrality is calculated (false, default).
|
||||
*/
|
||||
directed?: boolean;
|
||||
@@ -2757,7 +2759,8 @@ declare namespace cytoscape {
|
||||
* in the centrality calculation.
|
||||
*/
|
||||
alpha?: number;
|
||||
/** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
/**
|
||||
* A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
* whether the undirected centrality is calculated (false, default).
|
||||
*/
|
||||
directed?: boolean;
|
||||
@@ -2780,14 +2783,16 @@ declare namespace cytoscape {
|
||||
* http://js.cytoscape.org/#eles.closenessCentrality
|
||||
*/
|
||||
interface SearchClosenessCentralityOptions {
|
||||
/** The root node (selector or collection) for which the
|
||||
/**
|
||||
* The root node (selector or collection) for which the
|
||||
* centrality calculation is made.
|
||||
*/
|
||||
root: NodeSingular | Selector;
|
||||
/** A function that returns the weight for the edge. */
|
||||
weight?(edge: EdgeSingular): number;
|
||||
|
||||
/** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
/**
|
||||
* A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
* whether the undirected centrality is calculated (false, default).
|
||||
*/
|
||||
directed?: boolean;
|
||||
@@ -2829,7 +2834,8 @@ declare namespace cytoscape {
|
||||
/** A function that returns the weight for the edge. */
|
||||
weight?(edge: EdgeSingular): number;
|
||||
|
||||
/** A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
/**
|
||||
* A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or
|
||||
* whether the undirected centrality is calculated (false, default).
|
||||
*/
|
||||
directed?: boolean;
|
||||
@@ -3976,7 +3982,8 @@ declare namespace cytoscape {
|
||||
originalEvent: EventObject;
|
||||
}
|
||||
interface LayoutEventObject extends AbstractEventObject {
|
||||
/** layout : indicates the corresponding layout that triggered the event
|
||||
/**
|
||||
* layout : indicates the corresponding layout that triggered the event
|
||||
* (useful if running multiple layouts simultaneously)
|
||||
*/
|
||||
layout: any;
|
||||
@@ -4357,12 +4364,14 @@ declare namespace cytoscape {
|
||||
* A new, developer accessible layout can be made via cy.makeLayout().
|
||||
*/
|
||||
interface LayoutManipulation {
|
||||
/** Start running the layout
|
||||
/**
|
||||
* Start running the layout
|
||||
* http://js.cytoscape.org/#layout.run
|
||||
*/
|
||||
run(): void;
|
||||
start(): void;
|
||||
/** Stop running the (asynchronous/discrete) layout
|
||||
/**
|
||||
* Stop running the (asynchronous/discrete) layout
|
||||
* http://js.cytoscape.org/#layout.stop
|
||||
*/
|
||||
stop(): void;
|
||||
|
||||
@@ -26,8 +26,9 @@ const n = 256;
|
||||
const m = 256;
|
||||
const values: number[] = new Array(n * m);
|
||||
for (let j = 0.5, k = 0; j < m; ++j) {
|
||||
for (let i = 0.5; i < n; ++i, ++k) {
|
||||
for (let i = 0.5; i < n; i++) {
|
||||
values[k] = goldsteinPrice(i / n * 4 - 2, 1 - j / m * 3);
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -540,7 +540,7 @@ export interface GeoStream {
|
||||
* Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input,
|
||||
* the stream interface only describes the geometry, and thus additional feature properties are not visible to streams.
|
||||
*
|
||||
* @param object
|
||||
* @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature).
|
||||
* @param stream A projection stream.
|
||||
*/
|
||||
export function geoStream(object: ExtendedFeature<GeoGeometryObjects, any>, stream: GeoStream): void;
|
||||
@@ -549,7 +549,7 @@ export function geoStream(object: ExtendedFeature<GeoGeometryObjects, any>, stre
|
||||
* Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input,
|
||||
* the stream interface only describes the geometry, and thus additional feature properties are not visible to streams.
|
||||
*
|
||||
* @param object
|
||||
* @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature).
|
||||
* @param stream A projection stream.
|
||||
*/
|
||||
export function geoStream(object: ExtendedFeatureCollection<ExtendedFeature<GeoGeometryObjects, any>>, stream: GeoStream): void;
|
||||
@@ -558,7 +558,7 @@ export function geoStream(object: ExtendedFeatureCollection<ExtendedFeature<GeoG
|
||||
* Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input,
|
||||
* the stream interface only describes the geometry, and thus additional feature properties are not visible to streams.
|
||||
*
|
||||
* @param object
|
||||
* @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON).
|
||||
* @param stream A projection stream.
|
||||
*/
|
||||
export function geoStream(object: GeoGeometryObjects, stream: GeoStream): void;
|
||||
@@ -567,7 +567,7 @@ export function geoStream(object: GeoGeometryObjects, stream: GeoStream): void;
|
||||
* Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input,
|
||||
* the stream interface only describes the geometry, and thus additional feature properties are not visible to streams.
|
||||
*
|
||||
* @param object
|
||||
* @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection).
|
||||
* @param stream A projection stream.
|
||||
*/
|
||||
export function geoStream(object: ExtendedGeometryCollection<GeoGeometryObjects>, stream: GeoStream): void;
|
||||
@@ -1659,7 +1659,7 @@ export const geoClipAntimeridian: ((stream: GeoStream) => GeoStream);
|
||||
* Generates a clipping function transforming a stream such that geometries are bounded by a small circle of radius angle around the projection’s center.
|
||||
* Typically used for pre-clipping.
|
||||
*
|
||||
* @param angle
|
||||
* @param angle A clipping angle.
|
||||
*/
|
||||
export function geoClipCircle(angle: number): (stream: GeoStream) => GeoStream;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -208,7 +208,7 @@ export interface SankeyLayout<Data, N extends SankeyExtraProperties, L extends S
|
||||
*
|
||||
* This method is intended to be called after computing the initial Sankey layout, for example when the diagram is repositioned interactively.
|
||||
*
|
||||
* @param graph
|
||||
* @param graph A previously initialized Sankey graph for which the link positions should be re-calculated
|
||||
*/
|
||||
update(graph: SankeyGraph<N, L>): SankeyGraph<N, L>;
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ let filterdGElements2: d3Selection.Selection<SVGGElement, any, HTMLElement, any>
|
||||
filterdGElements2 = d3Selection.selectAll<SVGElement, any>('.any-svg-type').filter<SVGGElement>('g');
|
||||
// filterdGElements2 = d3Selection.selectAll('.any-type').filter('g'); // fails without using narrowing generic on filter method
|
||||
|
||||
filterdGElements2 = d3Selection.selectAll<SVGElement, any>('.any-svg-type').filter<SVGGElement>(function(){
|
||||
filterdGElements2 = d3Selection.selectAll<SVGElement, any>('.any-svg-type').filter<SVGGElement>(function() {
|
||||
const that: SVGElement = this;
|
||||
return that.tagName === 'g' || that.tagName === 'G';
|
||||
});
|
||||
|
||||
Vendored
+3
-3
@@ -22,9 +22,9 @@ declare namespace delay {
|
||||
type PDelayedPassThroughThunk<TValue> = ((value: TValue) => DelayedPromiseLike<TValue>) & DelayedPromiseLike<void>;
|
||||
|
||||
interface DelayedPromiseLike<T> {
|
||||
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
|
||||
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
||||
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
||||
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
||||
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
||||
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
||||
cancel(): void;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/dwhieb/documentdb-session#readme
|
||||
// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import session = require("express-session");
|
||||
|
||||
|
||||
Vendored
+63
-59
@@ -553,6 +553,7 @@ export class HashPartitionResolver implements PartitionResolver {
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
// tslint:disable-next-line no-unnecessary-class
|
||||
export class Range {
|
||||
/**
|
||||
* DEPRECATED
|
||||
@@ -619,7 +620,8 @@ export class DocumentClient {
|
||||
*/
|
||||
constructor(urlConnection: string, auth: AuthOptions, connectionPolicy?: ConnectionPolicy, consistencyLevel?: ConsistencyLevel);
|
||||
|
||||
/** Create an attachment for the document object.
|
||||
/**
|
||||
* Create an attachment for the document object.
|
||||
* <p>
|
||||
* Each document may contain zero or more attachments. Attachments can be of any MIME type - text, image, binary data. <br>
|
||||
* These are stored externally in Azure Blob storage. Attachments are automatically deleted when the parent document is deleted.
|
||||
@@ -642,7 +644,8 @@ export class DocumentClient {
|
||||
createAttachmentAndUploadMedia(documentLink: string, readableStream: NodeJS.ReadableStream, options: MediaOptions, callback: RequestCallback<AttachmentMeta>): void;
|
||||
createAttachmentAndUploadMedia(documentLink: string, readableStream: NodeJS.ReadableStream, callback: RequestCallback<AttachmentMeta>): void;
|
||||
|
||||
/** Send a request for creating a database.
|
||||
/**
|
||||
* Send a request for creating a database.
|
||||
* A database manages users, permissions and a set of collections.
|
||||
* Each Azure DocumentDB Database Account is able to support multiple independent named databases, with the database being the logical container for data.
|
||||
* Each Database consists of one or more collections, each of which in turn contain one or more documents. Since databases are an an administrative
|
||||
@@ -757,7 +760,8 @@ export class DocumentClient {
|
||||
executeStoredProcedure<TResult>(procedureLink: string, params: any[], options: RequestOptions, callback: RequestCallback<TResult>): void;
|
||||
executeStoredProcedure<TResult>(procedureLink: string, paramsOrOptions: any[] | RequestOptions, callback: RequestCallback<TResult>): void;
|
||||
|
||||
/** Lists all databases that satisfy a query.
|
||||
/**
|
||||
* Lists all databases that satisfy a query.
|
||||
* @param query - A SQL query string.
|
||||
* @param [options] - The feed options.
|
||||
* @returns - An instance of QueryIterator to handle reading feed.
|
||||
@@ -802,10 +806,10 @@ export class DocumentClient {
|
||||
|
||||
/**
|
||||
* Query the triggers for the collection.
|
||||
* @param {string} collectionLink - The self-link of the collection.
|
||||
* @param {SqlQuerySpec | string} query - A SQL query.
|
||||
* @param {FeedOptions} [options] - Represents the feed options.
|
||||
* @returns {QueryIterator} - An instance of queryIterator to handle reading feed.
|
||||
* @param collectionLink - The self-link of the collection.
|
||||
* @param query - A SQL query.
|
||||
* @param [options] - Represents the feed options.
|
||||
* @returns - An instance of queryIterator to handle reading feed.
|
||||
*/
|
||||
queryTriggers(collectionLink: string, query: DocumentQuery, options?: FeedOptions): QueryIterator<TriggerMeta>;
|
||||
|
||||
@@ -940,10 +944,10 @@ export class DocumentClient {
|
||||
|
||||
/**
|
||||
* Replace the document object.
|
||||
* @param {string} documentLink - The self-link of the document.
|
||||
* @param {object} document - Represent the new document body.
|
||||
* @param {RequestOptions} [options] - The request options.
|
||||
* @param {RequestCallback} callback - The callback for the request.
|
||||
* @param documentLink - The self-link of the document.
|
||||
* @param document - Represent the new document body.
|
||||
* @param [options] - The request options.
|
||||
* @param callback - The callback for the request.
|
||||
*/
|
||||
replaceDocument<TDocument>(documentLink: string, document: NewDocument, options: RequestOptions, callback: RequestCallback<RetrievedDocument>): void;
|
||||
replaceDocument<TDocument>(documentLink: string, document: NewDocument, callback: RequestCallback<RetrievedDocument>): void;
|
||||
@@ -1340,107 +1344,107 @@ export class DocumentClient {
|
||||
getWriteEndpoint(callback: RequestCallback<string>): void;
|
||||
}
|
||||
|
||||
export class UriFactory {
|
||||
export namespace UriFactory {
|
||||
/**
|
||||
* Given a database id, this creates a database link.
|
||||
* @param {string} databaseId -The database id
|
||||
* @returns {string} -A database link in the format of dbs/{0} with {0} being a Uri escaped version of the databaseId
|
||||
* @param databaseId -The database id
|
||||
* @returns -A database link in the format of dbs/{0} with {0} being a Uri escaped version of the databaseId
|
||||
* @description Would be used when creating or deleting a DocumentCollection or a User in Azure DocumentDB database service
|
||||
*/
|
||||
static createDatabaseUri(databaseId: string): string;
|
||||
function createDatabaseUri(databaseId: string): string;
|
||||
/**
|
||||
* Given a database and collection id, this creates a collection link.
|
||||
* @param {string} databaseId -The database id
|
||||
* @param {string} collectionId -The collection id
|
||||
* @returns {string} A collection link in the format of dbs/{0}/colls/{1} with {0} being a Uri escaped version of the databaseId and {1} being collectionId
|
||||
* @param databaseId -The database id
|
||||
* @param collectionId -The collection id
|
||||
* @returns A collection link in the format of dbs/{0}/colls/{1} with {0} being a Uri escaped version of the databaseId and {1} being collectionId
|
||||
* @description Would be used when updating or deleting a DocumentCollection, creating a Document, a StoredProcedure, a
|
||||
* Trigger, a UserDefinedFunction, or when executing a query with CreateDocumentQuery in Azure DocumentDB database service.
|
||||
*/
|
||||
static createDocumentCollectionUri(databaseId: string, collectionId: string): string;
|
||||
function createDocumentCollectionUri(databaseId: string, collectionId: string): string;
|
||||
/**
|
||||
* Given a database and collection id, this creates a collection link.
|
||||
* @param {string} databaseId -The database id
|
||||
* @param {string} collectionId -The collection id
|
||||
* @param {string} documentId -The document id
|
||||
* @returns {string} -A document link in the format of dbs/{0}/colls/{1}/docs/{2} with {0}
|
||||
* @param databaseId -The database id
|
||||
* @param collectionId -The collection id
|
||||
* @param documentId -The document id
|
||||
* @returns -A document link in the format of dbs/{0}/colls/{1}/docs/{2} with {0}
|
||||
* being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the documentId
|
||||
* @description Would be used when creating an Attachment, or when replacing or deleting a Document in Azure DocumentDB database service
|
||||
*/
|
||||
static createDocumentUri(databaseId: string, collectionId: string, documentId: string): string;
|
||||
function createDocumentUri(databaseId: string, collectionId: string, documentId: string): string;
|
||||
/**
|
||||
* Given a database, collection and document id, this creates a document link.
|
||||
* @param {string} databaseId -The database Id
|
||||
* @param {string} userId -The user Id
|
||||
* @param {string} permissionId - The permissionId
|
||||
* @returns {string} A permission link in the format of dbs/{0}/users/{1}/permissions/{2} with {0} being a Uri escaped version of the databaseId, {1} being userId and {2} being permissionId
|
||||
* @param databaseId -The database Id
|
||||
* @param userId -The user Id
|
||||
* @param permissionId - The permissionId
|
||||
* @returns A permission link in the format of dbs/{0}/users/{1}/permissions/{2} with {0} being a Uri escaped version of the databaseId, {1} being userId and {2} being permissionId
|
||||
* @description Would be used when replacing or deleting a Permission in Azure DocumentDB database service.
|
||||
*/
|
||||
static createPermissionUri(databaseId: string, userId: string, permissionId: string): string;
|
||||
function createPermissionUri(databaseId: string, userId: string, permissionId: string): string;
|
||||
|
||||
/**
|
||||
* Given a database, collection and stored proc id, this creates a stored proc link.
|
||||
* @param {string} databaseId -The database Id
|
||||
* @param {string} collectionId -The collection Id
|
||||
* @param {string} storedProcedureId -The stored procedure Id
|
||||
* @returns {string} -A stored procedure link in the format of dbs/{0}/colls/{1}/sprocs/{2}
|
||||
* @param databaseId -The database Id
|
||||
* @param collectionId -The collection Id
|
||||
* @param storedProcedureId -The stored procedure Id
|
||||
* @returns -A stored procedure link in the format of dbs/{0}/colls/{1}/sprocs/{2}
|
||||
* with {0} being a Uri escaped version of the databaseId,
|
||||
* {1} being collectionId and {2} being the storedProcedureId
|
||||
* @description Would be used when replacing, executing, or deleting a StoredProcedure in Azure DocumentDB database service.
|
||||
*/
|
||||
static createStoredProcedureUri(databaseId: string, collectionId: string, storedProcedureId: string): string;
|
||||
function createStoredProcedureUri(databaseId: string, collectionId: string, storedProcedureId: string): string;
|
||||
|
||||
/**
|
||||
* @summary Given a database, collection and trigger id, this creates a trigger link.
|
||||
* @param {string} databaseId -The database Id
|
||||
* @param {string} collectionId -The collection Id
|
||||
* @param {string} triggerId -The trigger Id
|
||||
* @returns {string} -A trigger link in the format of dbs/{0}/colls/{1}/triggers/{2}
|
||||
* @param databaseId -The database Id
|
||||
* @param collectionId -The collection Id
|
||||
* @param triggerId -The trigger Id
|
||||
* @returns -A trigger link in the format of dbs/{0}/colls/{1}/triggers/{2}
|
||||
* with {0} being a Uri escaped version of the databaseId,
|
||||
* {1} being collectionId and {2} being the triggerId
|
||||
* @description Would be used when replacing, executing, or deleting a Trigger in Azure DocumentDB database service
|
||||
*/
|
||||
static createTriggerUri(databaseId: string, collectionId: string, triggerId: string): string;
|
||||
function createTriggerUri(databaseId: string, collectionId: string, triggerId: string): string;
|
||||
|
||||
/**
|
||||
* @summary Given a database, collection and udf id, this creates a udf link.
|
||||
* @param {string} databaseId -The database Id
|
||||
* @param {string} collectionId -The collection Id
|
||||
* @param {string} udfId -The User Defined Function Id
|
||||
* @returns {string} -A udf link in the format of dbs/{0}/colls/{1}/udfs/{2} with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the udfId
|
||||
* @param databaseId -The database Id
|
||||
* @param collectionId -The collection Id
|
||||
* @param udfId -The User Defined Function Id
|
||||
* @returns -A udf link in the format of dbs/{0}/colls/{1}/udfs/{2} with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the udfId
|
||||
* @description Would be used when replacing, executing, or deleting a UserDefinedFunction in Azure DocumentDB database service
|
||||
*/
|
||||
static createUserDefinedFunctionUri(databaseId: string, collectionId: string, udfId: string): string;
|
||||
function createUserDefinedFunctionUri(databaseId: string, collectionId: string, udfId: string): string;
|
||||
|
||||
/**
|
||||
* @summary
|
||||
* @param {string} databaseId -The database Id
|
||||
* @param {string} collectionId -The collection Id
|
||||
* @param {string} conflictId -The conflict Id
|
||||
* @returns {string} -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2}
|
||||
* @param databaseId -The database Id
|
||||
* @param collectionId -The collection Id
|
||||
* @param conflictId -The conflict Id
|
||||
* @returns -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2}
|
||||
* with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the conflictId
|
||||
* @description Would be used when creating a Conflict in Azure DocumentDB database service.
|
||||
*/
|
||||
static createConflictUri(databaseId: string, collectionId: string, conflictId: string): string;
|
||||
function createConflictUri(databaseId: string, collectionId: string, conflictId: string): string;
|
||||
|
||||
/**
|
||||
* @summary Given a database, collection and conflict id, this creates a conflict link.
|
||||
* @param {string} databaseId -The database Id
|
||||
* @param {string} collectionId -The collection Id
|
||||
* @param {string} documentId -The document Id\
|
||||
* @param {string} attachmentId -The attachment Id
|
||||
* @returns {string} -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2} with {0} being a Uri escaped version of the databaseId,
|
||||
* @param databaseId -The database Id
|
||||
* @param collectionId -The collection Id
|
||||
* @param documentId -The document Id\
|
||||
* @param attachmentId -The attachment Id
|
||||
* @returns -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2} with {0} being a Uri escaped version of the databaseId,
|
||||
* {1} being collectionId and {2} being the conflictId
|
||||
* @description Would be used when creating a Conflict in Azure DocumentDB database service.
|
||||
*/
|
||||
static createAttachmentUri(databaseId: string, collectionId: string, documentId: string, attachmentId: string): string;
|
||||
function createAttachmentUri(databaseId: string, collectionId: string, documentId: string, attachmentId: string): string;
|
||||
|
||||
/**
|
||||
* @summary Given a database and collection, this creates a partition key ranges link in the Azure DocumentDB database service.
|
||||
* @param {string} databaseId -The database Id
|
||||
* @param {string} collectionId -The collection Id
|
||||
* @returns {string} -A partition key ranges link in the format of dbs/{0}/colls/{1}/pkranges with {0} being a Uri escaped version of the databaseId and {1} being collectionId
|
||||
* @param databaseId -The database Id
|
||||
* @param collectionId -The collection Id
|
||||
* @returns -A partition key ranges link in the format of dbs/{0}/colls/{1}/pkranges with {0} being a Uri escaped version of the databaseId and {1} being collectionId
|
||||
*/
|
||||
static createPartitionKeyRangesUri(databaseId: string, collectionId: string): string;
|
||||
function createPartitionKeyRangesUri(databaseId: string, collectionId: string): string;
|
||||
}
|
||||
|
||||
export type MediaReadMode = 'Buffered' | 'Streamed';
|
||||
|
||||
Vendored
+5
-5
@@ -7,11 +7,11 @@ interface InputEventInit extends UIEventInit {
|
||||
data?: string;
|
||||
isComposing: boolean;
|
||||
}
|
||||
interface InputEvent extends UIEvent {
|
||||
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface InputEvent extends UIEvent {}
|
||||
declare class InputEvent {
|
||||
constructor(typeArg: 'input' | 'beforeinput', inputEventInit?: InputEventInit);
|
||||
readonly data: string;
|
||||
readonly isComposing: boolean;
|
||||
}
|
||||
|
||||
declare class InputEvent {
|
||||
constructor(typeArg: 'input' | 'beforeinput', inputEventInit?: InputEventInit);
|
||||
}
|
||||
|
||||
Vendored
+16
-8
@@ -21,20 +21,28 @@ export interface MissingEnvVarsError extends Error {
|
||||
/**
|
||||
* Loads environment variables file into 'process.env'.
|
||||
*
|
||||
* @param {object} options
|
||||
* @param {string} [options.sample=".env.example"] Path to example environment file.
|
||||
* @param {string} [options.path=".env"] Path to environment file.
|
||||
* @param {string} [options.encoding="utf8"] Encoding of your file containing environment variables.
|
||||
* @param {boolean} [options.allowEmptyValues=false] Enabling this option will not throw an error after loading.
|
||||
*
|
||||
* @throws MissingEnvVarsError
|
||||
*
|
||||
* @return env.DotenvResult
|
||||
*/
|
||||
export function load(options?: {
|
||||
path?: string,
|
||||
/**
|
||||
* Path to example environment file.
|
||||
* @default ".env.example"
|
||||
*/
|
||||
sample?: string,
|
||||
/**
|
||||
* Path to environment file.
|
||||
* @default ".env"
|
||||
*/
|
||||
silent?: boolean,
|
||||
/**
|
||||
* Encoding of your file containing environment variables.
|
||||
* @default "utf8"
|
||||
*/
|
||||
encoding?: string,
|
||||
/**
|
||||
* Enabling this option will not throw an error after loading.
|
||||
* @default false
|
||||
*/
|
||||
allowEmptyValues?: boolean,
|
||||
}): env.DotenvResult
|
||||
|
||||
Vendored
-1
@@ -13,7 +13,6 @@ export function parse(src: string | Buffer): {[name: string]: string};
|
||||
/**
|
||||
* Loads `.env` into `process.env`.
|
||||
*
|
||||
* @param options
|
||||
* @return Object Object with either
|
||||
* - "parsed" containing the parsed keys and values or
|
||||
* - "error" containing an Error object
|
||||
|
||||
Vendored
-1
@@ -13,7 +13,6 @@ export function parse(src: string | Buffer): {[name: string]: string};
|
||||
/**
|
||||
* Loads `.env` into `process.env`.
|
||||
*
|
||||
* @param options
|
||||
* @return Object Object with the parsed keys and values, e.g., 'KEY=value' becomes { KEY: 'value' }
|
||||
*/
|
||||
export function config(options?: DotenvOptions): {[name: string]: string} | false;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": [false],
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"space-before-function-paren": false,
|
||||
"only-arrow-functions": [false]
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": [false],
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"space-before-function-paren": false,
|
||||
"only-arrow-functions": [false]
|
||||
|
||||
Vendored
+80
-70
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/eggjs/egg
|
||||
// Definitions by: Eward Song <https://github.com/sheperdwind>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as accepts from 'accepts';
|
||||
import * as KoaApplication from 'koa';
|
||||
@@ -51,14 +51,12 @@ interface Request extends KoaApplication.Request { // tslint:disable-line
|
||||
* 2. response type is set to json
|
||||
* 3. detect by request accept header
|
||||
*
|
||||
* @member {Boolean} Request#acceptJSON
|
||||
* @since 1.0.0
|
||||
*/
|
||||
acceptJSON: boolean;
|
||||
|
||||
/**
|
||||
* Request remote IPv4 address
|
||||
* @member {String} Request#ip
|
||||
* @example
|
||||
* ```js
|
||||
* this.request.ip
|
||||
@@ -72,7 +70,6 @@ interface Request extends KoaApplication.Request { // tslint:disable-line
|
||||
* Get all pass through ip addresses from the request.
|
||||
* Enable only on `app.config.proxy = true`
|
||||
*
|
||||
* @member {Array} Request#ips
|
||||
* @example
|
||||
* ```js
|
||||
* this.request.ips
|
||||
@@ -85,7 +82,6 @@ interface Request extends KoaApplication.Request { // tslint:disable-line
|
||||
|
||||
/**
|
||||
* get params pass by querystring, all value are Array type. {@link Request#query}
|
||||
* @member {Array} Request#queries
|
||||
* @example
|
||||
* ```js
|
||||
* GET http://127.0.0.1:7001?a=b&a=c&o[foo]=bar&b[]=1&b[]=2&e=val
|
||||
@@ -103,7 +99,6 @@ interface Request extends KoaApplication.Request { // tslint:disable-line
|
||||
|
||||
/**
|
||||
* get params pass by querystring, all value are String type.
|
||||
* @member {Object} Request#query
|
||||
* @example
|
||||
* ```js
|
||||
* GET http://127.0.0.1:7001?name=Foo&age=20&age=21
|
||||
@@ -132,7 +127,6 @@ interface Response extends KoaApplication.Response { // tslint:disable-line
|
||||
* instead of show current 500 status page.
|
||||
* And access log should save 500 not 302,
|
||||
* then the `realStatus` can help us find out the real status code.
|
||||
* @member {Number} Context#realStatus
|
||||
*/
|
||||
realStatus: number;
|
||||
}
|
||||
@@ -140,19 +134,19 @@ interface Response extends KoaApplication.Response { // tslint:disable-line
|
||||
interface ContextView { // tslint:disable-line
|
||||
/**
|
||||
* Render a file by view engine
|
||||
* @param {String} name - the file path based on root
|
||||
* @param {Object} [locals] - data used by template
|
||||
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return {Promise<String>} result - return a promise with a render result
|
||||
* @param name - the file path based on root
|
||||
* @param [locals] - data used by template
|
||||
* @param [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return result - return a promise with a render result
|
||||
*/
|
||||
render(name: string, locals: any, options?: any): Promise<string>;
|
||||
|
||||
/**
|
||||
* Render a template string by view engine
|
||||
* @param {String} tpl - template string
|
||||
* @param {Object} [locals] - data used by template
|
||||
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return {Promise<String>} result - return a promise with a render result
|
||||
* @param tpl - template string
|
||||
* @param [locals] - data used by template
|
||||
* @param [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return result - return a promise with a render result
|
||||
*/
|
||||
renderString(name: string, locals: any, options?: any): Promise<string>;
|
||||
}
|
||||
@@ -162,60 +156,79 @@ export type LoggerLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'NONE';
|
||||
export interface EggAppConfig {
|
||||
workerStartTimeout: number;
|
||||
baseDir: string;
|
||||
/**
|
||||
* The option of `bodyParser` middleware
|
||||
*
|
||||
* @member Config#bodyParser
|
||||
* @property {Boolean} enable - enable bodyParser or not, default to true
|
||||
* @property {String | RegExp | Function | Array} ignore - won't parse request body when url path hit ignore pattern, can not set `ignore` when `match` presented
|
||||
* @property {String | RegExp | Function | Array} match - will parse request body only when url path hit match pattern
|
||||
* @property {String} encoding - body encoding config, default utf8
|
||||
* @property {String} formLimit - form body size limit, default 100kb
|
||||
* @property {String} jsonLimit - json body size limit, default 100kb
|
||||
* @property {Boolean} strict - json body strict mode, if set strict value true, then only receive object and array json body
|
||||
* @property {Number} queryString.arrayLimit - from item array length limit, default 100
|
||||
* @property {Number} queryString.depth - json value deep lenght, default 5
|
||||
* @property {Number} queryString.parameterLimit - paramter number limit ,default 1000
|
||||
*/
|
||||
bodyParser: {
|
||||
/**
|
||||
* enable bodyParser or not
|
||||
* @default true
|
||||
*/
|
||||
enable: boolean;
|
||||
/**
|
||||
* body encoding config
|
||||
* @default utf8
|
||||
*/
|
||||
encoding: string;
|
||||
/**
|
||||
* form body size limit
|
||||
* @default 100kb
|
||||
*/
|
||||
formLimit: string;
|
||||
/**
|
||||
* json body size limit
|
||||
* @default 100kb
|
||||
*/
|
||||
jsonLimit: string;
|
||||
/** json body strict mode, if set strict value true, then only receive object and array json body */
|
||||
strict: true;
|
||||
queryString: {
|
||||
/**
|
||||
* from item array length limit
|
||||
* @default 100
|
||||
*/
|
||||
arrayLimit: number;
|
||||
/**
|
||||
* json value deep lenght
|
||||
* @default 5
|
||||
*/
|
||||
depth: number;
|
||||
/**
|
||||
* paramter number limit
|
||||
* @default 1000
|
||||
*/
|
||||
parameterLimit: number;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* logger options
|
||||
* @member Config#logger
|
||||
* @property {String} dir - directory of log files
|
||||
* @property {String} encoding - log file encloding, defaults to utf8
|
||||
* @property {String} level - default log level, could be: DEBUG, INFO, WARN, ERROR or NONE, defaults to INFO in production
|
||||
* @property {String} consoleLevel - log level of stdout, defaults to INFO in local serverEnv, defaults to WARN in unittest, defaults to NONE elsewise
|
||||
* @property {Boolean} outputJSON - log as JSON or not, defaults to false
|
||||
* @property {Boolean} buffer - if enabled, flush logs to disk at a certain frequency to improve performance, defaults to true
|
||||
* @property {String} errorLogName - file name of errorLogger
|
||||
* @property {String} coreLogName - file name of coreLogger
|
||||
* @property {String} agentLogName - file name of agent worker log
|
||||
* @property {Object} coreLogger - custom config of coreLogger
|
||||
*/
|
||||
logger: {
|
||||
/** directory of log files */
|
||||
dir: string;
|
||||
/**
|
||||
* log file encloding
|
||||
* @default utf8
|
||||
*/
|
||||
encoding: string;
|
||||
env: string;
|
||||
/**
|
||||
* default log level, could be: DEBUG, INFO, WARN, ERROR or NONE
|
||||
* @default INFO in production
|
||||
*/
|
||||
level: LoggerLevel;
|
||||
/**
|
||||
* log level of stdout
|
||||
* @default INFO in local serverEnv, WARN in unittest, NONE elsewise
|
||||
*/
|
||||
consoleLevel: LoggerLevel;
|
||||
/** log as JSON or not, defaults to false */
|
||||
outputJSON: boolean;
|
||||
/** if enabled, flush logs to disk at a certain frequency to improve performance, defaults to true */
|
||||
buffer: boolean;
|
||||
appLogName: string;
|
||||
/** file name of coreLogger */
|
||||
coreLogName: string;
|
||||
/** file name of agent worker log */
|
||||
agentLogName: string;
|
||||
/** file name of errorLogger */
|
||||
errorLogName: string;
|
||||
/** custom config of coreLogger */
|
||||
coreLogger: any;
|
||||
};
|
||||
|
||||
@@ -292,18 +305,20 @@ export interface EggAppConfig {
|
||||
*/
|
||||
ipHeaders: string;
|
||||
|
||||
/**
|
||||
* jsonp options
|
||||
* @member Config#jsonp
|
||||
* @property {String} callback - jsonp callback method key, default to `_callback`
|
||||
* @property {Number} limit - callback method name's max length, default to `50`
|
||||
* @property {Boolean} csrf - enable csrf check or not. default to false
|
||||
* @property {String|RegExp|Array} whiteList - referrer white list
|
||||
*/
|
||||
jsonp: {
|
||||
/**
|
||||
* callback method name's max length
|
||||
* @default 50
|
||||
*/
|
||||
limit: number;
|
||||
/**
|
||||
* jsonp callback method key
|
||||
* @default `_callback`
|
||||
*/
|
||||
callback: string;
|
||||
/** enable csrf check or not. default to false */
|
||||
csrf: boolean;
|
||||
/** referrer white list */
|
||||
whiteList: string | RegExp | Array<string | RegExp>;
|
||||
};
|
||||
|
||||
@@ -356,8 +371,8 @@ export interface Router extends KoaRouter {
|
||||
resources(name: string, prefix: string, middleware: any): Router;
|
||||
|
||||
/**
|
||||
* @param {String} name - Router name
|
||||
* @param {Object} params - more parameters
|
||||
* @param name - Router name
|
||||
* @param params - more parameters
|
||||
* @example
|
||||
* ```js
|
||||
* router.url('edit_post', { id: 1, name: 'foo', page: 2 })
|
||||
@@ -365,7 +380,7 @@ export interface Router extends KoaRouter {
|
||||
* router.url('posts', { name: 'foo&1', page: 2 })
|
||||
* => /posts?name=foo%261&page=2
|
||||
* ```
|
||||
* @return {String} url by path name and query params.
|
||||
* @return url by path name and query params.
|
||||
* @since 1.0.0
|
||||
*/
|
||||
url(name: string, params: any): any;
|
||||
@@ -410,7 +425,6 @@ declare interface EggApplication extends KoaApplication { // tslint:disable-line
|
||||
/**
|
||||
* Logger for Application, wrapping app.coreLogger with context infomation
|
||||
*
|
||||
* @member {ContextLogger} Context#logger
|
||||
* @since 1.0.0
|
||||
* @example
|
||||
* ```js
|
||||
@@ -462,7 +476,7 @@ declare interface EggApplication extends KoaApplication { // tslint:disable-line
|
||||
*
|
||||
* If error is thrown when it's closing, the promise will reject.
|
||||
* It will also reject after following call.
|
||||
* @return {Promise} promise
|
||||
* @return promise
|
||||
* @since 1.0.0
|
||||
*/
|
||||
close(): Promise<any>;
|
||||
@@ -605,7 +619,6 @@ export interface Context extends KoaApplication.Context {
|
||||
* 设置返回资源对象
|
||||
* set the ctx.body.data value
|
||||
*
|
||||
* @member {Object} Context#data=
|
||||
* @example
|
||||
* ```js
|
||||
* ctx.data = {
|
||||
@@ -677,7 +690,6 @@ export interface Context extends KoaApplication.Context {
|
||||
*
|
||||
* `ctx.locals` has cache, it only merges `app.locals` once in one request.
|
||||
*
|
||||
* @member {Object} Context#locals
|
||||
*/
|
||||
locals: any;
|
||||
|
||||
@@ -689,7 +701,6 @@ export interface Context extends KoaApplication.Context {
|
||||
/**
|
||||
* Logger for Application, wrapping app.coreLogger with context infomation
|
||||
*
|
||||
* @member {ContextLogger} Context#logger
|
||||
* @since 1.0.0
|
||||
* @example
|
||||
* ```js
|
||||
@@ -718,19 +729,19 @@ export interface Context extends KoaApplication.Context {
|
||||
|
||||
/**
|
||||
* Render a file by view engine
|
||||
* @param {String} name - the file path based on root
|
||||
* @param {Object} [locals] - data used by template
|
||||
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return {Promise<String>} result - return a promise with a render result
|
||||
* @param name - the file path based on root
|
||||
* @param [locals] - data used by template
|
||||
* @param [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return result - return a promise with a render result
|
||||
*/
|
||||
render(name: string, locals: any, options?: any): Promise<string>;
|
||||
|
||||
/**
|
||||
* Render a template string by view engine
|
||||
* @param {String} tpl - template string
|
||||
* @param {Object} [locals] - data used by template
|
||||
* @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return {Promise<String>} result - return a promise with a render result
|
||||
* @param tpl - template string
|
||||
* @param [locals] - data used by template
|
||||
* @param [options] - view options, you can use `options.viewEngine` to specify view engine
|
||||
* @return result - return a promise with a render result
|
||||
*/
|
||||
renderString(name: string, locals: any, options?: any): Promise<string>;
|
||||
|
||||
@@ -745,8 +756,7 @@ export interface Context extends KoaApplication.Context {
|
||||
* // get other fields
|
||||
* console.log(stream.fields);
|
||||
* ```
|
||||
* @method Context#getFileStream
|
||||
* @return {ReadStream} stream
|
||||
* @return stream
|
||||
* @since 1.0.0
|
||||
*/
|
||||
getFileStream(): Promise<FileStream>;
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
"rules": {
|
||||
// All are TODOs
|
||||
"comment-format": false,
|
||||
"jsdoc-format": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-padding": false,
|
||||
"no-any-union": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"strict-export-declare-modifiers": false
|
||||
|
||||
-2
@@ -73,7 +73,6 @@ declare class Settings extends EventEmitter {
|
||||
*
|
||||
* @param keyPath The path to the key whose value we wish to set. This key need not already exist.
|
||||
* @param value The value to set the key at the chosen key path to. This must be a data type supported by JSON: object, array, string, number, boolean, or null.
|
||||
* @param options
|
||||
* @throws if key path is not a string.
|
||||
* @throws if options is not an object.
|
||||
* @see setSync
|
||||
@@ -91,7 +90,6 @@ declare class Settings extends EventEmitter {
|
||||
* Deletes the key and value at the chosen key path.
|
||||
*
|
||||
* @param keyPath The path to the key we wish to unset.
|
||||
* @param options
|
||||
* @throws if keyPath is not a string.
|
||||
* @throws if options is not an object.
|
||||
* @see deleteSync
|
||||
|
||||
Vendored
+10
-45
@@ -592,7 +592,6 @@ declare module 'ember' {
|
||||
/**
|
||||
* Implements some standard methods for comparing objects. Add this mixin to
|
||||
* any class you create that can compare its instances.
|
||||
* @private
|
||||
*/
|
||||
interface Comparable {
|
||||
compare(a: any, b: any): number;
|
||||
@@ -704,7 +703,6 @@ declare module 'ember' {
|
||||
}
|
||||
/**
|
||||
* A container used to instantiate and cache objects.
|
||||
* @private
|
||||
*/
|
||||
class Container {
|
||||
/**
|
||||
@@ -726,7 +724,6 @@ declare module 'ember' {
|
||||
}
|
||||
/**
|
||||
* Additional methods for the Controller.
|
||||
* @private
|
||||
*/
|
||||
interface ControllerMixin extends ActionHandler {
|
||||
replaceRoute(name: string, ...args: any[]): void;
|
||||
@@ -741,7 +738,6 @@ declare module 'ember' {
|
||||
* Implements some standard methods for copying an object. Add this mixin to
|
||||
* any object you create that can create a copy of itself. This mixin is
|
||||
* added automatically to the built-in array.
|
||||
* @private
|
||||
*/
|
||||
interface Copyable {
|
||||
/**
|
||||
@@ -761,29 +757,24 @@ declare module 'ember' {
|
||||
/**
|
||||
An overridable method called when objects are instantiated. By default,
|
||||
does nothing unless it is overridden during class definition.
|
||||
@method init
|
||||
**/
|
||||
init(): void;
|
||||
|
||||
/**
|
||||
Defines the properties that will be concatenated from the superclass (instead of overridden).
|
||||
@property concatenatedProperties
|
||||
@type Array
|
||||
@default null
|
||||
**/
|
||||
* Defines the properties that will be concatenated from the superclass (instead of overridden).
|
||||
* @default null
|
||||
*/
|
||||
concatenatedProperties: any[];
|
||||
|
||||
/**
|
||||
Destroyed object property flag. If this property is true the observers and bindings were
|
||||
already removed by the effect of calling the destroy() method.
|
||||
@property isDestroyed
|
||||
@default false
|
||||
**/
|
||||
isDestroyed: boolean;
|
||||
/**
|
||||
Destruction scheduled flag. The destroy() method has been called. The object stays intact
|
||||
until the end of the run loop at which point the isDestroyed flag is set.
|
||||
@property isDestroying
|
||||
@default false
|
||||
**/
|
||||
isDestroying: boolean;
|
||||
@@ -795,22 +786,19 @@ declare module 'ember' {
|
||||
raised.
|
||||
Note that destruction is scheduled for the end of the run loop and does not
|
||||
happen immediately. It will set an isDestroying flag immediately.
|
||||
@method destroy
|
||||
@return {Ember.Object} receiver
|
||||
@return receiver
|
||||
*/
|
||||
destroy(): CoreObject;
|
||||
|
||||
/**
|
||||
Override to implement teardown.
|
||||
@method willDestroy
|
||||
*/
|
||||
willDestroy(): void;
|
||||
|
||||
/**
|
||||
Returns a string representation which attempts to provide more information than Javascript's toString
|
||||
typically does, in a generic way for all Ember objects (e.g., "<App.Person:ember1024>").
|
||||
@method toString
|
||||
@return {String} string representation
|
||||
@return string representation
|
||||
**/
|
||||
toString(): string;
|
||||
|
||||
@@ -1273,7 +1261,6 @@ declare module 'ember' {
|
||||
* corresponding `Ember.Views.` For example, when you click on a view,
|
||||
* `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets
|
||||
* called.
|
||||
* @private
|
||||
*/
|
||||
class EventDispatcher extends Object {
|
||||
/**
|
||||
@@ -1332,7 +1319,6 @@ declare module 'ember' {
|
||||
* The `Ember.Freezable` mixin implements some basic methods for marking an
|
||||
* object as frozen. Once an object is frozen it should be read only. No changes
|
||||
* may be made the internal state of the object.
|
||||
* @private
|
||||
* @deprecated Use `Object.freeze` instead.
|
||||
*/
|
||||
interface Freezable {
|
||||
@@ -1344,13 +1330,11 @@ declare module 'ember' {
|
||||
* `Ember.HashLocation` implements the location API using the browser's
|
||||
* hash. At present, it relies on a `hashchange` event existing in the
|
||||
* browser.
|
||||
* @protected
|
||||
*/
|
||||
class HashLocation extends Object {}
|
||||
/**
|
||||
* Ember.HistoryLocation implements the location API using the browser's
|
||||
* history.pushState API.
|
||||
* @protected
|
||||
*/
|
||||
class HistoryLocation extends Object {}
|
||||
/**
|
||||
@@ -1378,7 +1362,6 @@ declare module 'ember' {
|
||||
* The purpose of the Ember Instrumentation module is
|
||||
* to provide efficient, general-purpose instrumentation
|
||||
* for Ember.
|
||||
* @private
|
||||
*/
|
||||
const Instrumentation: {
|
||||
instrument(name: string, payload: any, callback: Function, binding: any): void;
|
||||
@@ -1639,7 +1622,6 @@ declare module 'ember' {
|
||||
* testing, or when you need to manage state with your Router, but temporarily
|
||||
* don't want it to muck with the URL (for example when you embed your
|
||||
* application in a larger page).
|
||||
* @private
|
||||
*/
|
||||
class NoneLocation extends Object {}
|
||||
/**
|
||||
@@ -1792,7 +1774,6 @@ declare module 'ember' {
|
||||
/**
|
||||
* A registry used to store factory and option information keyed
|
||||
* by type.
|
||||
* @private
|
||||
*/
|
||||
class Registry {
|
||||
register(
|
||||
@@ -2945,7 +2926,6 @@ declare module 'ember' {
|
||||
* NOTE: This is a low-level method used by other parts of the API.
|
||||
* You almost never want to call this method directly. Instead you
|
||||
* should use Ember.mixin() to define new properties.
|
||||
* @private
|
||||
*/
|
||||
function defineProperty(
|
||||
obj: object,
|
||||
@@ -2956,7 +2936,6 @@ declare module 'ember' {
|
||||
): void;
|
||||
/**
|
||||
* Alias an old, deprecated method with its new counterpart.
|
||||
* @private
|
||||
*/
|
||||
function deprecateFunc<Func extends ((...args: any[]) => any)>(
|
||||
message: string,
|
||||
@@ -2964,7 +2943,6 @@ declare module 'ember' {
|
||||
func: Func
|
||||
): Func;
|
||||
/**
|
||||
* @private
|
||||
* @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options
|
||||
*/
|
||||
function deprecateFunc<Func extends ((...args: any[]) => any)>(
|
||||
@@ -3168,13 +3146,11 @@ declare module 'ember' {
|
||||
/**
|
||||
* Detects when a specific package of Ember (e.g. 'Ember.Application')
|
||||
* has fully loaded and is available for extension.
|
||||
* @private
|
||||
*/
|
||||
function onLoad(name: string, callback: Function): any;
|
||||
/**
|
||||
* Called when an Ember.js package (e.g Ember.Application) has finished
|
||||
* loading. Triggers any callbacks registered for this event.
|
||||
* @private
|
||||
*/
|
||||
function runLoadHooks(name: string, object?: {}): any;
|
||||
/**
|
||||
@@ -3234,7 +3210,6 @@ declare module 'ember' {
|
||||
/**
|
||||
* Convenience method to inspect an object. This method will attempt to
|
||||
* convert the object into a useful string description.
|
||||
* @private
|
||||
*/
|
||||
function inspect(obj: any): string;
|
||||
/**
|
||||
@@ -3246,9 +3221,8 @@ declare module 'ember' {
|
||||
* Forces the passed object to be part of an array. If the object is already
|
||||
* an array, it will return the object. Otherwise, it will add the object to
|
||||
* an array. If obj is `null` or `undefined`, it will return an empty array.
|
||||
* @private
|
||||
*/
|
||||
function makeArray<T>(obj?: T[] | T | null | undefined): T[];
|
||||
function makeArray<T>(obj?: T[] | T | null): T[];
|
||||
/**
|
||||
* Framework objects in an Ember application (components, services, routes, etc.)
|
||||
* are created via a factory and dependency injection system. Each of these
|
||||
@@ -3286,25 +3260,16 @@ declare module 'ember' {
|
||||
* application.
|
||||
*/
|
||||
const testing: boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
const instrument: typeof Instrumentation.instrument;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
const reset: typeof Instrumentation.reset;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
const subscribe: typeof Instrumentation.subscribe;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
const unsubscribe: typeof Instrumentation.unsubscribe;
|
||||
/**
|
||||
* Expands `pattern`, invoking `callback` for each expansion.
|
||||
* @private
|
||||
*/
|
||||
function expandProperties(pattern: string, callback: (expanded: string) => void): void;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
"prefer-const": false,
|
||||
"no-void-expression": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-submodule-imports": false
|
||||
"no-submodule-imports": false,
|
||||
|
||||
"no-unnecessary-class": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
-52
@@ -48,31 +48,26 @@ export type Intercepter<T> = (intercepter: T) => void;
|
||||
export interface CommonWrapper<P = {}, S = {}> {
|
||||
/**
|
||||
* Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true.
|
||||
* @param predicate
|
||||
*/
|
||||
filterWhere(predicate: (wrapper: this) => boolean): this;
|
||||
|
||||
/**
|
||||
* Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in.
|
||||
* @param node
|
||||
*/
|
||||
contains(node: ReactElement<any> | string): boolean;
|
||||
|
||||
/**
|
||||
* Returns whether or not a given react element exists in the shallow render tree.
|
||||
* @param node
|
||||
*/
|
||||
containsMatchingElement(node: ReactElement<any>): boolean;
|
||||
|
||||
/**
|
||||
* Returns whether or not all the given react elements exists in the shallow render tree
|
||||
* @param nodes
|
||||
*/
|
||||
containsAllMatchingElements(nodes: Array<ReactElement<any>>): boolean;
|
||||
|
||||
/**
|
||||
* Returns whether or not one of the given react elements exists in the shallow render tree.
|
||||
* @param nodes
|
||||
*/
|
||||
containsAnyMatchingElements(nodes: Array<ReactElement<any>>): boolean;
|
||||
|
||||
@@ -88,13 +83,11 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
|
||||
/**
|
||||
* Returns whether or not the current node has a className prop including the passed in class name.
|
||||
* @param className
|
||||
*/
|
||||
hasClass(className: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns whether or not the current node matches a provided selector.
|
||||
* @param selector
|
||||
*/
|
||||
is(selector: EnzymeSelector): boolean;
|
||||
|
||||
@@ -112,7 +105,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
/**
|
||||
* Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector.
|
||||
* This method is effectively the negation or inverse of filter.
|
||||
* @param selector
|
||||
*/
|
||||
not(selector: EnzymeSelector): this;
|
||||
|
||||
@@ -134,7 +126,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
|
||||
/**
|
||||
* Returns the node at a given index of the current wrapper.
|
||||
* @param index
|
||||
*/
|
||||
get(index: number): ReactElement<any>;
|
||||
|
||||
@@ -165,7 +156,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
|
||||
/**
|
||||
* Returns a wrapper around the node at a given index of the current wrapper.
|
||||
* @param index
|
||||
*/
|
||||
at(index: number): this;
|
||||
|
||||
@@ -191,7 +181,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
|
||||
/**
|
||||
* Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value.
|
||||
* @param [key]
|
||||
*/
|
||||
state(): S;
|
||||
state<K extends keyof S>(key: K): S[K];
|
||||
@@ -214,7 +203,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
* Returns the prop value for the node of the current wrapper with the provided key.
|
||||
*
|
||||
* NOTE: can only be called on a wrapper of a single node.
|
||||
* @param key
|
||||
*/
|
||||
prop<K extends keyof P>(key: K): P[K];
|
||||
prop<T>(key: string): T;
|
||||
@@ -228,7 +216,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
/**
|
||||
* Simulate events.
|
||||
* Returns itself.
|
||||
* @param event
|
||||
* @param args?
|
||||
*/
|
||||
simulate(event: string, ...args: any[]): this;
|
||||
@@ -242,8 +229,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
* Returns itself.
|
||||
*
|
||||
* NOTE: can only be called on a wrapper instance that is also the root instance.
|
||||
* @param state
|
||||
* @param [callback]
|
||||
*/
|
||||
setState<K extends keyof S>(state: Pick<S, K>, callback?: () => void): this;
|
||||
|
||||
@@ -256,7 +241,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
* Returns itself.
|
||||
*
|
||||
* NOTE: can only be called on a wrapper instance that is also the root instance.
|
||||
* @param props
|
||||
*/
|
||||
setProps<K extends keyof P>(props: Pick<P, K>): this;
|
||||
|
||||
@@ -266,7 +250,6 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
* Returns itself.
|
||||
*
|
||||
* NOTE: can only be called on a wrapper instance that is also the root instance.
|
||||
* @param state
|
||||
*/
|
||||
setContext(context: any): this;
|
||||
|
||||
@@ -320,40 +303,32 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
/**
|
||||
* Applies the provided reducing function to every node in the wrapper to reduce to a single value. Each node
|
||||
* is passed in as a ShallowWrapper, and is processed from left to right.
|
||||
* @param fn
|
||||
* @param initialValue
|
||||
*/
|
||||
reduce<R>(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R;
|
||||
|
||||
/**
|
||||
* Applies the provided reducing function to every node in the wrapper to reduce to a single value.
|
||||
* Each node is passed in as a ShallowWrapper, and is processed from right to left.
|
||||
* @param fn
|
||||
* @param initialValue
|
||||
*/
|
||||
reduceRight<R>(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R;
|
||||
|
||||
/**
|
||||
* Returns whether or not any of the nodes in the wrapper match the provided selector.
|
||||
* @param selector
|
||||
*/
|
||||
some(selector: EnzymeSelector): boolean;
|
||||
|
||||
/**
|
||||
* Returns whether or not any of the nodes in the wrapper pass the provided predicate function.
|
||||
* @param fn
|
||||
*/
|
||||
someWhere(fn: (wrapper: this) => boolean): boolean;
|
||||
|
||||
/**
|
||||
* Returns whether or not all of the nodes in the wrapper match the provided selector.
|
||||
* @param selector
|
||||
*/
|
||||
every(selector: EnzymeSelector): boolean;
|
||||
|
||||
/**
|
||||
* Returns whether or not all of the nodes in the wrapper pass the provided predicate function.
|
||||
* @param fn
|
||||
*/
|
||||
everyWhere(fn: (wrapper: this) => boolean): boolean;
|
||||
|
||||
@@ -378,11 +353,9 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
length: number;
|
||||
}
|
||||
|
||||
export class ShallowWrapper {
|
||||
export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {}
|
||||
export class ShallowWrapper<P = {}, S = {}> {
|
||||
constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper, options?: ShallowRendererProps);
|
||||
}
|
||||
|
||||
export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
shallow(options?: ShallowRendererProps): ShallowWrapper<P, S>;
|
||||
unmount(): this;
|
||||
|
||||
@@ -404,14 +377,12 @@ export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
|
||||
/**
|
||||
* Finds every node in the render tree that returns true for the provided predicate function.
|
||||
* @param predicate
|
||||
*/
|
||||
findWhere(predicate: (wrapper: ShallowWrapper<any, any>) => boolean): ShallowWrapper<any, any>;
|
||||
|
||||
/**
|
||||
* Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector
|
||||
* can be provided and it will filter the children by this selector.
|
||||
* @param [selector]
|
||||
*/
|
||||
children<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
|
||||
children<P2>(statelessComponent: StatelessComponent<P2>): ShallowWrapper<P2, never>;
|
||||
@@ -420,7 +391,6 @@ export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
|
||||
/**
|
||||
* Returns a new wrapper with child at the specified index.
|
||||
* @param index
|
||||
*/
|
||||
childAt(index: number): ShallowWrapper<any, any>;
|
||||
childAt<P2, S2>(index: number): ShallowWrapper<P2, S2>;
|
||||
@@ -428,7 +398,6 @@ export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
/**
|
||||
* Shallow render the one non-DOM child of the current wrapper, and return a wrapper around the result.
|
||||
* NOTE: can only be called on wrapper of a single non-DOM component element node.
|
||||
* @param [options]
|
||||
*/
|
||||
dive<P2, S2>(options?: ShallowRendererProps): ShallowWrapper<P2, S2>;
|
||||
|
||||
@@ -445,7 +414,6 @@ export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
* current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector.
|
||||
*
|
||||
* Note: can only be called on a wrapper of a single node.
|
||||
* @param [selector]
|
||||
*/
|
||||
parents<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
|
||||
parents<P2>(statelessComponent: StatelessComponent<P2>): ShallowWrapper<P2, never>;
|
||||
@@ -457,7 +425,6 @@ export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
* ancestors in the tree, starting with itself.
|
||||
*
|
||||
* Note: can only be called on a wrapper of a single node.
|
||||
* @param selector
|
||||
*/
|
||||
closest<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>;
|
||||
closest<P2>(statelessComponent: StatelessComponent<P2>): ShallowWrapper<P2, never>;
|
||||
@@ -470,11 +437,10 @@ export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
parent(): ShallowWrapper<any, any>;
|
||||
}
|
||||
|
||||
export class ReactWrapper {
|
||||
export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {}
|
||||
export class ReactWrapper<P = {}, S = {}> {
|
||||
constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper, options?: MountRendererProps);
|
||||
}
|
||||
|
||||
export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
unmount(): this;
|
||||
mount(): this;
|
||||
|
||||
@@ -517,7 +483,6 @@ export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
|
||||
/**
|
||||
* Finds every node in the render tree that returns true for the provided predicate function.
|
||||
* @param predicate
|
||||
*/
|
||||
findWhere(predicate: (wrapper: ReactWrapper<any, any>) => boolean): ReactWrapper<any, any>;
|
||||
|
||||
@@ -531,7 +496,6 @@ export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
/**
|
||||
* Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector
|
||||
* can be provided and it will filter the children by this selector.
|
||||
* @param [selector]
|
||||
*/
|
||||
children<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
children<P2>(statelessComponent: StatelessComponent<P2>): ReactWrapper<P2, never>;
|
||||
@@ -540,7 +504,6 @@ export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
|
||||
/**
|
||||
* Returns a new wrapper with child at the specified index.
|
||||
* @param index
|
||||
*/
|
||||
childAt(index: number): ReactWrapper<any, any>;
|
||||
childAt<P2, S2>(index: number): ReactWrapper<P2, S2>;
|
||||
@@ -550,7 +513,6 @@ export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
* current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector.
|
||||
*
|
||||
* Note: can only be called on a wrapper of a single node.
|
||||
* @param [selector]
|
||||
*/
|
||||
parents<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
parents<P2>(statelessComponent: StatelessComponent<P2>): ReactWrapper<P2, never>;
|
||||
@@ -562,7 +524,6 @@ export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
* ancestors in the tree, starting with itself.
|
||||
*
|
||||
* Note: can only be called on a wrapper of a single node.
|
||||
* @param selector
|
||||
*/
|
||||
closest<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
closest<P2>(statelessComponent: StatelessComponent<P2>): ReactWrapper<P2, never>;
|
||||
@@ -583,8 +544,6 @@ export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {
|
||||
* Returns itself.
|
||||
*
|
||||
* NOTE: can only be called on a wrapper instance that is also the root instance.
|
||||
* @param props
|
||||
* @param [callback]
|
||||
*/
|
||||
setProps<K extends keyof P>(props: Pick<P, K>, callback?: () => void): this;
|
||||
}
|
||||
@@ -618,24 +577,18 @@ export interface MountRendererProps {
|
||||
/**
|
||||
* Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that
|
||||
* your tests aren't indirectly asserting on behavior of child components.
|
||||
* @param node
|
||||
* @param [options]
|
||||
*/
|
||||
export function shallow<P>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, any>;
|
||||
export function shallow<P, S>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, S>;
|
||||
|
||||
/**
|
||||
* Mounts and renders a react component into the document and provides a testing wrapper around it.
|
||||
* @param node
|
||||
* @param [options]
|
||||
*/
|
||||
export function mount<P>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, any>;
|
||||
export function mount<P, S>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, S>;
|
||||
|
||||
/**
|
||||
* Render react components to static HTML and analyze the resulting HTML structure.
|
||||
* @param node
|
||||
* @param [options]
|
||||
*/
|
||||
export function render<P, S>(node: ReactElement<P>, options?: any): Cheerio;
|
||||
|
||||
@@ -646,6 +599,5 @@ export class EnzymeAdapter {
|
||||
/**
|
||||
* Configure enzyme to use the correct adapter for the react verstion
|
||||
* This is enabling the Enzyme configuration with adapters in TS
|
||||
* @param options
|
||||
*/
|
||||
export function configure(options: { adapter: EnzymeAdapter }): void;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user