UNPKG

@arthurgubaidullin/nx-embed-dependencies

Version:

This plugin for [Nx](https://nx.dev) helps injecting local dependencies into a package.

78 lines (77 loc) 2.14 kB
/** * @since 0.2.0 */ import { Field } from 'fp-ts/lib/Field'; import { Predicate } from 'fp-ts/lib/function'; import { Monoid } from 'fp-ts/lib/Monoid'; import { Ord } from 'fp-ts/lib/Ord'; import { Ring } from 'fp-ts/lib/Ring'; import { Semigroup } from 'fp-ts/lib/Semigroup'; import { Semiring } from 'fp-ts/lib/Semiring'; import { Eq } from 'fp-ts/lib/Eq'; import { Iso, Prism } from 'monocle-ts'; /** * @since 0.2.0 */ export interface Newtype<URI, A> { readonly _URI: URI; readonly _A: A; } /** * @since 0.2.0 */ export declare type AnyNewtype = Newtype<any, any>; /** * @since 0.2.0 */ export declare type URIOf<N extends AnyNewtype> = N['_URI']; /** * @since 0.2.0 */ export declare type CarrierOf<N extends AnyNewtype> = N['_A']; /** * @since 0.3.0 */ export declare const getEq: <S extends Newtype<any, any>>(S: Eq<S["_A"]>) => Eq<S>; /** * @since 0.2.0 */ export declare const getOrd: <S extends Newtype<any, any>>(O: Ord<S["_A"]>) => Ord<S>; /** * @since 0.2.0 */ export declare const getSemigroup: <S extends Newtype<any, any>>(S: Semigroup<S["_A"]>) => Semigroup<S>; /** * @since 0.2.0 */ export declare const getMonoid: <S extends Newtype<any, any>>(M: Monoid<S["_A"]>) => Monoid<S>; /** * @since 0.2.0 */ export declare const getSemiring: <S extends Newtype<any, any>>(S: Semiring<S["_A"]>) => Semiring<S>; /** * @since 0.2.0 */ export declare const getRing: <S extends Newtype<any, any>>(R: Ring<S["_A"]>) => Ring<S>; /** * @since 0.2.0 */ export declare const getField: <S extends Newtype<any, any>>(F: Field<S["_A"]>) => Field<S>; /** * @since 0.2.0 */ export declare function iso<S extends AnyNewtype>(): Iso<S, CarrierOf<S>>; /** * @since 0.2.0 */ export interface Concat<N1 extends Newtype<object, any>, N2 extends Newtype<object, CarrierOf<N1>>> extends Newtype<URIOf<N1> & URIOf<N2>, CarrierOf<N1>> { } /** * @since 0.2.0 */ export interface Extends<N extends AnyNewtype, Tags extends object> extends Newtype<Tags & URIOf<N>, CarrierOf<N>> { } /** * @since 0.2.0 */ export declare function prism<S extends AnyNewtype>(predicate: Predicate<CarrierOf<S>>): Prism<CarrierOf<S>, S>;