@morphic-ts/common
Advanced tools
Comparing version 3.0.0-alpha.1 to 3.0.0-alpha.2
@@ -1,2 +0,2 @@ | ||
import type { Kind, Kind2, URIS, URIS2 } from './HKT'; | ||
import type { Kind, URIS_ } from './HKT'; | ||
export { | ||
@@ -6,11 +6,7 @@ /** | ||
*/ | ||
Kind, | ||
Kind }; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
Kind2 }; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
export declare type URISIndexedAny = Record<URIS | URIS2, any>; | ||
export declare type URISIndexedAny = Readonly<Record<URIS_, any>>; | ||
/** | ||
@@ -34,3 +30,3 @@ * @since 0.0.1 | ||
export declare type MapToGenConfig<R extends AnyEnv, T extends URISIndexedAny> = { | ||
[k in URIS | URIS2]?: GenConfig<T[k], R[k]>; | ||
[k in URIS_]?: GenConfig<T[k], R[k]>; | ||
}; | ||
@@ -43,2 +39,3 @@ /** | ||
_A: A; | ||
readonly ['HKT']: never; | ||
} | ||
@@ -52,4 +49,4 @@ /** | ||
*/ | ||
export declare const getApplyConfig: <Uri extends URIS | URIS2>(uri: Uri) => <E, A, R extends Record<typeof uri, any>>(config?: { | ||
export declare const getApplyConfig: <Uri extends URIS_>(uri: Uri) => <E, A, R extends Record<typeof uri, any>>(config?: { | ||
[k in Uri]?: GenConfig<ConfigType<E, A>[Uri], R>; | ||
}) => GenConfig<ConfigType<E, A>[Uri], R>; |
@@ -1,10 +0,6 @@ | ||
import type { Kind, Kind2, URIS, URIS2 } from './HKT'; | ||
import type { Kind, URIS } from './HKT'; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
export declare type OfType<F extends URIS, A, RC> = Kind<F, RC, A>; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
export declare type OfType2<F extends URIS2, L, A, RC> = Kind2<F, RC, L, A>; | ||
export declare type OfType<F extends URIS, L, A, RC> = Kind<F, RC, L, A>; | ||
declare type Function1 = (a: any) => any; | ||
@@ -11,0 +7,0 @@ /** |
@@ -5,9 +5,9 @@ /** | ||
/** | ||
* `* -> *` constructors | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export interface HKT<URI, R, A> { | ||
readonly _URI: URI; | ||
(_R: R): void; | ||
export interface HKT<R, E, A> { | ||
readonly _R: (_: R) => void; | ||
readonly _A: A; | ||
readonly _E: E; | ||
} | ||
@@ -18,41 +18,22 @@ /** | ||
*/ | ||
export interface HKT2<URI, R, E, A> extends HKT<URI, R, A> { | ||
export interface URItoKind<R, E, A> { | ||
readonly _R: (_: R) => void; | ||
readonly _A: A; | ||
readonly _E: E; | ||
readonly ['HKT']: HKT<R, E, A>; | ||
} | ||
/** | ||
* `* -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export interface URItoKind<R, A> { | ||
_R: R; | ||
_A: A; | ||
} | ||
/** | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export interface URItoKind2<R, E, A> { | ||
_R: R; | ||
_A: A; | ||
_E: E; | ||
} | ||
export declare type URIS = Exclude<keyof URItoKind<any, any, any>, '_A' | '_E' | '_R'>; | ||
/** | ||
* `* -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type URIS = Exclude<keyof URItoKind<any, any>, '_A' | '_R'>; | ||
/** | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type URIS2 = Exclude<keyof URItoKind2<any, any, any>, '_A' | '_E' | '_R'>; | ||
export declare type URIS_ = Exclude<URIS, 'HKT'>; | ||
/** | ||
* `* -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type Kind<URI extends URIS, R, A> = URI extends URIS ? URItoKind<R, A>[URI] : any; | ||
/** | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type Kind2<URI extends URIS2, R, E, A> = URI extends URIS2 ? URItoKind2<R, E, A>[URI] : any; | ||
export declare type Kind<URI extends URIS, R, E, A> = URItoKind<R, E, A>[URI]; |
@@ -1,2 +0,2 @@ | ||
import type { Kind, Kind2, URIS, URIS2 } from './HKT'; | ||
import type { Kind, URIS_ } from './HKT'; | ||
export { | ||
@@ -6,11 +6,7 @@ /** | ||
*/ | ||
Kind, | ||
Kind }; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
Kind2 }; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
export declare type URISIndexedAny = Record<URIS | URIS2, any>; | ||
export declare type URISIndexedAny = Readonly<Record<URIS_, any>>; | ||
/** | ||
@@ -34,3 +30,3 @@ * @since 0.0.1 | ||
export declare type MapToGenConfig<R extends AnyEnv, T extends URISIndexedAny> = { | ||
[k in URIS | URIS2]?: GenConfig<T[k], R[k]>; | ||
[k in URIS_]?: GenConfig<T[k], R[k]>; | ||
}; | ||
@@ -43,2 +39,3 @@ /** | ||
_A: A; | ||
readonly ['HKT']: never; | ||
} | ||
@@ -52,4 +49,4 @@ /** | ||
*/ | ||
export declare const getApplyConfig: <Uri extends URIS | URIS2>(uri: Uri) => <E, A, R extends Record<typeof uri, any>>(config?: { | ||
export declare const getApplyConfig: <Uri extends URIS_>(uri: Uri) => <E, A, R extends Record<typeof uri, any>>(config?: { | ||
[k in Uri]?: GenConfig<ConfigType<E, A>[Uri], R>; | ||
}) => GenConfig<ConfigType<E, A>[Uri], R>; |
@@ -1,10 +0,6 @@ | ||
import type { Kind, Kind2, URIS, URIS2 } from './HKT'; | ||
import type { Kind, URIS } from './HKT'; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
export declare type OfType<F extends URIS, A, RC> = Kind<F, RC, A>; | ||
/** | ||
* @since 0.0.1 | ||
*/ | ||
export declare type OfType2<F extends URIS2, L, A, RC> = Kind2<F, RC, L, A>; | ||
export declare type OfType<F extends URIS, L, A, RC> = Kind<F, RC, L, A>; | ||
declare type Function1 = (a: any) => any; | ||
@@ -11,0 +7,0 @@ /** |
@@ -5,9 +5,9 @@ /** | ||
/** | ||
* `* -> *` constructors | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export interface HKT<URI, R, A> { | ||
readonly _URI: URI; | ||
(_R: R): void; | ||
export interface HKT<R, E, A> { | ||
readonly _R: (_: R) => void; | ||
readonly _A: A; | ||
readonly _E: E; | ||
} | ||
@@ -18,41 +18,22 @@ /** | ||
*/ | ||
export interface HKT2<URI, R, E, A> extends HKT<URI, R, A> { | ||
export interface URItoKind<R, E, A> { | ||
readonly _R: (_: R) => void; | ||
readonly _A: A; | ||
readonly _E: E; | ||
readonly ['HKT']: HKT<R, E, A>; | ||
} | ||
/** | ||
* `* -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export interface URItoKind<R, A> { | ||
_R: R; | ||
_A: A; | ||
} | ||
/** | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export interface URItoKind2<R, E, A> { | ||
_R: R; | ||
_A: A; | ||
_E: E; | ||
} | ||
export declare type URIS = Exclude<keyof URItoKind<any, any, any>, '_A' | '_E' | '_R'>; | ||
/** | ||
* `* -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type URIS = Exclude<keyof URItoKind<any, any>, '_A' | '_R'>; | ||
/** | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type URIS2 = Exclude<keyof URItoKind2<any, any, any>, '_A' | '_E' | '_R'>; | ||
export declare type URIS_ = Exclude<URIS, 'HKT'>; | ||
/** | ||
* `* -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type Kind<URI extends URIS, R, A> = URI extends URIS ? URItoKind<R, A>[URI] : any; | ||
/** | ||
* `* -> * -> *` constructors | ||
* @since 0.0.1 | ||
*/ | ||
export declare type Kind2<URI extends URIS2, R, E, A> = URI extends URIS2 ? URItoKind2<R, E, A>[URI] : any; | ||
export declare type Kind<URI extends URIS, R, E, A> = URItoKind<R, E, A>[URI]; |
{ | ||
"name": "@morphic-ts/common", | ||
"version": "3.0.0-alpha.1", | ||
"version": "3.0.0-alpha.2", | ||
"description": "Morphic core common package", | ||
@@ -53,3 +53,3 @@ "author": "Stéphane Le Dorze <stephane.ledorze@gmail.com>", | ||
}, | ||
"gitHead": "5dc3007d0a62c2084c5c057735a2555b12d61db3" | ||
"gitHead": "a266a066860a4e5285297e3dd356bdda68693ee1" | ||
} |
16863
461