2 Star 0 Fork 0

mirrors_bpmn-io/ids

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.d.ts 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
Maciej Barelkowski 提交于 2023-07-14 16:09 . chore: revert 26978cc
declare class Ids {
/**
* Create a new id generator / cache instance.
*
* You may optionally provide a seed that is used internally.
*
* @param {Seed} [seed]
*/
constructor(seed?: Seed);
/**
* Generate a next id.
*
* @param {Object} [element] element to bind the id to
*
* @return {String} id
*/
public next(element?: any): ID;
/**
* Generate a next id with a given prefix.
*
* @param {Object} [element] element to bind the id to
*
* @return {String} id
*/
public nextPrefixed(prefix: string, element?: any): ID;
/**
* Manually claim an existing id.
*
* @param {String} id
* @param {String} [element] element the id is claimed by
*/
public claim(id: ID, element?: any): void;
/**
* Returns true if the given id has already been assigned.
*
* @param {String} id
* @return {Boolean}
*/
public assigned(id: ID): boolean;
/**
* Unclaim an id.
*
* @param {String} id the id to unclaim
*/
public unclaim(id: ID): void;
/**
* Clear all claimed ids.
*/
public clear(): void;
}
type Seed = [number, number] | [number, number, number];
type ID = string;
export = Ids;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_bpmn-io/ids.git
git@gitee.com:mirrors_bpmn-io/ids.git
mirrors_bpmn-io
ids
ids
main

搜索帮助