Skip to content

Commit

Permalink
feat: scale overload
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw committed Aug 26, 2020
1 parent b860240 commit 786909e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/vx-scale/src/createScale.ts
@@ -1,5 +1,5 @@
import { ScaleConfig, PickScaleConfigWithoutType, PickScaleConfig } from './types/ScaleConfig';
import { DefaultThresholdInput, PickD3Scale } from './types/Scale';
import { DefaultThresholdInput, PickD3Scale, D3Scale } from './types/Scale';
import { StringLike, DefaultOutput } from './types/Base';
import createLinearScale from './scales/linear';
import createLogScale from './scales/log';
Expand Down Expand Up @@ -107,6 +107,14 @@ function createScale<
config: PickScaleConfig<'band', Output, DiscreteInput>,
): PickD3Scale<'band', Output, DiscreteInput>;

function createScale<
Output = DefaultOutput,
DiscreteInput extends StringLike = StringLike,
ThresholdInput extends DefaultThresholdInput = DefaultThresholdInput
>(
config: ScaleConfig<Output, DiscreteInput, ThresholdInput>,
): D3Scale<Output, DiscreteInput, ThresholdInput>;

// Actual implementation

function createScale<
Expand Down

0 comments on commit 786909e

Please sign in to comment.