@qr-platform/qr-code.js 0.8.21 → 0.8.22

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.
Files changed (42) hide show
  1. package/docs/documentation.md +5 -4
  2. package/lib/chunks/zbar-scan-validator-B3GQk_mt.js +1 -0
  3. package/lib/chunks/zxing-scan-validator-CYcyNnMt.js +1 -0
  4. package/lib/index.d.ts +1 -1
  5. package/lib/index.js +1 -0
  6. package/lib/lib/zxing-js/src/browser/BrowserCodeReader.d.ts +3 -263
  7. package/lib/lib/zxing-js/src/core/NodeLuminanceSource.d.ts +10 -13
  8. package/lib/node.js +1 -0
  9. package/lib/utils/scan-validator-zxing-node.d.ts +18 -0
  10. package/package.json +8 -8
  11. package/lib/lib/zxing-js/src/browser/BrowserQRCodeSvgWriter.d.ts +0 -46
  12. package/lib/lib/zxing-js/src/browser/BrowserSvgCodeWriter.d.ts +0 -49
  13. package/lib/lib/zxing-js/src/browser/DecodeContinuouslyCallback.d.ts +0 -6
  14. package/lib/lib/zxing-js/src/browser/VideoInputDevice.d.ts +0 -22
  15. package/lib/lib/zxing-js/src/core/Dimension.d.ts +0 -13
  16. package/lib/lib/zxing-js/src/core/EncodeHintType.d.ts +0 -99
  17. package/lib/lib/zxing-js/src/core/PlanarYUVLuminanceSource.d.ts +0 -35
  18. package/lib/lib/zxing-js/src/core/RGBLuminanceSource.d.ts +0 -21
  19. package/lib/lib/zxing-js/src/core/Writer.d.ts +0 -30
  20. package/lib/lib/zxing-js/src/core/WriterException.d.ts +0 -7
  21. package/lib/lib/zxing-js/src/core/common/ECIEncoderSet.d.ts +0 -37
  22. package/lib/lib/zxing-js/src/core/common/ECIInput.d.ts +0 -79
  23. package/lib/lib/zxing-js/src/core/common/MinimalECIInput.d.ts +0 -123
  24. package/lib/lib/zxing-js/src/core/common/detector/CornerDetector.d.ts +0 -35
  25. package/lib/lib/zxing-js/src/core/common/detector/WhiteRectangleDetector.d.ts +0 -71
  26. package/lib/lib/zxing-js/src/core/common/reedsolomon/AbstractGenericGFPoly.d.ts +0 -36
  27. package/lib/lib/zxing-js/src/core/common/reedsolomon/ReedSolomonEncoder.d.ts +0 -41
  28. package/lib/lib/zxing-js/src/core/qrcode/QRCodeWriter.d.ts +0 -13
  29. package/lib/lib/zxing-js/src/core/qrcode/encoder/BlockPair.d.ts +0 -7
  30. package/lib/lib/zxing-js/src/core/qrcode/encoder/ByteMatrix.d.ts +0 -24
  31. package/lib/lib/zxing-js/src/core/qrcode/encoder/Encoder.d.ts +0 -85
  32. package/lib/lib/zxing-js/src/core/qrcode/encoder/MaskUtil.d.ts +0 -47
  33. package/lib/lib/zxing-js/src/core/qrcode/encoder/MatrixUtil.d.ts +0 -37
  34. package/lib/lib/zxing-js/src/core/qrcode/encoder/QRCode.d.ts +0 -29
  35. package/lib/lib/zxing-js/src/core/util/ByteArrayOutputStream.d.ts +0 -174
  36. package/lib/lib/zxing-js/src/core/util/Collections.d.ts +0 -11
  37. package/lib/lib/zxing-js/src/core/util/Formatter.d.ts +0 -28
  38. package/lib/lib/zxing-js/src/core/util/Long.d.ts +0 -12
  39. package/lib/lib/zxing-js/src/core/util/OutputStream.d.ts +0 -106
  40. package/lib/lib/zxing-js/src/core/util/StandardCharsets.d.ts +0 -7
  41. package/lib/qr-code-js-node.js +0 -1
  42. package/lib/qr-code-js.js +0 -1
