UNPKG

@maxgraph/core

Version:

maxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.

29 lines (28 loc) 877 B
import { IdentityFunction, IdentityObject } from '../types.js'; /** * Identity for JavaScript objects and functions. * * This is implemented using a simple incrementing counter which is stored in each object under {@link FIELD_NAME}. * * The identity for an object does not change during its lifecycle. */ declare class ObjectIdentity { /** * Name of the field to be used to store the object ID. * @default {@IDENTITY_FIELD_NAME} */ static FIELD_NAME: string; /** * Current counter. */ static counter: number; /** * Returns the ID for the given object or function. */ static get(obj: IdentityObject | IdentityFunction | null): string | null; /** * Deletes the ID from the given object or function. */ static clear(obj: IdentityObject | IdentityFunction): void; } export default ObjectIdentity;