/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Invariant } from "./typeCheck";
/**
 * Key in a {@link BrandedMapSubset}.
 * @alpha
 */
export declare type BrandedKey<TKey, TContent> = TKey & Invariant<TContent>;
/**
 * @alpha
 */
export declare type BrandedKeyContent<TKey extends BrandedKey<unknown, any>> = TKey extends BrandedKey<unknown, infer TContent> ? TContent : never;
/**
 * A Map where the keys carry the types of values which they correspond to.
 *
 * Example usage:
 * ```typescript
 * type FooSlot<TContent> = BrandedKey<Opaque<Brand<number, "FooSlot">>, TContent>;
 * const counterSlot = brandedSlot<FooSlot<number>>();
 * const slots: BrandedMapSubset<FooSlot<any>> = new Map();
 * slots.set(counterSlot, slots.get(counterSlot) ?? 0 + 1);
 * ```
 *
 * @remarks
 * These APIs are designed so that a Map can be used to implement this type.
 *
 * @alpha
 */
export interface BrandedMapSubset<K extends BrandedKey<unknown, any>> {
    get<K2 extends K>(key: K2): BrandedKeyContent<K2> | undefined;
    has(key: K): boolean;
    set<K2 extends K>(key: K2, value: BrandedKeyContent<K2>): this;
    delete(key: K): boolean;
}
/**
 * Version of {@link getOrCreate} with better typing for {@link BrandedMapSubset}.
 */
export declare function getOrCreateSlotContent<M extends BrandedMapSubset<BrandedKey<unknown, any>>, K extends BrandedKey<unknown, any>>(map: M, key: K, defaultValue: (key: K) => BrandedKeyContent<K>): BrandedKeyContent<K>;
/**
 * Define a strongly typed slot in which data can be stored in a {@link BrandedMapSubset}.
 * @alpha
 */
export declare function brandedSlot<TSlot extends BrandedKey<any, any>>(): TSlot;
//# sourceMappingURL=brandedMap.d.ts.map