/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { getOrCreate } from "./utils.js";
/**
 * Version of {@link getOrCreate} with better typing for {@link BrandedMapSubset}.
 * @privateRemarks
 * Only infers type from key to avoid inferring `any` from map's key.
 */
export function getOrCreateSlotContent(map, key, defaultValue) {
    return getOrCreate(map, key, defaultValue);
}
/**
 * A counter used to allocate unique numbers (See {@link brandedSlot}) to use as {@link BrandedKey}s.
 * This allows the keys to be small integers, which are efficient to use as keys in maps.
 * See {@link BrandedMapSubset}.
 */
let slotCounter = 0;
/**
 * Define a strongly typed slot in which data can be stored in a {@link BrandedMapSubset}.
 */
export function brandedSlot() {
    return slotCounter++;
}
//# sourceMappingURL=brandedMap.js.map