first commit

This commit is contained in:
Ale
2025-05-13 12:01:17 +02:00
commit d7881a4461
4852 changed files with 537159 additions and 0 deletions

11
node_modules/pdf-lib/ts3.4/cjs/utils/Cache.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
declare class Cache<T> {
static readonly populatedBy: <T_1>(populate: () => T_1) => Cache<T_1>;
private readonly populate;
private value;
private constructor();
getValue(): T | undefined;
access(): T;
invalidate(): void;
}
export default Cache;
//# sourceMappingURL=Cache.d.ts.map

16
node_modules/pdf-lib/ts3.4/cjs/utils/arrays.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
export declare const last: <T>(array: T[]) => T;
export declare const typedArrayFor: (value: string | Uint8Array) => Uint8Array;
export declare const mergeIntoTypedArray: (...arrays: (string | Uint8Array)[]) => Uint8Array;
export declare const mergeUint8Arrays: (arrays: Uint8Array[]) => Uint8Array;
export declare const arrayAsString: (array: Uint8Array | number[]) => string;
export declare const byAscendingId: <T extends {
id: any;
}>(a: T, b: T) => number;
export declare const sortedUniq: <T>(array: T[], indexer: (elem: T) => any) => T[];
export declare const reverseArray: (array: Uint8Array) => Uint8Array;
export declare const sum: (array: number[] | Uint8Array) => number;
export declare const range: (start: number, end: number) => number[];
export declare const pluckIndices: <T>(arr: T[], indices: number[]) => T[];
export declare const canBeConvertedToUint8Array: (input: any) => input is string | Uint8Array | ArrayBuffer;
export declare const toUint8Array: (input: string | ArrayBuffer | Uint8Array) => Uint8Array;
//# sourceMappingURL=arrays.d.ts.map

6
node_modules/pdf-lib/ts3.4/cjs/utils/async.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
/**
* Returns a Promise that resolves after at least one tick of the
* Macro Task Queue occurs.
*/
export declare const waitForTick: () => Promise<void>;
//# sourceMappingURL=async.d.ts.map

11
node_modules/pdf-lib/ts3.4/cjs/utils/base64.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
export declare const encodeToBase64: (bytes: Uint8Array) => string;
export declare const decodeFromBase64: (base64: string) => Uint8Array;
/**
* If the `dataUri` input is a data URI, then the data URI prefix must not be
* longer than 100 characters, or this function will fail to decode it.
*
* @param dataUri a base64 data URI or plain base64 string
* @returns a Uint8Array containing the decoded input
*/
export declare const decodeFromBase64DataUri: (dataUri: string) => Uint8Array;
//# sourceMappingURL=base64.d.ts.map

2
node_modules/pdf-lib/ts3.4/cjs/utils/errors.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare const error: (msg: string) => never;
//# sourceMappingURL=errors.d.ts.map

12
node_modules/pdf-lib/ts3.4/cjs/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
export * from "./arrays";
export * from "./async";
export * from "./strings";
export * from "./unicode";
export * from "./numbers";
export * from "./errors";
export * from "./base64";
export * from "./objects";
export * from "./validators";
export * from "./pdfDocEncoding";
export { default as Cache } from "./Cache";
//# sourceMappingURL=index.d.ts.map

24
node_modules/pdf-lib/ts3.4/cjs/utils/numbers.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/**
* Converts a number to its string representation in decimal. This function
* differs from simply converting a number to a string with `.toString()`
* because this function's output string will **not** contain exponential
* notation.
*
* Credit: https://stackoverflow.com/a/46545519
*/
export declare const numberToString: (num: number) => string;
export declare const sizeInBytes: (n: number) => number;
/**
* Converts a number into its constituent bytes and returns them as
* a number[].
*
* Returns most significant byte as first element in array. It may be necessary
* to call .reverse() to get the bits in the desired order.
*
* Example:
* bytesFor(0x02A41E) => [ 0b10, 0b10100100, 0b11110 ]
*
* Credit for algorithm: https://stackoverflow.com/a/1936865
*/
export declare const bytesFor: (n: number) => Uint8Array;
//# sourceMappingURL=numbers.d.ts.map

