From 4cf4d73e865a4bccdcbdf49cd479720e497b3233 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Tue, 7 Nov 2023 09:12:26 -0800 Subject: [PATCH] fix overload precedence (#1915) --- src/transforms/dodge.d.ts | 4 ++-- src/transforms/normalize.d.ts | 4 ++-- src/transforms/stack.d.ts | 12 ++++++------ src/transforms/window.d.ts | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/transforms/dodge.d.ts b/src/transforms/dodge.d.ts index 3a6476784f..185b58916a 100644 --- a/src/transforms/dodge.d.ts +++ b/src/transforms/dodge.d.ts @@ -59,8 +59,8 @@ export interface DodgeYOptions extends DodgeOptions { * * If *dodgeOptions* is a string, it is shorthand for the dodge **anchor**. */ -export function dodgeX(dodgeOptions?: DodgeXOptions | DodgeXOptions["anchor"], options?: T): Initialized; export function dodgeX(options?: T & DodgeXOptions): Initialized; +export function dodgeX(dodgeOptions?: DodgeXOptions | DodgeXOptions["anchor"], options?: T): Initialized; /** * Given an **x** position channel, derives a new **y** position channel that @@ -71,5 +71,5 @@ export function dodgeX(options?: T & DodgeXOptions): Initialized; * * If *dodgeOptions* is a string, it is shorthand for the dodge **anchor**. */ -export function dodgeY(dodgeOptions?: DodgeYOptions | DodgeYOptions["anchor"], options?: T): Initialized; export function dodgeY(options?: T & DodgeYOptions): Initialized; +export function dodgeY(dodgeOptions?: DodgeYOptions | DodgeYOptions["anchor"], options?: T): Initialized; diff --git a/src/transforms/normalize.d.ts b/src/transforms/normalize.d.ts index e4a4273337..d0f5917bb7 100644 --- a/src/transforms/normalize.d.ts +++ b/src/transforms/normalize.d.ts @@ -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(basis?: NormalizeBasis, options?: T): Transformed; export function normalizeX(options?: T & NormalizeOptions): Transformed; +export function normalizeX(basis?: NormalizeBasis, options?: T): Transformed; /** * Groups data into series using the first channel of **z**, **fill**, or @@ -67,8 +67,8 @@ export function normalizeX(options?: T & NormalizeOptions): Transformed; * is used, the derived series values would be [*y₀* / *y₀*, *y₁* / *y₀*, *y₂* / * *y₀*, …] as in an index chart. */ -export function normalizeY(basis?: NormalizeBasis, options?: T): Transformed; export function normalizeY(options?: T & NormalizeOptions): Transformed; +export function normalizeY(basis?: NormalizeBasis, options?: T): Transformed; /** * Given a normalize *basis*, returns a corresponding map implementation for use diff --git a/src/transforms/stack.d.ts b/src/transforms/stack.d.ts index 528fe5007f..1cd8d7a13d 100644 --- a/src/transforms/stack.d.ts +++ b/src/transforms/stack.d.ts @@ -119,24 +119,24 @@ export interface StackOptions { * a label. If not specified, the input channel **x** defaults to the constant * one. */ -export function stackX(stackOptions?: StackOptions, options?: T): Transformed; export function stackX(options?: T & StackOptions): Transformed; +export function stackX(stackOptions?: StackOptions, options?: T): Transformed; /** * 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(stackOptions?: StackOptions, options?: T): Transformed; export function stackX1(options?: T & StackOptions): Transformed; +export function stackX1(stackOptions?: StackOptions, options?: T): Transformed; /** * 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(stackOptions?: StackOptions, options?: T): Transformed; export function stackX2(options?: T & StackOptions): Transformed; +export function stackX2(stackOptions?: StackOptions, options?: T): Transformed; /** * Transforms a length channel **y** into starting and ending position channels @@ -147,20 +147,20 @@ export function stackX2(options?: T & StackOptions): Transformed; * 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(stackOptions?: StackOptions, options?: T): Transformed; export function stackY(options?: T & StackOptions): Transformed; +export function stackY(stackOptions?: StackOptions, options?: T): Transformed; /** * 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(stackOptions?: StackOptions, options?: T): Transformed; export function stackY1(options?: T & StackOptions): Transformed; +export function stackY1(stackOptions?: StackOptions, options?: T): Transformed; /** * 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(stackOptions?: StackOptions, options?: T): Transformed; export function stackY2(options?: T & StackOptions): Transformed; +export function stackY2(stackOptions?: StackOptions, options?: T): Transformed; diff --git a/src/transforms/window.d.ts b/src/transforms/window.d.ts index 36c959a089..2ba0d312d0 100644 --- a/src/transforms/window.d.ts +++ b/src/transforms/window.d.ts @@ -108,8 +108,8 @@ export interface WindowOptions { * * If *windowOptions* is a number, it is shorthand for the window size **k**. */ -export function windowX(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed; export function windowX(options?: T & WindowOptions): Transformed; +export function windowX(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed; /** * Groups data into series using the first channel of *z*, *fill*, or *stroke* @@ -123,8 +123,8 @@ export function windowX(options?: T & WindowOptions): Transformed; * * If *windowOptions* is a number, it is shorthand for the window size **k**. */ -export function windowY(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed; export function windowY(options?: T & WindowOptions): Transformed; +export function windowY(windowOptions?: WindowOptions | WindowOptions["k"], options?: T): Transformed; /** * Given the specified window *options*, returns a corresponding map