import { Maybe } from "./maybe"; import { Either } from "./either"; import { Cancelable } from "./cancelable"; // see https://codemix.com/opaque-types-in-javascript/ // See https://blog.beraliv.dev/2021-05-07-opaque-type-in-typescript declare const opaque: unique symbol; export type Opaque = K & { readonly [opaque]: T } export type BinaryCurriedFn = (s: T) => (t: T) => U; export type TernaryCurriedFn = (s: T) => (t: T) => (u: U) => V; export type QuaternaryCurriedFn = (s: T) => (t: T) => (u: U) => (v: V) => W; export type Function0 = () => R; export type Function1 = (t1: T1) => R; export type Function2 = (t1: T1, t2: T2) => R; export type Function3 = (t1: T1, t2: T2, t3: T3) => R; export type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; export type Function5 = (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R; export type Function6 = (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6) => R; export type PlainObject = { [name: string]: any } export type PlainObjectOf = { [name: string]: T } // see ts branch of Ramda export type Functor = | { ['fantasy-land/map']: (fn: (a: A) => B) => Functor; [key: string]: any } | Cancelable | Either | Maybe;