import { type EmplaceHandler, type Insertable, type MapLike, type Updatable } from "./emplace.js"; export declare function emplace(this: Readonly> & M, key: K, handler: Readonly>): V; export declare function emplace(this: Readonly> & M, key: K, handler: Readonly>): V; export declare function emplace(this: Readonly> & M, key: K, handler: Readonly>): V | undefined; /** Mixin for {@link emplace}. * * @example * ```ts * import { emplaceable } from "https://deno.land/x/upsert/mixin.ts"; * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * class MyMap extends emplaceable(Map) {} * * assert(MyMap.prototype.emplace); * ``` * * decorator style: * * @example * ```ts * import { emplaceable, type Emplaceable } from "https://deno.land/x/upsert/mixin.ts"; * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * @emplaceable * class MyMap extends Map {} * interface MyMap extends Emplaceable {} * assert(MyMap.prototype.emplace); * ``` */ export declare function emplaceable; }>(ctor: T): { new (...args: any): { emplace: typeof emplace; get: (key: never) => undefined; has: (key: never) => boolean; set: (key: never, value: never) => void; }; } & T; /** Mixin for {@link emplace}. * * @example * ```ts * import { Emplaceable } from "https://deno.land/x/upsert/mixin.ts"; * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * class MyMap extends Emplaceable(Map) {} * * assert(MyMap.prototype.emplace); * ``` * * @deprecated rename to {@link emplaceable}. */ export declare const Emplaceable: typeof emplaceable; /** Emplaceable API. */ export interface Emplaceable { /** Add a value to a map if the map does not already have something at {@link key}, and will also update an existing value at {@link key}. */ emplace(key: K, handler: EmplaceHandler): V; emplace(key: K, handler: Insertable): V; emplace(key: K, handler: Updatable): V | undefined; }