/**
 * Copyright (c) OpenLens Maintainers. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */
export interface StaticThis<T, R extends any[]> {
    new (...args: R): T;
}
/**
 * @deprecated This is a form of global shared state
 */
export declare class Singleton {
    private static readonly instances;
    private static creating;
    constructor();
    /**
     * Creates the single instance of the child class if one was not already created.
     *
     * Multiple calls will return the same instance.
     * Essentially throwing away the arguments to the subsequent calls.
     *
     * Note: this is a racy function, if two (or more) calls are racing to call this function
     * only the first's arguments will be used.
     * @param this Implicit argument that is the child class type
     * @param args The constructor arguments for the child class
     * @returns An instance of the child class
     */
    static createInstance<T extends Singleton, R extends any[]>(this: StaticThis<T, R>, ...args: R): T;
    /**
     * Get the instance of the child class that was previously created.
     * @param this Implicit argument that is the child class type
     * @param strict If false will return `undefined` instead of throwing when an instance doesn't exist.
     * Default: `true`
     * @returns An instance of the child class
     */
    static getInstance<T, R extends any[]>(this: StaticThis<T, R>, strict?: true): T;
    static getInstance<T, R extends any[]>(this: StaticThis<T, R>, strict: false): T | undefined;
    /**
     * Delete the instance of the child class.
     *
     * Note: this doesn't prevent callers of `getInstance` from storing the result in a global.
     *
     * There is *no* way in JS or TS to prevent globals like that.
     */
    static resetInstance(): void;
}
export default Singleton;
