gis-tools-ts
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
108 lines • 3.13 kB
TypeScript
/**
* Fold a number between 0 and 255
* @param n - the number to fold
* @returns - the folded number
*/
export declare function u8Fold(n: number): number;
/**
* Clamp a number between 0 and 255
* @param n - the number to clamp
* @returns - the clamped number
*/
export declare function u8Clamp(n: number): number;
/**
* Clamp a number between -128 and 127
* @param n - the number to clamp
* @returns - the clamped number
*/
export declare function i8Clamp(n: number): number;
/**
* zero the least significant bit
* @param n - the number to zero
* @returns - the zeroed number
*/
export declare function u32ZeroBit0(n: number): number;
/**
* Quantize a signed 16-bit number
* @param n - the number to quantize
* @returns - the quantized number
*/
export declare function i16Quantize(n: number): number;
/** A special buffer that stores a 32-bit number and can be converted to different types respecting bit positions */
export declare class U32I32F32 {
private buffer;
private view;
/**
* @param value - a 32-bit number
* @param type - the type of the number
*/
constructor(value: number, type?: 'u32' | 'i32' | 'f32');
/**
* @param value - a 32-bit number
* @param type - the type of the number
*/
set(value: number, type: 'u32' | 'i32' | 'f32'): void;
/** @returns - the value as an unsigned 32-bit number */
get u32(): number;
/**
* sets an unsigned 32-bit number
*
* @param value - the 32-bit unsigned number
*/
set u32(value: number);
/** @returns - the value as a signed 32-bit number */
get i32(): number;
/**
* sets a signed 32-bit number
*
* @param value - the 32-bit signed number
*/
set i32(value: number);
/** @returns - the value as a 32-bit float */
get f32(): number;
/**
* sets a 32-bit float
*
* @param value - the 32-bit float
*/
set f32(value: number);
}
/** A special buffer that stores a 64-bit number and can be converted to different types respecting bit positions */
export declare class U64I64F64 {
private buffer;
private view;
/**
* @param value - the value
* @param type - the input type
*/
constructor(value: number | bigint, type?: 'u64' | 'i64' | 'f64');
/**
* @param value - the value
* @param type - the input type
*/
set(value: number | bigint, type: 'u64' | 'i64' | 'f64'): void;
/** @returns - the value as an unsigned 64-bit number */
get u64(): bigint;
/**
* sets an unsigned 64-bit number
*
* @param value - the input 64-bit number
*/
set u64(value: bigint | number);
/** @returns - the value as a signed 64-bit number */
get i64(): bigint;
/**
* sets a signed 64-bit number
*
* @param value - the input 64-bit number
*/
set i64(value: number | bigint);
/** @returns - the value as a 64-bit float */
get f64(): number;
/**
* sets a 64-bit float
* @param value - the input 64-bit float
*/
set f64(value: number | bigint);
}
//# sourceMappingURL=util.d.ts.map