@datagrok-libraries/utils 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "fullName": "Utils",
7
- "version": "0.0.7",
7
+ "version": "0.0.8",
8
8
  "description": "Common utilities",
9
9
  "dependencies": {
10
10
  "@keckelt/tsne": "^1.0.2",
@@ -0,0 +1,82 @@
1
+ export default class BitArray {
2
+ static _onBitCount: Int8Array;
3
+ static _firstOnBit: Int8Array;
4
+ static _lastOnBit: Int8Array;
5
+ private _data;
6
+ private _length;
7
+ private _version;
8
+ private _updateLevel;
9
+ private _selectedCount;
10
+ private _selectedCountVersion;
11
+ private _selectedIndexesVersion;
12
+ private _versionedName;
13
+ private _versionedNameVersion;
14
+ SHRINK_THRESHOLD: number;
15
+ constructor(data: Uint32Array, length: number);
16
+ constructor(length: number, defaultValue?: boolean);
17
+ getRawData(): Uint32Array;
18
+ assureGoez(num: number, argName: String): void;
19
+ assureInRange(value: number, min: number, max: number, argName: String): void;
20
+ copy(src: Uint32Array, dst: Uint32Array, count: number): void;
21
+ copyFrom(other: BitArray): void;
22
+ get length(): number;
23
+ get buffer(): Uint32Array;
24
+ set buffer(data: Uint32Array);
25
+ get version(): number;
26
+ set version(value: number);
27
+ incrementVersion(notify?: boolean): void;
28
+ get lengthInInts(): number;
29
+ get versionedName(): string;
30
+ set versionedName(name: string);
31
+ get self(): this;
32
+ setLength(value: number): void;
33
+ static fromAnd(set1: BitArray, set2: BitArray): BitArray;
34
+ private static _createBuffer;
35
+ static fromValues(values: Array<boolean>): BitArray;
36
+ static fromSeq(count: number, flag: Function): BitArray;
37
+ static fromString(s: string): BitArray;
38
+ static fromUint32Array(_length: number, _data: Uint32Array): BitArray;
39
+ static fromBytes(bytes: Uint8Array): BitArray;
40
+ toString(): string;
41
+ equals(other: BitArray): boolean;
42
+ /** Clones a bitset. */
43
+ clone(): BitArray;
44
+ /** Initializes a bitset. */
45
+ init(flag: Function, notify: boolean): BitArray;
46
+ invert(notify?: boolean): void;
47
+ setAll(value: boolean, notify?: boolean): void;
48
+ setIndexes(indexes: Array<number>, value?: boolean, clear?: boolean, notify?: boolean): void;
49
+ everyIndex(indexes: Array<number>, value?: boolean): boolean;
50
+ anyIndex(indexes: Array<number>, value?: boolean): boolean;
51
+ setWhere(check: Function, value?: boolean, clear?: boolean, notify?: boolean, allowClear?: boolean): void;
52
+ setRange(from: number, to: number, value: boolean, notify?: boolean): BitArray;
53
+ setRandom(n: number, value: boolean, notify?: boolean): void;
54
+ and(value: BitArray, notify?: boolean): BitArray;
55
+ andNot(value: BitArray, notify?: boolean): BitArray;
56
+ notAnd(value: BitArray, notify?: boolean): BitArray;
57
+ not(notify?: boolean): BitArray;
58
+ or(value: BitArray, notify?: boolean): this;
59
+ xor(value: BitArray, notify?: boolean): this;
60
+ insertAt(pos: number, n: number, flag?: boolean): void;
61
+ removeAt(pos: number, n?: number): void;
62
+ removeByMask(mask: BitArray, flag?: boolean): BitArray;
63
+ getBit(pos: number): boolean;
64
+ setBit(pos: number, bit: boolean, notify?: boolean): void;
65
+ setFast(i: number, value: boolean): void;
66
+ setTrue(pos: number): void;
67
+ setFalse(pos: number): void;
68
+ trueCount(): number;
69
+ falseCount(): number;
70
+ countBits(value: boolean): number;
71
+ countWhere(check: Function): number;
72
+ andWithCountBits(second: BitArray, value: boolean): number;
73
+ clear(): void;
74
+ contains(value: boolean): boolean;
75
+ get allTrue(): boolean;
76
+ get allFalse(): boolean;
77
+ get anyTrue(): boolean;
78
+ get anyFalse(): boolean;
79
+ findNext(index: number, value?: boolean): number;
80
+ findPrev(index: number, value?: boolean): number;
81
+ }
82
+ //# sourceMappingURL=bit-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bit-array.d.ts","sourceRoot":"","sources":["bit-array.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO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AKpB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;IA+BjC,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAenC,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM;IAuB1D,KAAK,IAAI,IAAI;IAGb,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAGjC,IAAI,OAAO,YAEV;IACD,IAAI,QAAQ,YAEX;IACD,IAAI,OAAO,YAEV;IACD,IAAI,QAAQ,YAEX;IAID,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,UAAO,GAAG,MAAM;IA+B7C,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,UAAO,GAAG,MAAM;CAwB9C"}
@@ -0,0 +1,66 @@
1
+ import { Matrix, Vector, Vectors, DistanceMetric } from './type_declarations';
2
+ /**
3
+ * Asserts a condition by throwing an Error.
4
+ *
5
+ * @export
6
+ * @param {boolean} [condition=false] Condition to assert.
7
+ * @param {string} [message='Assertion error.'] Message to output.
8
+ * @throws {Error}
9
+ */
10
+ export declare function assert(condition?: boolean, message?: string): void;
11
+ /**
12
+ * Generates single random integer from 0 to range.
13
+ *
14
+ * @export
15
+ * @param {number} range Max generating value.
16
+ * @return {number} A random integer generated.
17
+ */
18
+ export declare function randomInt(range: number): number;
19
+ /**
20
+ * Transpose matrix.
21
+ *
22
+ * @export
23
+ * @param {Matrix} matrix The matrix to be transposed.
24
+ * @return {Matrix} Transposed matrix.
25
+ * @todo Might be slow since used Array.map. Probably needs performance revision.
26
+ */
27
+ export declare function transposeMatrix(matrix: Matrix): Matrix;
28
+ /**
29
+ * Adds two vectors with the second one to be multiplied by the given ratio.
30
+ *
31
+ * @export
32
+ * @param {Vector} p The first vector to add.
33
+ * @param {Vector} q The second vector to add.
34
+ * @param {number} [multiplier=1] A multiplier to be used before the second vector is added.
35
+ * @return {Vector} New vector contained the result of operation p+multiplier*q.
36
+ */
37
+ export declare function vectorAdd(p: Vector, q: Vector, multiplier?: number): Vector;
38
+ /**
39
+ * Creates a matrix filled with random floating point values.
40
+ *
41
+ * @export
42
+ * @param {number} dimension1 The first dimension of the matrix.
43
+ * @param {number} dimension2 The second dimension of the matrix.
44
+ * @param {number} [scale=1.] Max value given by random generator.
45
+ * @return {Matrix} A new matrix filled with random floating point values.
46
+ */
47
+ export declare function fillRandomMatrix(dimension1: number, dimension2: number, scale?: number): Matrix;
48
+ /**
49
+ * Calculates Euclidean distance between two vectors.
50
+ *
51
+ * @export
52
+ * @param {Vector} p The first vector.
53
+ * @param {Vector} q The second vector.
54
+ * @return {number} Euclidean distance between the given vectors.
55
+ */
56
+ export declare function calculateEuclideanDistance(p: Vector, q: Vector): number;
57
+ /**
58
+ * Creates a distance matrix using a custom distance function.
59
+ *
60
+ * @export
61
+ * @param {Vectors} data Input vectors to calculate distances.
62
+ * @param {DistanceMetric} distance Custom distance function.
63
+ * @return {Matrix} Calculated custom distance matrix.
64
+ */
65
+ export declare function calcDistanceMatrix(data: Vectors, distance: DistanceMetric): Matrix;
66
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAe,OAAO,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEzF;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,SAAS,GAAE,OAAe,EAAE,OAAO,GAAE,MAA2B,QAItF;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAeD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,GAAE,MAAU,GAAG,MAAM,CAW9E;AAiCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,MAAM,CASnG;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAKvE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,CAWlF"}
@@ -0,0 +1,38 @@
1
+ import { Options, Coordinates } from './type_declarations';
2
+ /**
3
+ * Unified class implementing different dimensionality reduction methods.
4
+ *
5
+ * @export
6
+ * @class DimensionalityReducer
7
+ */
8
+ export declare class DimensionalityReducer {
9
+ private reducer;
10
+ static methods: string[];
11
+ private measurer;
12
+ /**
13
+ * Creates an instance of DimensionalityReducer.
14
+ * @param {any[]} data Vectors to embed.
15
+ * @param {string} method Embedding method to be applied
16
+ * @param {string} metric Distance metric to be computed between each of the vectors.
17
+ * @param {Options} [options] Options to pass to the implementing embedders.
18
+ * @memberof DimensionalityReducer
19
+ */
20
+ constructor(data: any[], method: string, metric: string, options?: Options);
21
+ /**
22
+ * Embeds the data given into the two-dimensional space using the chosen method.
23
+ *
24
+ * @param {boolean} transpose Whether to transform coordinates to have columns-first orientation.
25
+ * @throws {Error} If the embedding method was not found.
26
+ * @return {Coordinates} Cartesian coordinate of this embedding.
27
+ * @memberof DimensionalityReducer
28
+ */
29
+ transform(transpose?: boolean): Coordinates;
30
+ /**
31
+ * Returns dimensionality reduction methods available.
32
+ *
33
+ * @readonly
34
+ * @memberof DimensionalityReducer
35
+ */
36
+ static get availableMethods(): string[];
37
+ }
38
+ //# sourceMappingURL=reduce-dimensionality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reduce-dimensionality.d.ts","sourceRoot":"","sources":["reduce-dimensionality.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,EAAkB,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAuMlG;;;;;GAKG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAc,OAAO,EAAE,MAAM,EAAE,CAAoC;IACnE,OAAO,CAAC,QAAQ,CAAW;IAE3B;;;;;;;OAOG;gBACS,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;IA2B1E;;;;;;;OAOG;IACI,SAAS,CAAC,SAAS,GAAE,OAAe,GAAG,WAAW;IAYzD;;;;;OAKG;IACH,MAAM,KAAK,gBAAgB,aAE1B;CACF"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Class to categorial encode/decode aligned amino acid residues sequence.
3
+ *
4
+ * @export
5
+ * @class AlignedSequenceEncoder
6
+ */
7
+ export declare class AlignedSequenceEncoder {
8
+ protected aa2num: {
9
+ [name: string]: number;
10
+ };
11
+ protected num2aa: {
12
+ [code: number]: string;
13
+ };
14
+ constructor();
15
+ /**
16
+ * Truncate NH2 and -COOH terminals of the given sequence.
17
+ *
18
+ * @static
19
+ * @param {string} seq The sequence provided.
20
+ * @return {string} Truncated sequence.
21
+ * @memberof AlignedSequenceEncoder
22
+ */
23
+ static _truncateSequence(seq: string): string;
24
+ /**
25
+ * Cuts auxiliary defises before a residue.
26
+ *
27
+ * @static
28
+ * @param {string} seq The sequence to process.
29
+ * @return {string} Processed sequence.
30
+ * @memberof AlignedSequenceEncoder
31
+ */
32
+ static _dropDefises(seq: string): string;
33
+ /**
34
+ * Performs truncation and cutting auxiliary defises.
35
+ *
36
+ * @static
37
+ * @param {string} sequence The sequence work under process.
38
+ * @return {string} Result of cleaning.
39
+ * @memberof AlignedSequenceEncoder
40
+ */
41
+ static clean(sequence: string): string;
42
+ /**
43
+ * Categorial encode of the sequence provided.
44
+ *
45
+ * @param {string} sequence The sequence.
46
+ * @return {number[]} Encoded vector.
47
+ * @memberof AlignedSequenceEncoder
48
+ */
49
+ encode(sequence: string): number[];
50
+ /**
51
+ * Decode the encoded vector into the sequence back.
52
+ *
53
+ * @param {number[]} value The vector encoded.
54
+ * @return {string} Decoded sequence.
55
+ * @memberof AlignedSequenceEncoder
56
+ */
57
+ decode(value: number[]): string;
58
+ }
59
+ //# sourceMappingURL=sequence-encoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequence-encoder.d.ts","sourceRoot":"","sources":["sequence-encoder.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,qBAAa,sBAAsB;IAC/B,SAAS,CAAC,MAAM,EAAE;QAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;IAC3C,SAAS,CAAC,MAAM,EAAE;QAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;;IA8B3C;;;;;;;OAOG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAkB7C;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIxC;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAItC;;;;;;OAMG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAezC;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;CAYzC"}
package/src/spe.d.ts ADDED
@@ -0,0 +1,68 @@
1
+ import { Options, Coordinates, Vectors, DistanceMetric } from './type_declarations';
2
+ /**
3
+ * Implements stochastic proximity embedding.
4
+ *
5
+ * @export
6
+ * @class SPEBase
7
+ * @link doi:10.1016/S1093-3263(03)00155-4
8
+ */
9
+ export declare class SPEBase {
10
+ protected static dimension: number;
11
+ protected steps: number;
12
+ protected cycles: number;
13
+ protected cutoff: number;
14
+ protected lambda: number;
15
+ protected dlambda: number;
16
+ protected lambda2: number;
17
+ protected dlambda2: number;
18
+ protected epsilon: number;
19
+ protected distanceFunction: DistanceMetric;
20
+ protected distance: Coordinates;
21
+ /**
22
+ * Creates an instance of SPEBase.
23
+ * @param {Options} [options] Options to pass to the constructor.
24
+ * @memberof SPEBase
25
+ */
26
+ constructor(options?: Options);
27
+ /**
28
+ * Initializes distance matrix.
29
+ *
30
+ * @protected
31
+ * @param {Vectors} vectors Input vectors to calculate distance between.
32
+ * @memberof SPEBase
33
+ */
34
+ protected initDistance(vectors: Vectors): void;
35
+ /**
36
+ * Calculates distance between the two vectors given.
37
+ *
38
+ * @param {Vectors} vectors Set of vectors to calculate distances between.
39
+ * @param {number} index1 Index of the first vector of the pair.
40
+ * @param {number} index2 Index of the second vector of the pair.
41
+ * @return {number} Distance between these two vectors.
42
+ */
43
+ protected calcDistance(vectors: Vectors, index1: number, index2: number): number;
44
+ /**
45
+ * Embeds the vectors given into a two-dimensional space.
46
+ *
47
+ * @param {Vectors} vectors D-dimensional coordinates.
48
+ * @return {Coordinates} SPE coordinates in D space.
49
+ */
50
+ embed(vectors: Vectors): Coordinates;
51
+ }
52
+ /**
53
+ * Implements modified stochastic proximity embedding.
54
+ *
55
+ * @export
56
+ * @class PSPEBase
57
+ * @link doi:10.1016/S1093-3263(03)00155-4
58
+ */
59
+ export declare class PSPEBase extends SPEBase {
60
+ /**
61
+ * Embeds the vectors given into a two-dimensional space using a modified update rule.
62
+ *
63
+ * @param {Vectors} vectors D-dimensional coordinates.
64
+ * @return {Coordinates} SPE coordinates in D space.
65
+ */
66
+ embed(vectors: Vectors): Coordinates;
67
+ }
68
+ //# sourceMappingURL=spe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spe.d.ts","sourceRoot":"","sources":["spe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAGlF;;;;;;GAMG;AACH,qBAAa,OAAO;IAClB,SAAS,CAAC,MAAM,CAAC,SAAS,SAAK;IAC/B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAC3C,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;IAEhC;;;;OAIG;gBACS,OAAO,CAAC,EAAE,OAAO;IAgB7B;;;;;;OAMG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO;IAIvC;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAIhF;;;;;OAKG;IACI,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW;CA4C5C;AAED;;;;;;GAMG;AACF,qBAAa,QAAS,SAAQ,OAAO;IACpC;;;;;OAKG;IACI,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW;CAsC5C"}
@@ -0,0 +1,33 @@
1
+ import { DistanceMetric } from './type_declarations';
2
+ /**
3
+ * Unified class implementing the different string measures.
4
+ *
5
+ * @export
6
+ * @class Measurer
7
+ */
8
+ export declare class Measurer {
9
+ protected method: string;
10
+ static receipt: {
11
+ [name: string]: DistanceMetric;
12
+ };
13
+ /**
14
+ * Creates an instance of Measurer.
15
+ * @param {string} method Method to calculate distance between strings.
16
+ * @memberof Measurer
17
+ */
18
+ constructor(method: string);
19
+ /**
20
+ * Returns custom string distance function specified.
21
+ * @return {DistanceMetric} Callback of the measure chosen.
22
+ */
23
+ getMeasure(): DistanceMetric;
24
+ /**
25
+ * Returns available string distance metrics.
26
+ *
27
+ * @readonly
28
+ * @type {string[]}
29
+ * @memberof Measurer
30
+ */
31
+ static get availableMeasures(): string[];
32
+ }
33
+ //# sourceMappingURL=string-measure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-measure.d.ts","sourceRoot":"","sources":["string-measure.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAGnD;;;;;GAKG;AACH,qBAAa,QAAQ;IACjB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,OAAc,OAAO,EAAE;QAAC,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;KAAC,CAGrD;IAEF;;;;OAIG;gBACS,MAAM,EAAE,MAAM;IAK1B;;;OAGG;IACI,UAAU,IAAI,cAAc;IAInC;;;;;;OAMG;IACH,WAAkB,iBAAiB,IAAK,MAAM,EAAE,CAO/C;CAEJ"}
@@ -0,0 +1,2 @@
1
+ export declare function tryParseJson(s: string): any;
2
+ //# sourceMappingURL=string-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-utils.d.ts","sourceRoot":"","sources":["string-utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAI,GAAG,CAO5C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=table-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-validation.d.ts","sourceRoot":"","sources":["table-validation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ export declare function getToken(url: string, key: string): Promise<any>;
2
+ export declare function getWebUrl(url: string, token: string): Promise<any>;
3
+ export declare function getDevKey(hostKey: string): {
4
+ url: string;
5
+ key: string;
6
+ };
7
+ export declare function getBrowserPage(puppeteer: any): Promise<{
8
+ browser: any;
9
+ page: any;
10
+ }>;
11
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["test-utils.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAOtD;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAIzD;AAaD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAkBrE;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAC,CAAC,CA8BvF"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Denotes a vector of floating poit values.
3
+ *
4
+ * @export
5
+ * @class Vector
6
+ * @extends {Float32Array}
7
+ */
8
+ export declare class Vector extends Float32Array {
9
+ }
10
+ /**
11
+ * Denotes a two-dimensional matrix.
12
+ *
13
+ * @export
14
+ * @class Matrix
15
+ * @extends {Array<Vector>}
16
+ */
17
+ export declare class Matrix extends Array<Vector> {
18
+ }
19
+ /**
20
+ * Denotes cartesian coordinates.
21
+ *
22
+ * @export
23
+ * @class Coordinates
24
+ * @extends {Matrix}
25
+ */
26
+ export declare class Coordinates extends Matrix {
27
+ }
28
+ /**
29
+ * Denotes an array of arbitrary-typed vectors.
30
+ *
31
+ * @export
32
+ * @class Vectors
33
+ * @extends {Array<any>}
34
+ */
35
+ export declare class Vectors extends Array<any> {
36
+ }
37
+ /**
38
+ * Denotes a dictionary containing function options.
39
+ *
40
+ * @export
41
+ * @type Options
42
+ */
43
+ export declare type Options = {
44
+ [name: string]: any;
45
+ };
46
+ /**
47
+ * Denotes custom distance metric between the two given vectors.
48
+ *
49
+ * @export
50
+ * @type DistanceMetric
51
+ * @param {any} v1 The first vector.
52
+ * @param {any} v2 The second vector.
53
+ * @return {number} Distance between these two vectors.
54
+ */
55
+ export declare type DistanceMetric = (v1: any, v2: any) => (number);
56
+ //# sourceMappingURL=type_declarations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type_declarations.d.ts","sourceRoot":"","sources":["type_declarations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,YAAY;CAAG;AAE3C;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,MAAM,CAAC;CAAG;AAE5C;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,MAAM;CAAG;AAE1C;;;;;;GAMG;AACH,qBAAa,OAAQ,SAAQ,KAAK,CAAC,GAAG,CAAC;CAAG;AAE1C;;;;;GAKG;AACH,oBAAY,OAAO,GAAG;IAAC,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,CAAC;AAE5C;;;;;;;;GAQG;AACF,oBAAY,cAAc,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC"}
package/tsconfig.json CHANGED
@@ -10,8 +10,8 @@
10
10
  // "allowJs": true, /* Allow javascript files to be compiled. */
11
11
  // "checkJs": true, /* Report errors in .js files. */
12
12
  // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
13
- // "declaration": true, /* Generates corresponding '.d.ts' file. */
14
- // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
13
+ "declaration": true, /* Generates corresponding '.d.ts' file. */
14
+ "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
15
15
  // "sourceMap": true, /* Generates corresponding '.map' file. */
16
16
  // "outFile": "./", /* Concatenate and emit output to single file. */
17
17
  // "outDir": "./", /* Redirect output structure to the directory. */