16
node_modules/pdf-lib/ts3.4/cjs/utils/objects.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import { FontNames } from '@pdf-lib/standard-fonts';
export declare const values: (obj: any) => any[];
export declare const StandardFontValues: any[];
export declare const isStandardFont: (input: any) => input is FontNames;
export declare const rectanglesAreEqual: (a: {
x: number;
y: number;
width: number;
height: number;
}, b: {
x: number;
y: number;
width: number;
height: number;
}) => boolean;
//# sourceMappingURL=objects.d.ts.map

View File

@@ -0,0 +1,8 @@
/**
* Decode a byte array into a string using PDFDocEncoding.
*
* @param bytes a byte array (decimal representation) containing a string
* encoded with PDFDocEncoding.
*/
export declare const pdfDocEncodingDecode: (bytes: Uint8Array) => string;
//# sourceMappingURL=pdfDocEncoding.d.ts.map

18
node_modules/pdf-lib/ts3.4/cjs/utils/png.d.ts generated vendored Normal file
View File

@@ -0,0 +1,18 @@
export declare enum PngType {
Greyscale = "Greyscale",
Truecolour = "Truecolour",
IndexedColour = "IndexedColour",
GreyscaleWithAlpha = "GreyscaleWithAlpha",
TruecolourWithAlpha = "TruecolourWithAlpha"
}
export declare class PNG {
static load: (pngData: Uint8Array) => PNG;
readonly rgbChannel: Uint8Array;
readonly alphaChannel?: Uint8Array;
readonly type: PngType;
readonly width: number;
readonly height: number;
readonly bitsPerComponent: number;
private constructor();
}
//# sourceMappingURL=png.d.ts.map

14
node_modules/pdf-lib/ts3.4/cjs/utils/rng.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
/**
* Generates a pseudo random number. Although it is not cryptographically secure
* and uniformly distributed, it is not a concern for the intended use-case,
* which is to generate distinct numbers.
*
* Credit: https://stackoverflow.com/a/19303725/10254049
*/
export declare class SimpleRNG {
static withSeed: (seed: number) => SimpleRNG;
private seed;
private constructor();
nextInt(): number;
}
//# sourceMappingURL=rng.d.ts.map

25
node_modules/pdf-lib/ts3.4/cjs/utils/strings.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
export declare const toCharCode: (character: string) => number;
export declare const toCodePoint: (character: string) => number | undefined;
export declare const toHexStringOfMinLength: (num: number, minLength: number) => string;
export declare const toHexString: (num: number) => string;
export declare const charFromCode: (code: number) => string;
export declare const charFromHexCode: (hex: string) => string;
export declare const padStart: (value: string, length: number, padChar: string) => string;
export declare const copyStringIntoBuffer: (str: string, buffer: Uint8Array, offset: number) => number;
export declare const addRandomSuffix: (prefix: string, suffixLength?: number) => string;
export declare const escapeRegExp: (str: string) => string;
export declare const cleanText: (text: string) => string;
export declare const escapedNewlineChars: string[];
export declare const newlineChars: string[];
export declare const isNewlineChar: (text: string) => boolean;
export declare const lineSplit: (text: string) => string[];
export declare const mergeLines: (text: string) => string;
export declare const charAtIndex: (text: string, index: number) => [string, number];
export declare const charSplit: (text: string) => string[];
export declare const breakTextIntoLines: (text: string, wordBreaks: string[], maxWidth: number, computeWidthOfText: (t: string) => number) => string[];
export declare const parseDate: (dateStr: string) => Date | undefined;
export declare const findLastMatch: (value: string, regex: RegExp) => {
match: RegExpMatchArray | undefined;
pos: number;
};
//# sourceMappingURL=strings.d.ts.map

187
node_modules/pdf-lib/ts3.4/cjs/utils/unicode.d.ts generated vendored Normal file
View File

