Skip to content

Commit e9c63ac

Browse files
fix: change overload order to not show the deprecation per default [HOMER-1999] (#1841)
* fix: change overload order to not show the deprecation per default * chore: give a clear recommendation how to fix the deprecation * chore: add comment mentioning why we do this * Update lib/contentful-management.ts Co-authored-by: Kristoffer <[email protected]> --------- Co-authored-by: Kristoffer <[email protected]>
1 parent 660fc65 commit e9c63ac

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

lib/contentful-management.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,6 @@ interface UserAgentParams {
4343
export type ClientParams = RestAdapterParams & UserAgentParams
4444
type ClientOptions = UserAgentParams & XOR<RestAdapterParams, AdapterParams>
4545

46-
/**
47-
* @deprecated the alphaFeatures option is not longer supported
48-
*/
49-
function createClient(
50-
params: ClientOptions,
51-
opts: {
52-
type?: 'plain'
53-
alphaFeatures: string[]
54-
defaults?: DefaultParams
55-
}
56-
): ClientAPI | PlainClientAPI
5746
/**
5847
* Create a client instance
5948
* @param params - Client initialization parameters
@@ -72,6 +61,18 @@ function createClient(
7261
defaults?: DefaultParams
7362
}
7463
): PlainClientAPI
64+
// Usually, overloads with more specific signatures should come first but some IDEs are often not able to handle overloads with separate TSDocs correctly
65+
/**
66+
* @deprecated The `alphaFeatures` option is no longer supported. Please use the function without this option.
67+
*/
68+
function createClient(
69+
params: ClientOptions,
70+
opts: {
71+
type?: 'plain'
72+
alphaFeatures: string[]
73+
defaults?: DefaultParams
74+
}
75+
): ClientAPI | PlainClientAPI
7576
function createClient(
7677
params: ClientOptions,
7778
opts: {

0 commit comments

Comments
 (0)