diff --git a/src/Get.ts b/src/Get.ts index 965f888..3cb43b2 100644 --- a/src/Get.ts +++ b/src/Get.ts @@ -3,7 +3,7 @@ import { MaybeSelector } from './MaybeSelector' import { Selector } from './Selector' import { MaybeConverter } from './MaybeConverter' import { Converter } from './Converter' -import { GetPropOverloads, Prop } from './Prop' +import { PropOverloads, Prop } from './Prop' import { Extension } from './Extension'; import { Memoize } from './Memoize'; import { Debug } from './Debug'; @@ -45,7 +45,7 @@ export type Get = GetSignature & { choose: ChooseOverloads ifDefined: IfDefinedOverloads combine: GetCombine - prop: GetPropOverloads + prop: PropOverloads mapParams: (map: (p2: P2) => Params) => Get addParam:

(p: P) => Get> withParams: >(params: P2) => Get> diff --git a/src/MaybeGet.ts b/src/MaybeGet.ts index d71b441..6d2ca3a 100644 --- a/src/MaybeGet.ts +++ b/src/MaybeGet.ts @@ -3,7 +3,7 @@ import { MaybeSelector } from './MaybeSelector' import { Selector } from './Selector' import { MaybeConverter } from './MaybeConverter' import { Converter } from './Converter' -import { GetPropOverloads, Prop } from './Prop' +import { PropOverloads, Prop } from './Prop' import { Extension } from './Extension'; import { Memoize } from './Memoize'; import { Debug } from './Debug'; @@ -45,7 +45,7 @@ export type MaybeGet = MaybeGetSignature ifDefined: IfDefinedOverloads combine: MaybeGetCombine - prop: GetPropOverloads + prop: PropOverloads mapParams: (map: (p2: P2) => Params) => MaybeGet addParam:

(p: P) => MaybeGet> withParams: >(params: P2) => MaybeGet> diff --git a/src/MaybeSelector.ts b/src/MaybeSelector.ts index 7d967d2..043e0c1 100644 --- a/src/MaybeSelector.ts +++ b/src/MaybeSelector.ts @@ -6,7 +6,7 @@ import { Composable } from './Composable' import { Selector } from './Selector' import { MaybeConverter } from './MaybeConverter' import { Converter } from './Converter' -import { MaybeSelectorPropOverloads, Prop } from './Prop' +import { PropOverloads, Prop } from './Prop' import { IndexBy, IndexByOverloads } from './IndexBy' import { Choose, ChooseOverloads } from './Choose'; import { Extension } from './Extension'; @@ -35,7 +35,7 @@ export interface MaybeSelector { set: Set modify: Modify compose: MaybeSelectorCompose - prop: MaybeSelectorPropOverloads + prop: PropOverloads indexBy: IndexByOverloads choose: ChooseOverloads ifDefined: IfDefinedOverloads diff --git a/src/Prop.ts b/src/Prop.ts index 271b7f8..163b8a0 100644 --- a/src/Prop.ts +++ b/src/Prop.ts @@ -1,35 +1,21 @@ import { Selector } from './Selector' -import { MaybeSelector } from './MaybeSelector' import { Get } from './Get' import { Set } from './Set' -import { MaybeGet } from './MaybeGet' +import { Composable } from "./Composable" +import { Dimensionality, Structure } from "./Discriminants"; -export interface MaybeGetPropOverloads { - (key: K1): MaybeGet - (k1: K1, k2: K2): MaybeGet - (k1: K1, k2: K2, k3: K3): MaybeGet - (k1: K1, k2: K2, k3: K3): MaybeGet -} +export type PropOverloads = { + (key: K1) + : Composable.ComposeResult -export interface GetPropOverloads { - (key: K1): Get - (k1: K1, k2: K2): Get - (k1: K1, k2: K2, k3: K3): Get - (k1: K1, k2: K2, k3: K3): Get -} + (k1: K1, k2: K2) + : Composable.ComposeResult -export interface SelectorPropOverloads { - (key: K1): Selector - (k1: K1, k2: K2): Selector - (k1: K1, k2: K2, k3: K3): Selector - (k1: K1, k2: K2, k3: K3): Selector -} + (k1: K1, k2: K2, k3: K3) + : Composable.ComposeResult -export interface MaybeSelectorPropOverloads { - (key: K1): MaybeSelector - (k1: K1, k2: K2): MaybeSelector - (k1: K1, k2: K2, k3: K3): MaybeSelector - (k1: K1, k2: K2, k3: K3): MaybeSelector + (k1: K1, k2: K2, k3: K3, k4: K4) + : Composable.ComposeResult } export namespace Prop { diff --git a/src/Root.ts b/src/Root.ts index 0f4e865..0b0406b 100644 --- a/src/Root.ts +++ b/src/Root.ts @@ -1,5 +1,5 @@ import { IndexBy, IndexByOverloads } from "./IndexBy"; -import { SelectorPropOverloads, Prop } from "./Prop"; +import { PropOverloads, Prop } from "./Prop"; import { MaybeConverter } from "./MaybeConverter"; import { Choose } from "./Choose"; import { Extension } from "./Extension"; @@ -9,7 +9,7 @@ import { Dimensionality, Structure } from './Discriminants'; export interface Root { indexBy: IndexByOverloads - prop: SelectorPropOverloads + prop: PropOverloads choose(typeGuard: (a: A) => a is B): MaybeConverter extend: (newExt: Extension) => Root memoize: () => Root diff --git a/src/Selector.ts b/src/Selector.ts index 0fd08de..e5dd829 100644 --- a/src/Selector.ts +++ b/src/Selector.ts @@ -5,7 +5,7 @@ import { MaybeSelector } from './MaybeSelector' import { MaybeConverter } from './MaybeConverter' import { Converter } from './Converter' import { Composable } from './Composable' -import { SelectorPropOverloads, Prop } from './Prop' +import { PropOverloads, Prop } from './Prop' import { IndexBy, IndexByOverloads } from './IndexBy'; import { Choose, ChooseOverloads } from './Choose'; import { Extension } from './Extension'; @@ -34,7 +34,7 @@ export interface Selector { set: Set modify: Modify compose: SelectorCompose - prop: SelectorPropOverloads + prop: PropOverloads indexBy: IndexByOverloads choose: ChooseOverloads ifDefined: IfDefinedOverloads