@re621/zestyapi
Version:
Comprehensive JS wrapper for e621.net API
23 lines (22 loc) • 900 B
TypeScript
export default class UtilID {
private static uniqueIDs;
/**
* Creates a random string of letters, to be used as an ID.
* The IDs are not cryptographically secure, don't use this for anything important.
* There is no garbage collection here, don't forget to use `remove()` if you need to use this for a long time.
* @param unique If false, simply returns a randomized string
*/
static make(unique?: boolean): string;
/**
* Checks whether the specified ID has been registered
* @param id String ID to check
*/
static has(id: string): boolean;
/**
* Remove the provided ID from the records.
* Make sure that the corresponding element has also been removed, to avoid possible collisions
* @param id String ID to remove
* @returns true if the ID existed, false otherwise
*/
static remove(id: string): boolean;
}