Skip to content

Documentation / @super-line/core / mergeSurfaces

Function: mergeSurfaces() ​

mergeSurfaces<A, B>(a, b): MergedSurface<A, B>

Defined in: packages/core/src/contract.ts:266

Merge two surfaces into one, per direction. A duplicate key is a compile error naming the key (and a runtime throw for untyped callers) — rename or prefix (e.g. 'harness.join') instead of letting a spread silently clobber.

Type Parameters ​

A ​

A extends Directional & object

B ​

B extends Directional & object

Parameters ​

a ​

A

b ​

B & NoOverlap<A, B>

Returns ​

MergedSurface<A, B>

Example ​

ts
// …and the host app mounts it into one of its roles:
const contract = defineContract({
  roles: { user: mergeSurfaces(harnessSurface, defineSurface({ clientToServer: { say: … } })) },
})

Released under the MIT License.