import type { DomainObjectShape, Refable } from '../reference/Refable';
import type { RefByUnique as RefByUniqueType } from '../reference/RefByUnique.type';
/**
 * In Domain Driven Design, a Reference is a special type of Domain Literal that represents a reference to another Domain Object.
 *
 * A Domain Reference:
 * - contains only the identifying properties of the referenced object
 * - is immutable (like all Domain Literals)
 * - is used to refer to Domain Entities or Domain Events without including their full data
 *
 * The purpose of a Domain Reference is to enable lightweight references between domain objects without circular dependencies or data duplication.
 *
 * For example:
 * - A `SeaTurtleRefByUnique { seawaterSecurityNumber: string }` is a reference to a SeaTurtle by its unique key
 *
 * Note:
 * - Domain References are typically created automatically via `DomainEntity.RefByUnique` or `DomainEntity.RefByPrimary`
 * - You rarely need to extend a DomainRef directly
 */
export type RefByUnique<TDobj extends Refable<TShape, TPrimary, TUnique>, TShape extends DomainObjectShape = any, // todo: update DomainObjectShape -> DomainReferenceableInstance to enable extraction of primary and unique keys via types, when typescript supports constructor inference from instances
TPrimary extends readonly string[] = any, TUnique extends readonly string[] = any> = RefByUniqueType<TDobj, TShape, TPrimary, TUnique>;
export declare const RefByUnique: {
    new <TDobj extends Refable<TShape, TPrimary, TUnique>, TShape extends DomainObjectShape = any, TPrimary extends readonly string[] = any, TUnique extends readonly string[] = any>(props: RefByUnique<TDobj, TShape, TPrimary, TUnique>): RefByUnique<TDobj, TShape, TPrimary, TUnique>;
    /**
     * .what = an interface via which to construct instances w/ immute operations
     *
     * .why =
     *   - immute operations such as .clone produce more maintainable code by preventing unexpected mutations
     *   - these immute operations provide a safe pit of success for common operations
     */
    build<TDobj extends Refable<TShape, TPrimary, TUnique>, TShape extends DomainObjectShape = any, TPrimary extends readonly string[] = any, TUnique extends readonly string[] = any>(props: RefByUnique<TDobj, TShape, TPrimary, TUnique>): RefByUnique<TDobj, TShape, TPrimary, TUnique>;
    /**
     * .what = an interface via which to construct instances w/ immute operations
     *
     * .why =
     *   - immute operations such as .clone produce more maintainable code by preventing unexpected mutations
     *   - these immute operations provide a safe pit of success for common operations
     */
    as<TDobj extends Refable<TShape, TPrimary, TUnique>, TShape extends DomainObjectShape = any, TPrimary extends readonly string[] = any, TUnique extends readonly string[] = any>(props: RefByUnique<TDobj, TShape, TPrimary, TUnique>): RefByUnique<TDobj, TShape, TPrimary, TUnique>;
};
