@syncfusion/ej2-pdf
Version:
Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.
89 lines (88 loc) • 4.62 kB
TypeScript
/**
* Creates a function to validate dateTime components.
*
* @private
* @param {string} unitName - The name of the dateTime unit (e.g., 'day', 'month').
* @param {number} min - The minimum allowable value for this unit.
* @param {number} max - The maximum allowable value for this unit.
* @returns {(function(string, number): void)} A function that validates a dateTime component.
* @throws {Error} Throws an error if the value is not an integer or is out of bounds.
*/
export declare function _validateDateTimeComponent(unitName: string, min: number, max: number): (dataType: string, value: number) => void;
/**
* Determines if a given character code represents a general character in the ASCII range.
*
* @private
* @param {number} characterCode The character code to evaluate.
* @returns {boolean} boolean - Returns true if the character code is in the ASCII range (0 - 127);
* false otherwise.
*/
export declare function _isGeneralCharacter(characterCode: number): boolean;
/**
* Evaluates whether the provided character code corresponds to a graphic character
* within the standard ASCII range.
*
* @private
* @param {number} characterCode The character code to evaluate.
* @returns {boolean} - Returns true if the character code represents a graphic character;
* false if it does not.
*/
export declare function _isGraphicCharacter(characterCode: number): boolean;
/**
* Checks if the provided character code corresponds to a printable character.
*
* @private
* @param {number} characterCode The character code to evaluate.
* @returns {boolean} - Returns true if the character code is considered printable
* according to the defined ranges and conditions; false otherwise.
*/
export declare function _isPrintableCharacter(characterCode: number): boolean;
/**
* Validates the given date components to ensure they form a legitimate date.
*
* @private
* @param {string} dataType string - A descriptive label for the type of data being validated.
* @param {number} year - The year part of the date, which must be a safe integer.
* @param {number} month - The month part of the date, ranging from 0 (January) to 11 (December).
* @param {number} date - The day part of the date, required to be a valid day in the given month.
* @returns {void} This function does not return a value.
* @throws Will throw an error if any components do not together make a valid date.
*/
export declare function _validateDate(dataType: string, year: number, month: number, date: number): void;
/**
* Validates the given time components to ensure they form a legitimate time.
*
* @private
* @param {string} dataType - A descriptive label for the type of data being validated.
* @param {number} hours - The hour component of the time, which must be a safe integer from 0 to 23.
* @param {number} minutes - The minute component of the time, which must be a safe integer from 0 to 59.
* @param {number} seconds - The second component of the time, which must be a safe integer from 0 to 59.
* @returns {void} This function does not return a value.
* @throws Will throw an error if the time components do not form a valid time representation.
*/
export declare function _validateTime(dataType: string, hours: number, minutes: number, seconds: number): void;
/**
* Validates a full date and time specification to ensure it is legitimate.
*
* @private
* @param {string} dataType string - A descriptive label for the type of data being validated.
* @param {number} year number - The year component of the date.
* @param {number} month number - The month component of the date, 0-based (0 for January, 11 for December).
* @param {number} date number - The day of the month.
* @param {number} hours number - The hour component of the time.
* @param {number} minutes number - The minute component of the time.
* @param {number} seconds number - The second component of the time.
* @returns {void} This function does not return a value.
* @throws Will throw an error if any of the date or time components are invalid.
*/
export declare function _validateDateTime(dataType: string, year: number, month: number, date: number, hours: number, minutes: number, seconds: number): void;
/**
* Determines if the given character code corresponds to a numeric character
* or a space character in the ASCII range.
*
* @private
* @param {number} characterCode number - The character code to evaluate.
* @returns {boolean} - Returns true if the character code is a numeric character (0-9)
* or a space; false otherwise.
*/
export declare function isNumericString(characterCode: number): boolean;