@@ -0,0 +1,187 @@
/**
* Encodes a string to UTF-8.
*
* @param input The string to be encoded.
* @param byteOrderMark Whether or not a byte order marker (BOM) should be added
* to the start of the encoding. (default `true`)
* @returns A Uint8Array containing the UTF-8 encoding of the input string.
*
* -----------------------------------------------------------------------------
*
* JavaScript strings are composed of Unicode code points. Code points are
* integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,
* it must be encoded as a sequence of words. A word is typically 8, 16, or 32
* bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,
* and UTF-32. These encoding forms are described in the Unicode standard [1].
* This function implements the UTF-8 encoding form.
*
* -----------------------------------------------------------------------------
*
* In UTF-8, each code point is mapped to a sequence of 1, 2, 3, or 4 bytes.
* Note that the logic which defines this mapping is slightly convoluted, and
* not as straightforward as the mapping logic for UTF-16 or UTF-32. The UTF-8
* mapping logic is as follows [2]:
*
* • If a code point is in the range U+0000..U+007F, then view it as a 7-bit
* integer: 0bxxxxxxx. Map the code point to 1 byte with the first high order
* bit set to 0:
*
* b1=0b0xxxxxxx
*
* • If a code point is in the range U+0080..U+07FF, then view it as an 11-bit
* integer: 0byyyyyxxxxxx. Map the code point to 2 bytes with the first 5 bits
* of the code point stored in the first byte, and the last 6 bits stored in
* the second byte:
*
* b1=0b110yyyyy b2=0b10xxxxxx
*
* • If a code point is in the range U+0800..U+FFFF, then view it as a 16-bit
* integer, 0bzzzzyyyyyyxxxxxx. Map the code point to 3 bytes with the first
* 4 bits stored in the first byte, the next 6 bits stored in the second byte,
* and the last 6 bits in the third byte:
*
* b1=0b1110zzzz b2=0b10yyyyyy b3=0b10xxxxxx
*
* • If a code point is in the range U+10000...U+10FFFF, then view it as a
* 21-bit integer, 0bvvvzzzzzzyyyyyyxxxxxx. Map the code point to 4 bytes with
* the first 3 bits stored in the first byte, the next 6 bits stored in the
* second byte, the next 6 bits stored in the third byte, and the last 6 bits
* stored in the fourth byte:
*
* b1=0b11110xxx b2=0b10zzzzzz b3=0b10yyyyyy b4=0b10xxxxxx
*
* -----------------------------------------------------------------------------
*
* It is important to note, when iterating through the code points of a string
* in JavaScript, that if a character is encoded as a surrogate pair it will
* increase the string's length by 2 instead of 1 [4]. For example:
*
* ```
* > 'a'.length
* 1
* > '💩'.length
* 2
* > '語'.length
* 1
* > 'a💩語'.length
* 4
* ```
*
* The results of the above example are explained by the fact that the
* characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.
*
* Because of this idiosyncrasy in JavaScript's string implementation and APIs,
* we must "jump" an extra index after encoding a character as a surrogate
* pair. In practice, this means we must increment the index of our for loop by
* 2 if we encode a surrogate pair, and 1 in all other cases.
*
* -----------------------------------------------------------------------------
*
* References:
* - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf
* 3.9 Unicode Encoding Forms - UTF-8
* - [2] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding.html
* - [3] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding-Algorithm.html
* - [4] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description
*
*/
export declare const utf8Encode: (input: string, byteOrderMark?: boolean) => Uint8Array;
/**
* Encodes a string to UTF-16.
*
* @param input The string to be encoded.
* @param byteOrderMark Whether or not a byte order marker (BOM) should be added
* to the start of the encoding. (default `true`)
* @returns A Uint16Array containing the UTF-16 encoding of the input string.
*
* -----------------------------------------------------------------------------
*
* JavaScript strings are composed of Unicode code points. Code points are
* integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,
* it must be encoded as a sequence of words. A word is typically 8, 16, or 32
* bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,
* and UTF-32. These encoding forms are described in the Unicode standard [1].
* This function implements the UTF-16 encoding form.
*
* -----------------------------------------------------------------------------
*
* In UTF-16, each code point is mapped to one or two 16-bit integers. The
* UTF-16 mapping logic is as follows [2]:
*
* • If a code point is in the range U+0000..U+FFFF, then map the code point to
* a 16-bit integer with the most significant byte first.
*
* • If a code point is in the range U+10000..U+10000, then map the code point
* to two 16-bit integers. The first integer should contain the high surrogate
* and the second integer should contain the low surrogate. Both surrogates
* should be written with the most significant byte first.
*
* -----------------------------------------------------------------------------
*
* It is important to note, when iterating through the code points of a string
* in JavaScript, that if a character is encoded as a surrogate pair it will
* increase the string's length by 2 instead of 1 [4]. For example:
*
* ```
* > 'a'.length
* 1
* > '💩'.length
* 2
* > '語'.length
* 1
* > 'a💩語'.length
* 4
* ```
*
* The results of the above example are explained by the fact that the
* characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.
*
* Because of this idiosyncrasy in JavaScript's string implementation and APIs,
* we must "jump" an extra index after encoding a character as a surrogate
* pair. In practice, this means we must increment the index of our for loop by
* 2 if we encode a surrogate pair, and 1 in all other cases.
*
* -----------------------------------------------------------------------------
*
* References:
* - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf
* 3.9 Unicode Encoding Forms - UTF-8
* - [2] http://www.herongyang.com/Unicode/UTF-16-UTF-16-Encoding.html
* - [3] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description
*
*/
export declare const utf16Encode: (input: string, byteOrderMark?: boolean) => Uint16Array;
/**
* Returns `true` if the `codePoint` is within the
* Basic Multilingual Plane (BMP). Code points inside the BMP are not encoded
* with surrogate pairs.
* @param codePoint The code point to be evaluated.
*
* Reference: https://en.wikipedia.org/wiki/UTF-16#Description
*/
export declare const isWithinBMP: (codePoint: number) => boolean;
/**
* Returns `true` if the given `codePoint` is valid and must be represented
* with a surrogate pair when encoded.
* @param codePoint The code point to be evaluated.
*
* Reference: https://en.wikipedia.org/wiki/UTF-16#Description
*/
export declare const hasSurrogates: (codePoint: number) => boolean;
export declare const highSurrogate: (codePoint: number) => number;
export declare const lowSurrogate: (codePoint: number) => number;
/**
* Decodes a Uint8Array of data to a string using UTF-16.
*
* Note that this function attempts to recover from erronous input by
* inserting the replacement character (<28>) to mark invalid code points
* and surrogate pairs.
*
* @param input A Uint8Array containing UTF-16 encoded data
* @param byteOrderMark Whether or not a byte order marker (BOM) should be read
* at the start of the encoding. (default `true`)
* @returns The decoded string.
*/
export declare const utf16Decode: (input: Uint8Array, byteOrderMark?: boolean) => string;
export declare const hasUtf16BOM: (bytes: Uint8Array) => boolean;
//# sourceMappingURL=unicode.d.ts.map