@@ -1,71 +0,0 @@
1
- import ResultPoint from '../../ResultPoint';
2
- import BitMatrix from '../BitMatrix';
3
- /**
4
- * <p>
5
- * Detects a candidate barcode-like rectangular region within an image. It
6
- * starts around the center of the image, increases the size of the candidate
7
- * region until it finds a white rectangular region. By keeping track of the
8
- * last black points it encountered, it determines the corners of the barcode.
9
- * </p>
10
- *
11
- * @author David Olivier
12
- */
13
- export default class WhiteRectangleDetector {
14
- private image;
15
- private static INIT_SIZE;
16
- private static CORR;
17
- private height;
18
- private width;
19
- private leftInit;
20
- private rightInit;
21
- private downInit;
22
- private upInit;
23
- /**
24
- * @param image barcode image to find a rectangle in
25
- * @param initSize initial size of search area around center
26
- * @param x x position of search center
27
- * @param y y position of search center
28
- * @throws NotFoundException if image is too small to accommodate {@code initSize}
29
- */
30
- constructor(image: BitMatrix, initSize?: number, x?: number, y?: number);
31
- /**
32
- * <p>
33
- * Detects a candidate barcode-like rectangular region within an image. It
34
- * starts around the center of the image, increases the size of the candidate
35
- * region until it finds a white rectangular region.
36
- * </p>
37
- *
38
- * @return {@link ResultPoint}[] describing the corners of the rectangular
39
- * region. The first and last points are opposed on the diagonal, as
40
- * are the second and third. The first point will be the topmost
41
- * point and the last, the bottommost. The second point will be
42
- * leftmost and the third, the rightmost
43
- * @throws NotFoundException if no Data Matrix Code can be found
44
- */
45
- detect(): Array<ResultPoint>;
46
- private getBlackPointOnSegment;
47
- /**
48
- * recenters the points of a constant distance towards the center
49
- *
50
- * @param y bottom most point
51
- * @param z left most point
52
- * @param x right most point
53
- * @param t top most point
54
- * @return {@link ResultPoint}[] describing the corners of the rectangular
55
- * region. The first and last points are opposed on the diagonal, as
56
- * are the second and third. The first point will be the topmost
57
- * point and the last, the bottommost. The second point will be
58
- * leftmost and the third, the rightmost
59
- */
60
- private centerEdges;
61
- /**
62
- * Determines whether a segment contains a black point
63
- *
64
- * @param a min value of the scanned coordinate
65
- * @param b max value of the scanned coordinate
66
- * @param fixed value of fixed coordinate
67
- * @param horizontal set to true if scan must be horizontal, false if vertical
68
- * @return true if a black point has been found, else false.
69
- */
70
- private containsBlackPoint;
71
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * <p>Represents a polynomial whose coefficients are elements of a GF.
3
- * Instances of this class are immutable.</p>
4
- *
5
- * <p>Much credit is due to William Rucklidge since portions of this code are an indirect
6
- * port of his C++ Reed-Solomon implementation.</p>
7
- *
8
- * @author Sean Owen
9
- */
10
- export default abstract class AbstractGenericGFPoly {
11
- protected field: any;
12
- protected coefficients: any;
13
- getCoefficients(): Int32Array;
14
- /**
15
- * @return degree of this polynomial
16
- */
17
- getDegree(): number;
18
- /**
19
- * @return true iff this polynomial is the monomial "0"
20
- */
21
- isZero(): boolean;
22
- /**
23
- * @return coefficient of x^degree term in this polynomial
24
- */
25
- getCoefficient(degree: number): number;
26
- /**
27
- * @return evaluation of this polynomial at a given point
28
- */
29
- evaluateAt(a: number): number;
30
- abstract addOrSubtract(other: AbstractGenericGFPoly): AbstractGenericGFPoly;
31
- abstract multiply(other: AbstractGenericGFPoly): AbstractGenericGFPoly;
32
- abstract multiplyScalar(scalar: number): AbstractGenericGFPoly;
33
- abstract multiplyByMonomial(degree: number, coefficient: number): AbstractGenericGFPoly;
34
- abstract divide(other: AbstractGenericGFPoly): AbstractGenericGFPoly[];
35
- toString(): string;
36
- }
@@ -1,41 +0,0 @@
1
- import GenericGF from './GenericGF';
2
- /**
3
- * <p>Implements Reed-Solomon encoding, as the name implies.</p>
4
- *
5
- * @author Sean Owen
6
- * @author William Rucklidge
7
- */
8
- export default class ReedSolomonEncoder {
9
- private field;
10
- private cachedGenerators;
11
- /**
12
- * A reed solomon error-correcting encoding constructor is created by
13
- * passing as Galois Field with of size equal to the number of code
14
- * words (symbols) in the alphabet (the number of values in each
15
- * element of arrays that are encoded/decoded).
16
- * @param field A galois field with a number of elements equal to the size
17
- * of the alphabet of symbols to encode.
18
- */
19
- constructor(field: GenericGF);
20
- private buildGenerator;
21
- /**
22
- * <p>Encode a sequence of code words (symbols) using Reed-Solomon to allow decoders
23
- * to detect and correct errors that may have been introduced when the resulting
24
- * data is stored or transmitted.</p>
25
- *
26
- * @param toEncode array used for both and output. Caller initializes the array with
27
- * the code words (symbols) to be encoded followed by empty elements allocated to make
28
- * space for error-correction code words in the encoded output. The array contains
29
- * the encdoded output when encode returns. Code words are encoded as numbers from
30
- * 0 to n-1, where n is the number of possible code words (symbols), as determined
31
- * by the size of the Galois Field passed in the constructor of this object.
32
- * @param ecBytes the number of elements reserved in the array (first parameter)
33
- * to store error-correction code words. Thus, the number of code words (symbols)
34
- * to encode in the first parameter is thus toEncode.length - ecBytes.
35
- * Note, the use of "bytes" in the name of this parameter is misleading, as there may
36
- * be more or fewer than 256 symbols being encoded, as determined by the number of
37
- * elements in the Galois Field passed as a constructor to this object.
38
- * @throws IllegalArgumentException thrown in response to validation errros.
39
- */
40
- encode(toEncode: Int32Array, ecBytes: number): void;
41
- }
@@ -1,13 +0,0 @@
1
- import BarcodeFormat from '../BarcodeFormat';
2
- import BitMatrix from '../common/BitMatrix';
3
- import EncodeHintType from '../EncodeHintType';
4
- /**
5
- * This object renders a QR Code as a BitMatrix 2D array of greyscale values.
6
- *
7
- * @author dswitkin@google.com (Daniel Switkin)
8
- */
9
- export default class QRCodeWriter {
10
- private static QUIET_ZONE_SIZE;
11
- encode(contents: string, format: BarcodeFormat, width: number, height: number, hints: Map<EncodeHintType, any>): BitMatrix;
12
- private static renderResult;
13
- }
@@ -1,7 +0,0 @@
1
- export default class BlockPair {
2
- private dataBytes;
3
- private errorCorrectionBytes;
4
- constructor(dataBytes: Uint8Array, errorCorrectionBytes: Uint8Array);
5
- getDataBytes(): Uint8Array;
6
- getErrorCorrectionBytes(): Uint8Array;
7
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * JAVAPORT: The original code was a 2D array of ints, but since it only ever gets assigned
3
- * -1, 0, and 1, I'm going to use less memory and go with bytes.
4
- *
5
- * @author dswitkin@google.com (Daniel Switkin)
6
- */
7
- export default class ByteMatrix {
8
- private width;
9
- private height;
10
- private bytes;
11
- constructor(width: number, height: number);
12
- getHeight(): number;
13
- getWidth(): number;
14
- get(x: number, y: number): number;
15
- /**
16
- * @return an internal representation as bytes, in row-major order. array[y][x] represents point (x,y)
17
- */
18
- getArray(): Array<Uint8Array>;
19
- setNumber(x: number, y: number, value: number): void;
20
- setBoolean(x: number, y: number, value: boolean): void;
21
- clear(value: number): void;
22
- equals(o: any): boolean;
23
- toString(): string;
24
- }
@@ -1,85 +0,0 @@
1
- import ErrorCorrectionLevel from '../decoder/ErrorCorrectionLevel';
2
- import Mode from '../decoder/Mode';
3
- import Version from '../decoder/Version';
4
- import QRCode from './QRCode';
5
- /**
6
- * @author satorux@google.com (Satoru Takabayashi) - creator
7
- * @author dswitkin@google.com (Daniel Switkin) - ported from C++
8
- */
9
- export default class Encoder {
10
- private static ALPHANUMERIC_TABLE;
11
- static DEFAULT_BYTE_MODE_ENCODING: string;
12
- private constructor();
13
- private static calculateMaskPenalty;
14
- /**
15
- * @param content text to encode
16
- * @param ecLevel error correction level to use
17
- * @return {@link QRCode} representing the encoded QR code
18
- * @throws WriterException if encoding can't succeed, because of for example invalid content
19
- * or configuration
20
- */
21
- static encode(content: string, ecLevel: ErrorCorrectionLevel, hints?: Map<EncodeHintType, any>): QRCode;
22
- /**
23
- * Decides the smallest version of QR code that will contain all of the provided data.
24
- *
25
- * @throws WriterException if the data cannot fit in any version
26
- */
27
- private static recommendVersion;
28
- private static calculateBitsNeeded;
29
- /**
30
- * @return the code point of the table used in alphanumeric mode or
31
- * -1 if there is no corresponding code in the table.
32
- */
33
- static getAlphanumericCode(code: number): number;
34
- /**
35
- * Choose the best mode by examining the content. Note that 'encoding' is used as a hint;
36
- * if it is Shift_JIS, and the input is only double-byte Kanji, then we return {@link Mode#KANJI}.
37
- */
38
- static chooseMode(content: string, encoding?: string): Mode;
39
- private static isOnlyDoubleByteKanji;
40
- private static chooseMaskPattern;
41
- private static chooseVersion;
42
- /**
43
- * @return true if the number of input bits will fit in a code with the specified version and
44
- * error correction level.
45
- */
46
- private static willFit;
47
- /**
48
- * Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24).
49
- */
50
- static terminateBits(numDataBytes: number, bits: BitArray): void;
51
- /**
52
- * Get number of data bytes and number of error correction bytes for block id "blockID". Store
53
- * the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of
54
- * JISX0510:2004 (p.30)
55
- */
56
- static getNumDataBytesAndNumECBytesForBlockID(numTotalBytes: number, numDataBytes: number, numRSBlocks: number, blockID: number, numDataBytesInBlock: Int32Array, numECBytesInBlock: Int32Array): void;
57
- /**
58
- * Interleave "bits" with corresponding error correction bytes. On success, store the result in
59
- * "result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details.
60
- */
61
- static interleaveWithECBytes(bits: BitArray, numTotalBytes: number, numDataBytes: number, numRSBlocks: number): BitArray;
62
- static generateECBytes(dataBytes: Uint8Array, numEcBytesInBlock: number): Uint8Array;
63
- /**
64
- * Append mode info. On success, store the result in "bits".
65
- */
66
- static appendModeInfo(mode: Mode, bits: BitArray): void;
67
- /**
68
- * Append length info. On success, store the result in "bits".
69
- */
70
- static appendLengthInfo(numLetters: number, version: Version, mode: Mode, bits: BitArray): void;
71
- /**
72
- * Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits".
73
- */
74
- static appendBytes(content: string, mode: Mode, bits: BitArray, encoding: string): void;
75
- private static getDigit;
76
- private static isDigit;
77
- static appendNumericBytes(content: string, bits: BitArray): void;
78
- static appendAlphanumericBytes(content: string, bits: BitArray): void;
79
- static append8BitBytes(content: string, bits: BitArray, encoding: string): void;
80
- /**
81
- * @throws WriterException
82
- */
83
- static appendKanjiBytes(content: string, bits: BitArray): void;
84
- private static appendECI;
85
- }
@@ -1,47 +0,0 @@
1
- import ByteMatrix from './ByteMatrix';
2
- /**
3
- * @author Satoru Takabayashi
4
- * @author Daniel Switkin
5
- * @author Sean Owen
6
- */
7
- export default class MaskUtil {
8
- private static N1;
9
- private static N2;
10
- private static N3;
11
- private static N4;
12
- private constructor();
13
- /**
14
- * Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and
15
- * give penalty to them. Example: 00000 or 11111.
16
- */
17
- static applyMaskPenaltyRule1(matrix: ByteMatrix): number;
18
- /**
19
- * Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give
20
- * penalty to them. This is actually equivalent to the spec's rule, which is to find MxN blocks and give a
21
- * penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block.
22
- */
23
- static applyMaskPenaltyRule2(matrix: ByteMatrix): number;
24
- /**
25
- * Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4
26
- * starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we
27
- * find patterns like 000010111010000, we give penalty once.
28
- */
29
- static applyMaskPenaltyRule3(matrix: ByteMatrix): number;
30
- private static isWhiteHorizontal;
31
- private static isWhiteVertical;
32
- /**
33
- * Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
34
- * penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.
35
- */
36
- static applyMaskPenaltyRule4(matrix: ByteMatrix): number;
37
- /**
38
- * Return the mask bit for "getMaskPattern" at "x" and "y". See 8.8 of JISX0510:2004 for mask
39
- * pattern conditions.
40
- */
41
- static getDataMaskBit(maskPattern: number, x: number, y: number): boolean;
42
- /**
43
- * Helper function for applyMaskPenaltyRule1. We need this for doing this calculation in both
44
- * vertical and horizontal orders respectively.
45
- */
46
- private static applyMaskPenaltyRule1Internal;
47
- }
@@ -1,37 +0,0 @@
1
- import BitArray from '../../common/BitArray';
2
- import ErrorCorrectionLevel from '../decoder/ErrorCorrectionLevel';
3
- import Version from '../decoder/Version';
4
- import ByteMatrix from './ByteMatrix';
5
- /**
6
- * @author satorux@google.com (Satoru Takabayashi) - creator
7
- * @author dswitkin@google.com (Daniel Switkin) - ported from C++
8
- */
9
- export default class MatrixUtil {
10
- private constructor();
11
- private static POSITION_DETECTION_PATTERN;
12
- private static POSITION_ADJUSTMENT_PATTERN;
13
- private static POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE;
14
- private static TYPE_INFO_COORDINATES;
15
- private static VERSION_INFO_POLY;
16
- private static TYPE_INFO_POLY;
17
- private static TYPE_INFO_MASK_PATTERN;
18
- static clearMatrix(matrix: ByteMatrix): void;
19
- static buildMatrix(dataBits: BitArray, ecLevel: ErrorCorrectionLevel, version: Version, maskPattern: number, matrix: ByteMatrix): void;
20
- static embedBasicPatterns(version: Version, matrix: ByteMatrix): void;
21
- static embedTypeInfo(ecLevel: ErrorCorrectionLevel, maskPattern: number, matrix: ByteMatrix): void;
22
- static maybeEmbedVersionInfo(version: Version, matrix: ByteMatrix): void;
23
- static embedDataBits(dataBits: BitArray, maskPattern: number, matrix: ByteMatrix): void;
24
- static findMSBSet(value: number): number;
25
- static calculateBCHCode(value: number, poly: number): number;
26
- static makeTypeInfoBits(ecLevel: ErrorCorrectionLevel, maskPattern: number, bits: BitArray): void;
27
- static makeVersionInfoBits(version: Version, bits: BitArray): void;
28
- private static isEmpty;
29
- private static embedTimingPatterns;
30
- private static embedDarkDotAtLeftBottomCorner;
31
- private static embedHorizontalSeparationPattern;
32
- private static embedVerticalSeparationPattern;
33
- private static embedPositionAdjustmentPattern;
34
- private static embedPositionDetectionPattern;
35
- private static embedPositionDetectionPatternsAndSeparators;
36
- private static maybeEmbedPositionAdjustmentPatterns;
37
- }
@@ -1,29 +0,0 @@
1
- import ErrorCorrectionLevel from '../decoder/ErrorCorrectionLevel';
2
- import Mode from '../decoder/Mode';
3
- import Version from '../decoder/Version';
4
- import ByteMatrix from './ByteMatrix';
5
- /**
6
- * @author satorux@google.com (Satoru Takabayashi) - creator
7
- * @author dswitkin@google.com (Daniel Switkin) - ported from C++
8
- */
9
- export default class QRCode {
10
- static NUM_MASK_PATTERNS: number;
11
- private mode;
12
- private ecLevel;
13
- private version;
14
- private maskPattern;
15
- private matrix;
16
- constructor();
17
- getMode(): Mode;
18
- getECLevel(): ErrorCorrectionLevel;
19
- getVersion(): Version;
20
- getMaskPattern(): number;
21
- getMatrix(): ByteMatrix;
22
- toString(): string;
23
- setMode(value: Mode): void;
24
- setECLevel(value: ErrorCorrectionLevel): void;
25
- setVersion(version: Version): void;
26
- setMaskPattern(value: number): void;
27
- setMatrix(value: ByteMatrix): void;
28
- static isValidMaskPattern(maskPattern: number): boolean;
29
- }
@@ -1,174 +0,0 @@
1
- import { int } from '../../customTypings';
2
- import OutputStream from './OutputStream';
3
- /**
4
- * This class implements an output stream in which the data is
5
- * written into a byte array. The buffer automatically grows as data
6
- * is written to it.
7
- * The data can be retrieved using <code>toByteArray()</code> and
8
- * <code>toString()</code>.
9
- * <p>
10
- * Closing a <tt>ByteArrayOutputStream</tt> has no effect. The methods in
11
- * this class can be called after the stream has been closed without
12
- * generating an <tt>IOException</tt>.
13
- *
14
- * @author Arthur van Hoff
15
- * @since JDK1.0
16
- */
17
- export default class ByteArrayOutputStream extends OutputStream {
18
- /**
19
- * The buffer where data is stored.
20
- */
21
- protected buf: Uint8Array;
22
- /**
23
- * The number of valid bytes in the buffer.
24
- */
25
- protected count: int;
26
- /**
27
- * Creates a new byte array output stream. The buffer capacity is
28
- * initially 32 bytes, though its size increases if necessary.
29
- */
30
- /**
31
- * Creates a new byte array output stream, with a buffer capacity of
32
- * the specified size, in bytes.
33
- *
34
- * @param size the initial size.
35
- * @exception IllegalArgumentException if size is negative.
36
- */
37
- constructor(size?: int);
38
- /**
39
- * Increases the capacity if necessary to ensure that it can hold
40
- * at least the number of elements specified by the minimum
41
- * capacity argument.
42
- *
43
- * @param minCapacity the desired minimum capacity
44
- * @throws OutOfMemoryError if {@code minCapacity < 0}. This is
45
- * interpreted as a request for the unsatisfiably large capacity
46
- * {@code (long) Integer.MAX_VALUE + (minCapacity - Integer.MAX_VALUE)}.
47
- */
48
- private ensureCapacity;
49
- /**
50
- * Increases the capacity to ensure that it can hold at least the
51
- * number of elements specified by the minimum capacity argument.
52
- *
53
- * @param minCapacity the desired minimum capacity
54
- */
55
- private grow;
56
- /**
57
- * Writes the specified byte to this byte array output stream.
58
- *
59
- * @param b the byte to be written.
60
- */
61
- write(b: int): void;
62
- /**
63
- * Writes <code>len</code> bytes from the specified byte array
64
- * starting at offset <code>off</code> to this byte array output stream.
65
- *
66
- * @param b the data.
67
- * @param off the start offset in the data.
68
- * @param len the number of bytes to write.
69
- */
70
- writeBytesOffset(b: Uint8Array, off: int, len: int): void;
71
- /**
72
- * Writes the complete contents of this byte array output stream to
73
- * the specified output stream argument, as if by calling the output
74
- * stream's write method using <code>out.write(buf, 0, count)</code>.
75
- *
76
- * @param out the output stream to which to write the data.
77
- * @exception IOException if an I/O error occurs.
78
- */
79
- writeTo(out: OutputStream): void;
80
- /**
81
- * Resets the <code>count</code> field of this byte array output
82
- * stream to zero, so that all currently accumulated output in the
83
- * output stream is discarded. The output stream can be used again,
84
- * reusing the already allocated buffer space.
85
- *
86
- * @see java.io.ByteArrayInputStream#count
87
- */
88
- reset(): void;
89
- /**
90
- * Creates a newly allocated byte array. Its size is the current
91
- * size of this output stream and the valid contents of the buffer
92
- * have been copied into it.
93
- *
94
- * @return the current contents of this output stream, as a byte array.
95
- * @see java.io.ByteArrayOutputStream#size()
96
- */
97
- toByteArray(): Uint8Array;
98
- /**
99
- * Returns the current size of the buffer.
100
- *
101
- * @return the value of the <code>count</code> field, which is the number
102
- * of valid bytes in this output stream.
103
- * @see java.io.ByteArrayOutputStream#count
104
- */
105
- size(): int;
106
- toString(param?: number | string): string;
107
- /**
108
- * Converts the buffer's contents into a string decoding bytes using the
109
- * platform's default character set. The length of the new <tt>String</tt>
110
- * is a function of the character set, and hence may not be equal to the
111
- * size of the buffer.
112
- *
113
- * <p> This method always replaces malformed-input and unmappable-character
114
- * sequences with the default replacement string for the platform's
115
- * default character set. The {@linkplain java.nio.charset.CharsetDecoder}
116
- * class should be used when more control over the decoding process is
117
- * required.
118
- *
119
- * @return String decoded from the buffer's contents.
120
- * @since JDK1.1
121
- */
122
- toString_void(): string;
123
- /**
124
- * Converts the buffer's contents into a string by decoding the bytes using
125
- * the specified {@link java.nio.charset.Charset charsetName}. The length of
126
- * the new <tt>String</tt> is a function of the charset, and hence may not be
127
- * equal to the length of the byte array.
128
- *
129
- * <p> This method always replaces malformed-input and unmappable-character
130
- * sequences with this charset's default replacement string. The {@link
131
- * java.nio.charset.CharsetDecoder} class should be used when more control
132
- * over the decoding process is required.
133
- *
134
- * @param charsetName the name of a supported
135
- * {@linkplain java.nio.charset.Charset </code>charset<code>}
136
- * @return String decoded from the buffer's contents.
137
- * @exception UnsupportedEncodingException
138
- * If the named charset is not supported
139
- * @since JDK1.1
140
- */
141
- toString_string(charsetName: string): string;
142
- /**
143
- * Creates a newly allocated string. Its size is the current size of
144
- * the output stream and the valid contents of the buffer have been
145
- * copied into it. Each character <i>c</i> in the resulting string is
146
- * constructed from the corresponding element <i>b</i> in the byte
147
- * array such that:
148
- * <blockquote><pre>
149
- * c == (char)(((hibyte &amp; 0xff) &lt;&lt; 8) | (b &amp; 0xff))
150
- * </pre></blockquote>
151
- *
152
- * @deprecated This method does not properly convert bytes into characters.
153
- * As of JDK&nbsp;1.1, the preferred way to do this is via the
154
- * <code>toString(String enc)</code> method, which takes an encoding-name
155
- * argument, or the <code>toString()</code> method, which uses the
156
- * platform's default character encoding.
157
- *
158
- * @param hibyte the high byte of each resulting Unicode character.
159
- * @return the current contents of the output stream, as a string.
160
- * @see java.io.ByteArrayOutputStream#size()
161
- * @see java.io.ByteArrayOutputStream#toString(String)
162
- * @see java.io.ByteArrayOutputStream#toString()
163
- */
164
- toString_number(hibyte: int): string;
165
- /**
166
- * Closing a <tt>ByteArrayOutputStream</tt> has no effect. The methods in
167
- * this class can be called after the stream has been closed without
168
- * generating an <tt>IOException</tt>.
169
- * <p>
170
- *
171
- * @throws IOException
172
- */
173
- close(): void;
174
- }
@@ -1,11 +0,0 @@
1
- import { Collection, int } from '../../customTypings';
2
- export default class Collections {
3
- /**
4
- * The singletonList(T) method is used to return an immutable list containing only the specified object.
5
- */
6
- static singletonList<T = any>(item: T): Collection<T>;
7
- /**
8
- * The min(Collection<? extends T>, Comparator<? super T>) method is used to return the minimum element of the given collection, according to the order induced by the specified comparator.
9
- */
10
- static min<T = any>(collection: Collection<T>, comparator: (a: T, b: T) => int): T;
11
- }
@@ -1,28 +0,0 @@
1
- /**
2
- * Java Formatter class polyfill that works in the JS way.
3
- */
4
- export default class Formatter {
5
- /**
6
- * The internal formatted value.
7
- */
8
- buffer: string;
9
- constructor();
10
- /**
11
- *
12
- * @see https://stackoverflow.com/a/13439711/4367683
13
- *
14
- * @param str
15
- * @param arr
16
- */
17
- private static form;
18
- /**
19
- *
20
- * @param append The new string to append.
21
- * @param args Argumets values to be formated.
22
- */
23
- format(append: string, ...args: any): void;
24
- /**
25
- * Returns the Formatter string value.
26
- */
27
- toString(): string;
28
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Ponyfill for Java's Long class.
3
- */
4
- export default class Long {
5
- /**
6
- * Parses a string to a number, since JS has no really Int64.
7
- *
8
- * @param num Numeric string.
9
- * @param radix Destination radix.
10
- */
11
- static parseLong(num: string, radix?: number | undefined): number;
12
- }