/** * Counter interface for generating sequential instance IDs. * Encapsulates increment logic within the counter-implementation. */ export type Counter = { /** * Returns the next counter-value and increments the internal state. * @returns The next counter-value */ next: () => number; }; /** * Base regex pattern for time ID format: yyyymmdd-hhmmss-ms */ export declare const TIME_ID_BASE: RegExp; /** * Regex patterns for validating process and instance ID formats. * All patterns use strict anchors (^ and $) to ensure complete matches. */ export declare const ID_PATTERNS: Readonly<{ /** * Time ID / Run ID format: yyyymmdd-hhmmss-ms * Example: "20240101-120000-000" * Used by: getUniqueTimeId() */ readonly TIME_ID: RegExp; /** * Group ID format: alias by convention, semantically represents a group of instances * Example: "20240101-120000-000" * Used by: grouping related instances by time */ readonly GROUP_ID: RegExp; /** * Process/Thread ID format: timeId-pid-threadId * Example: "20240101-120000-000-12345-1" * Used by: getUniqueProcessThreadId() */ readonly PROCESS_THREAD_ID: RegExp; /** * Instance ID format: timeId.pid.threadId.counter * Example: "20240101-120000-000.12345.1.1" * Used by: getUniqueInstanceId() */ readonly INSTANCE_ID: RegExp; }>; /** * Generates a unique run ID. * This ID uniquely identifies a run/execution with a globally unique, sortable, human-readable date string. * Format: yyyymmdd-hhmmss-ms * Example: "20240101-120000-000" * * @returns A unique run ID string in readable date format */ export declare function getUniqueTimeId(): string; /** * Generates a unique process/thread ID. * This ID uniquely identifies a process/thread execution and prevents race conditions when running * the same plugin for multiple projects in parallel. * Format: timeId-pid-threadId * Example: "20240101-120000-000-12345-1" * * @returns A unique ID string combining timestamp, process ID, and thread ID */ export declare function getUniqueProcessThreadId(): string; /** * Generates a unique instance ID based on performance time origin, process ID, thread ID, and instance count. * This ID uniquely identifies an instance across processes and threads. * Format: timestamp.pid.threadId.counter * Example: "20240101-120000-000.12345.1.1" * * @param counter - Counter that provides the next instance count value * @returns A unique ID string combining timestamp, process ID, thread ID, and counter */ export declare function getUniqueInstanceId(counter: Counter): string; /** * Converts a timestamp in milliseconds to a sortable, human-readable date string. * Format: yyyymmdd-hhmmss-ms * Example: "20240101-120000-000" * * @param timestampMs - Timestamp in milliseconds * @returns A sortable date string in yyyymmdd-hhmmss-ms format */ export declare function sortableReadableDateString(timestampMs: number): string;