Skip to content

Commit

Permalink
fix overload precedence (#1915)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock authored Nov 7, 2023
1 parent cbb673d commit 4cf4d73
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/transforms/dodge.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export interface DodgeYOptions extends DodgeOptions {
*
* If *dodgeOptions* is a string, it is shorthand for the dodge **anchor**.
*/
export function dodgeX<T>(dodgeOptions?: DodgeXOptions | DodgeXOptions["anchor"], options?: T): Initialized<T>;
export function dodgeX<T>(options?: T & DodgeXOptions): Initialized<T>;
export function dodgeX<T>(dodgeOptions?: DodgeXOptions | DodgeXOptions["anchor"], options?: T): Initialized<T>;

/**
* Given an **x** position channel, derives a new **y** position channel that
Expand All @@ -71,5 +71,5 @@ export function dodgeX<T>(options?: T & DodgeXOptions): Initialized<T>;
*
* If *dodgeOptions* is a string, it is shorthand for the dodge **anchor**.
*/
export function dodgeY<T>(dodgeOptions?: DodgeYOptions | DodgeYOptions["anchor"], options?: T): Initialized<T>;
export function dodgeY<T>(options?: T & DodgeYOptions): Initialized<T>;
export function dodgeY<T>(dodgeOptions?: DodgeYOptions | DodgeYOptions["anchor"], options?: T): Initialized<T>;
4 changes: 2 additions & 2 deletions src/transforms/normalize.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export interface NormalizeOptions {
* is used, the derived series values would be [*x₀* / *x₀*, *x₁* / *x₀*, *x₂* /
* *x₀*, …] as in an index chart.
*/
export function normalizeX<T>(basis?: NormalizeBasis, options?: T): Transformed<T>;
export function normalizeX<T>(options?: T & NormalizeOptions): Transformed<T>;
export function normalizeX<T>(basis?: NormalizeBasis, options?: T): Transformed<T>;

/**
* Groups data into series using the first channel of **z**, **fill**, or
Expand All @@ -67,8 +67,8 @@ export function normalizeX<T>(options?: T & NormalizeOptions): Transformed<T>;
* is used, the derived series values would be [*y₀* / *y₀*, *y₁* / *y₀*, *y₂* /
* *y₀*, …] as in an index chart.
*/
export function normalizeY<T>(basis?: NormalizeBasis, options?: T): Transformed<T>;
export function normalizeY<T>(options?: T & NormalizeOptions): Transformed<T>;
export function normalizeY<T>(basis?: NormalizeBasis, options?: T): Transformed<T>;

/**
* Given a normalize *basis*, returns a corresponding map implementation for use
Expand Down
12 changes: 6 additions & 6 deletions src/transforms/stack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,24 @@ export interface StackOptions {
* a label. If not specified, the input channel **x** defaults to the constant
* one.
*/
export function stackX<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
export function stackX<T>(options?: T & StackOptions): Transformed<T>;
export function stackX<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;

/**
* Like **stackX**, but returns the starting position **x1** as the **x**
* channel, for example to position a dot on the left-hand side of each element
* of a stack.
*/
export function stackX1<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
export function stackX1<T>(options?: T & StackOptions): Transformed<T>;
export function stackX1<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;

/**
* Like **stackX**, but returns the starting position **x2** as the **x**
* channel, for example to position a dot on the right-hand side of each element
* of a stack.
*/
export function stackX2<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
export function stackX2<T>(options?: T & StackOptions): Transformed<T>;
export function stackX2<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;

/**
* Transforms a length channel **y** into starting and ending position channels
Expand All @@ -147,20 +147,20 @@ export function stackX2<T>(options?: T & StackOptions): Transformed<T>;
* midpoint between **y1** and **y2**, for example to place a label. If not
* specified, the input channel **y** defaults to the constant one.
*/
export function stackY<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
export function stackY<T>(options?: T & StackOptions): Transformed<T>;
export function stackY<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;

/**
* Like **stackY**, but returns the starting position **y1** as the **y**
* channel, for example to position a dot at the bottom of each element of a
* stack.
*/
export function stackY1<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
export function stackY1<T>(options?: T & StackOptions): Transformed<T>;
export function stackY1<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;

/**
* Like **stackY**, but returns the ending position **y2** as the **y** channel,
* for example to position a dot at the top of each element of a stack.
*/
export function stackY2<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
export function stackY2<T>(options?: T & StackOptions): Transformed<T>;
export function stackY2<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
4 changes: 2 additions & 2 deletions src/transforms/window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export interface WindowOptions {
*
* If *windowOptions* is a number, it is shorthand for the window size **k**.
*/
export function windowX<T>(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed<T>;
export function windowX<T>(options?: T & WindowOptions): Transformed<T>;
export function windowX<T>(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed<T>;

/**
* Groups data into series using the first channel of *z*, *fill*, or *stroke*
Expand All @@ -123,8 +123,8 @@ export function windowX<T>(options?: T & WindowOptions): Transformed<T>;
*
* If *windowOptions* is a number, it is shorthand for the window size **k**.
*/
export function windowY<T>(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed<T>;
export function windowY<T>(options?: T & WindowOptions): Transformed<T>;
export function windowY<T>(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed<T>;

/**
* Given the specified window *options*, returns a corresponding map
Expand Down

0 comments on commit 4cf4d73

Please sign in to comment.