27
node_modules/pdf-lib/ts3.4/cjs/utils/validators.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
export declare const backtick: (val: any) => string;
export declare const singleQuote: (val: any) => string;
declare type Primitive = string | number | boolean | undefined | null;
export declare const createValueErrorMsg: (value: any, valueName: string, values: Primitive[]) => string;
export declare const assertIsOneOf: (value: any, valueName: string, allowedValues: Primitive[] | {
[key: string]: Primitive;
}) => void;
export declare const assertIsOneOfOrUndefined: (value: any, valueName: string, allowedValues: Primitive[] | {
[key: string]: Primitive;
}) => void;
export declare const assertIsSubset: (values: any[], valueName: string, allowedValues: Primitive[] | {
[key: string]: Primitive;
}) => void;
export declare const getType: (val: any) => any;
export declare type TypeDescriptor = 'null' | 'undefined' | 'string' | 'number' | 'boolean' | 'symbol' | 'bigint' | DateConstructor | ArrayConstructor | Uint8ArrayConstructor | ArrayBufferConstructor | FunctionConstructor | [Function, string];
export declare const isType: (value: any, type: TypeDescriptor) => boolean;
export declare const createTypeErrorMsg: (value: any, valueName: string, types: TypeDescriptor[]) => string;
export declare const assertIs: (value: any, valueName: string, types: TypeDescriptor[]) => void;
export declare const assertOrUndefined: (value: any, valueName: string, types: TypeDescriptor[]) => void;
export declare const assertEachIs: (values: any[], valueName: string, types: TypeDescriptor[]) => void;
export declare const assertRange: (value: any, valueName: string, min: number, max: number) => void;
export declare const assertRangeOrUndefined: (value: any, valueName: string, min: number, max: number) => void;
export declare const assertMultiple: (value: any, valueName: string, multiplier: number) => void;
export declare const assertInteger: (value: any, valueName: string) => void;
export declare const assertPositive: (value: number, valueName: string) => void;
export {};
//# sourceMappingURL=validators.d.ts.map