Skip to content

Commit 35bc991

Browse files
chore(repo,types): Update billing-related types; hide "Type declaration" heading from typedoc output (#6801)
Co-authored-by: panteliselef <[email protected]>
1 parent 13d08c8 commit 35bc991

File tree

11 files changed

+154
-83
lines changed

11 files changed

+154
-83
lines changed

.changeset/bitter-books-drop.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.typedoc/__tests__/__snapshots__/file-structure.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
5959
"types/confirm-checkout-params.mdx",
6060
"types/create-checkout-params.mdx",
6161
"types/create-organization-params.mdx",
62+
"types/deleted-object-resource.mdx",
6263
"types/element-object-key.mdx",
6364
"types/elements-config.mdx",
6465
"types/errors.mdx",

.typedoc/custom-plugin.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ const LINK_REPLACEMENTS = [
5454
['web3-wallet', '/docs/references/backend/types/backend-web3-wallet'],
5555
['verify-token-options', '#verify-token-options'],
5656
['localization-resource', '/docs/customization/localization'],
57-
['commerce-subscription-item-resource', '/docs/references/javascript/types/commerce-subscription-item-resource'],
58-
['commerce-money-amount', '/docs/references/javascript/types/commerce-money-amount'],
5957
];
6058

6159
/**

.typedoc/custom-theme.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
289289
return superPartials.member(model, options);
290290
},
291291
/**
292-
* This hides the "Type parameters" section and the declaration title from the output
292+
* This hides the "Type parameters" section, the declaration title, and the "Type declaration" heading from the output
293293
* @param {import('typedoc').DeclarationReflection} model
294294
* @param {{ headingLevel: number, nested?: boolean }} options
295295
*/
@@ -309,7 +309,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
309309
const output = superPartials.declaration(customizedModel, options);
310310
this.partials = originalPartials;
311311

312-
return output;
312+
// Remove the "Type declaration" heading from the output
313+
// This heading is generated by the original declaration partial
314+
const filteredOutput = output.replace(/^## Type declaration$/gm, '');
315+
316+
return filteredOutput;
313317
},
314318
/**
315319
* This ensures that everything is wrapped in a single codeblock
@@ -452,7 +456,7 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
452456
const items = headings.map(i => `'${i}'`).join(', ');
453457
const tabs = md.map(i => `<Tab>${i}</Tab>`).join('\n');
454458

455-
return `This function returns a discriminated union type. There are multiple variants of this type available which you can select by clicking on one of the tabs.
459+
return `There are multiple variants of this type available which you can select by clicking on one of the tabs.
456460
457461
<Tabs items={[${items}]}>
458462
${tabs}

packages/backend/src/api/resources/CommercePlan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Feature } from './Feature';
44
import type { CommercePlanJSON } from './JSON';
55

66
/**
7-
* The `CommercePlan` object is similar to the [`CommercePlanResource`](/docs/references/javascript/types/commerce-plan-resource) object as it holds information about a plan, as well as methods for managing it. However, the `CommercePlan` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/plans) and is not directly accessible from the Frontend API.
7+
* The `CommercePlan` object is similar to the [`BillingPlanResource`](/docs/references/javascript/types/billing-plan-resource) object as it holds information about a plan, as well as methods for managing it. However, the `CommercePlan` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/plans) and is not directly accessible from the Frontend API.
88
*
99
* @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes.
1010
*/

packages/types/src/clerk.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,9 +1577,9 @@ export type UserButtonProps = UserButtonProfileMode & {
15771577
/**
15781578
* If true the `<UserButton />` will only render the popover.
15791579
* Enables developers to implement a custom dialog.
1580-
* This API is experimental and may change at any moment.
1581-
* @experimental
1580+
*
15821581
* @default undefined
1582+
* @experimental This API is experimental and may change at any moment.
15831583
*/
15841584
__experimental_asStandalone?: boolean | ((opened: boolean) => void);
15851585

@@ -1647,9 +1647,9 @@ export type OrganizationSwitcherProps = CreateOrganizationMode &
16471647
/**
16481648
* If true, `<OrganizationSwitcher />` will only render the popover.
16491649
* Enables developers to implement a custom dialog.
1650-
* This API is experimental and may change at any moment.
1651-
* @experimental
1650+
*
16521651
* @default undefined
1652+
* @experimental This API is experimental and may change at any moment.
16531653
*/
16541654
__experimental_asStandalone?: boolean | ((opened: boolean) => void);
16551655

0 commit comments

Comments
 (0)