s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
76 lines • 2.43 kB
TypeScript
import type { PrimitiveBlock } from './primitive';
import type { Pbf as Protobuf } from '../../readers/protobuf';
/** Info Block - decoded into an object */
export interface InfoBlock {
version?: number;
timestamp?: number;
changeset?: number;
uid?: number;
user?: string;
visible?: boolean;
}
/** Optional metadata that may be included into each primitive. */
export declare class Info {
#private;
primitiveBlock: PrimitiveBlock;
/**
* @param primitiveBlock - the primitive block to access keys and values
* @param pbf - the Protobuf object to read from
*/
constructor(primitiveBlock: PrimitiveBlock, pbf?: Protobuf);
/**
* Access the info block's data as a stringifyable JSON object
* @returns - the info block
*/
toBlock(): InfoBlock;
/**
* Create an Info object from a dense representation
* @param primitiveBlock - the primitive block to access keys and values
* @param version - the version
* @param timestamp - the timestamp
* @param changeset - the changeset id
* @param uid - the uid
* @param userSid - the user who created the object
* @param visible - the visibility flag
* @returns - the info object
*/
static fromDense(primitiveBlock: PrimitiveBlock, version: number, timestamp: number, changeset: number, uid: number, userSid: number, visible?: boolean): Info;
/**
* Access the time stamp
* @returns - the time stamp as a number
*/
timeStamp(): number | undefined;
/**
* Access the user
* @returns - the user
*/
user(): string | undefined;
}
/** DenseInfo */
export declare class DenseInfo {
#private;
primitiveBlock: PrimitiveBlock;
version: number[];
timestamp: number[];
changeset: number[];
uid: number[];
userSid: number[];
visible?: boolean[];
/**
* @param primitiveBlock - the primitive block to access keys and values
* @param pbf - the Protobuf object to read from
*/
constructor(primitiveBlock: PrimitiveBlock, pbf: Protobuf);
/**
* Get the info objects
* @returns - the info objects
*/
infos(): Info[];
/**
* Check if the Info object at the given index is visible
* @param i - the index
* @returns - true if the object is visible
*/
getVisible(i: number): undefined | boolean;
}
//# sourceMappingURL=info.d.ts.map