/** * A typeclass which models the `getSemigroup` operation that returns a merge-wise * semigroup for a particular domain type * * @since 2.0.0 */ import { type Semigroup } from 'fp-ts/Semigroup'; /** * Options for merging particular data types. * * Note: Imap, Unions, and Literals will always use the `fallback` strategy to maintain * associativity. * * @since 2.0.0 * @category Model */ export type MergeOptions = { readonly string?: Semigroup; readonly number?: Semigroup; readonly boolean?: Semigroup; readonly unknown?: Semigroup; readonly fallback: 'first' | 'last'; }; /** * Determines how concrete values are concatenated * * @since 2.0.0 * @category Model */ export type MergeStrategy = 'first' | 'last' | MergeOptions; /** * A typeclass which models the `getSemigroup` operation that returns a merge-wise * semigroup for a particular domain type * * Default merge strategy is `last`, i.e. overwrite * * @since 2.0.0 * @category Model */ export interface MergeSemigroup { readonly semigroup: (mergeStrategy?: MergeStrategy) => Semigroup; } export { /** * Interprets a schema as a MergeSemigroup * * @since 2.0.0 * @category Interpreters */ deriveMergeSemigroup, } from 'schemata-ts/derivations/merge-semigroup-schemable'; /** * @since 2.0.0 * @category URI */ export declare const URI = "schemata-ts/MergeSemigroup"; /** * @since 2.0.0 * @category URI */ export type URI = typeof URI; declare module 'fp-ts/lib/HKT' { interface URItoKind { readonly [URI]: MergeSemigroup; } } //# sourceMappingURL=MergeSemigroup.d.ts.map