import {Specifications, joinTypes, typeOfDependency} from '../core/Dispatcher' export type Complex = {re: T; im: T;} declare module 'Dispatcher' { namespace Specifications { export class ComplexSpecifications {} namespace ComplexSpecifications { export class Complex_type { static test = (testT: (z: unknown) => z is T) => (z: unknown): z is Complex => typeof z === 'object' && 're' in z && 'im' in z && testT(z.re) && testT(z.im); static infer = (dep: typeOfDependency) => (z: Complex) => joinTypes(dep.typeOf(z.re), dep.typeOf(z.im)); static from = { T: (dep: ImplementationType<'zero', [T]>) => (t: T) => ({re: t, im: dep.zero(t)}), Complex: (convert: (from: U) => T) => (z: Complex) => ({re: convert(z.re), im: convert(z.im)}) }; } export const complex_1 = (dep: DependencyType<'zero', [T]>) => (t: T) => ({re: t, im: dep.zero(t)}) export const complex_2 = (t: T, u: T) => ({re: t, im: u}) } } } export {Specifications}