Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change overload order to not show the deprecation per default [HOMER-1999] #1841

Merged
merged 5 commits into from
May 31, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions lib/contentful-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ interface UserAgentParams {
export type ClientParams = RestAdapterParams & UserAgentParams
type ClientOptions = UserAgentParams & XOR<RestAdapterParams, AdapterParams>

/**
* @deprecated the alphaFeatures option is not longer supported
*/
function createClient(
params: ClientOptions,
opts: {
type?: 'plain'
alphaFeatures: string[]
defaults?: DefaultParams
}
): ClientAPI | PlainClientAPI
/**
* Create a client instance
* @param params - Client initialization parameters
Expand All @@ -72,6 +61,18 @@ function createClient(
defaults?: DefaultParams
}
): PlainClientAPI
// Usually, overloads with more specific signatures should come first but some IDEs are often not able to handle overloads with separate TSDocs correctly
/**
* @deprecated The `alphaFeatures` option is not longer supported. Please use the function without this option.
Chaoste marked this conversation as resolved.
Show resolved Hide resolved
*/
function createClient(
params: ClientOptions,
opts: {
type?: 'plain'
alphaFeatures: string[]
defaults?: DefaultParams
}
): ClientAPI | PlainClientAPI
function createClient(
params: ClientOptions,
opts: {
Expand Down