diff --git a/packages/react/package.json b/packages/react/package.json index c39ae4255ad..c18e83d2f98 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -17,9 +17,9 @@ "lint": "eslint src/", "fix": "eslint src/ --fix", "clean": "rm -rf dist/", - "extract-api": "api-extractor run --local", + "generate-docs": "api-extractor run --local && yarn api-documenter markdown -i ./temp -o ./docs && yarn generate-snippets", "generate:md-docs": "yarn api-documenter markdown -i ./temp -o ./docs", - "generate-snippets": "node ./scripts/generate-snippets.mjs", + "generate-snippets": "node ./scripts/generate-snippets.mjs && node ./scripts/generate-feature-snippets.mjs", "build": "tsc && preconstruct build", "e2e": "yarn test-ct", "test-ct": "playwright test -c playwright-ct.config.ts" diff --git a/packages/react/scripts/generate-feature-snippets.mjs b/packages/react/scripts/generate-feature-snippets.mjs new file mode 100644 index 00000000000..5c8aad40e47 --- /dev/null +++ b/packages/react/scripts/generate-feature-snippets.mjs @@ -0,0 +1,165 @@ +import { + TSDocParser, + DocExcerpt, + TSDocConfiguration, + TSDocTagSyntaxKind, + TSDocTagDefinition, +} from "@microsoft/tsdoc"; +import fs from "fs"; + +/** + * This is a simplistic solution until we implement proper DocNode rendering APIs. + */ +export class Formatter { + static renderDocNode(docNode) { + let result = ""; + if (docNode) { + if (docNode instanceof DocExcerpt) { + result += docNode.content.toString(); + } + for (const childNode of docNode.getChildNodes()) { + result += Formatter.renderDocNode(childNode); + } + } + return result; + } + + static renderDocNodes(docNodes) { + let result = ""; + for (const docNode of docNodes) { + result += Formatter.renderDocNode(docNode); + } + return result; + } +} + +const config = new TSDocConfiguration(); +const tag = new TSDocTagDefinition({ + tagName: "@twfeature", + allowMultiple: true, + syntaxKind: TSDocTagSyntaxKind.BlockTag, +}); +config.addTagDefinition(tag); +config.setSupportForTag(tag, true); +const tsdocParser = new TSDocParser(config); + +const json = JSON.parse( + fs.readFileSync(`${process.cwd()}/temp/react.api.json`, "utf8"), +); + +function languageNameToKey(languageName) { + switch (languageName) { + case "js": + case "jsx": + return "javascript"; + case "ts": + case "tsx": + return "tyepscript"; + default: + return languageName; + } +} + +// Get all the DetectableFeature classes +const classes = json.members[0].members; +const features = {}; + +function parseExampleTag(docComment) { + const exampleBlocks = docComment._customBlocks.filter( + (b) => b._blockTag._tagName === "@example", + ); + + const examplesString = Formatter.renderDocNodes(exampleBlocks); + + const regex = /```([a-zA-Z]*)\n([\S\s]*?)\n```/g; + + let matches; + + const examples = {}; + + while ((matches = regex.exec(examplesString)) !== null) { + // This is necessary to avoid infinite loops with zero-width matches + if (matches.index === regex.lastIndex) { + regex.lastIndex++; + } + examples[languageNameToKey(matches[1])] = matches[2]; + } + return examples; +} + +function parseTWFeatureTag(docComment) { + const featureBlocks = docComment._customBlocks.filter( + (b) => b._blockTag._tagName === "@twfeature", + ); + + const featuresString = Formatter.renderDocNodes(featureBlocks); + return featuresString.split(" | ").map((f) => + f + .trim() + .replace(/\\n/g, "") + .replace("\n\n", "") + .replace(/`/g, "") + .replace(/@twfeature/g, ""), + ); +} + +const baseDocUrl = "https://docs.thirdweb.com/react/react."; + +const extractReferenceLink = (m, kind, contractName) => { + if (kind === "Property") { + return m.excerptTokens + .filter((e) => e.kind === "Reference") + .map((e) => `${baseDocUrl}${e.text.toLowerCase()}`)[0]; + } + if (kind === "Method") { + return `${baseDocUrl}${contractName}.${m.name}`.toLowerCase(); + } + return `${baseDocUrl}${m.name}`.toLowerCase(); +}; + +const parseMembers = (members, kind, contractName) => { + if (!members) { + return []; + } + + members = [members]; + + const validMembers = members.filter((m) => m.kind === kind); + return validMembers + .map((m) => { + const parserContext = tsdocParser.parseString(m.docComment); + const docComment = parserContext.docComment; + const featureNames = parseTWFeatureTag(docComment); + if (featureNames.length > 0) { + for (const feature of featureNames) { + const examples = parseExampleTag(docComment); + if (Object.keys(examples).length > 0) { + const example = { + name: m.name, + summary: Formatter.renderDocNode(docComment.summarySection), + remarks: docComment.remarksBlock + ? Formatter.renderDocNode(docComment.remarksBlock.content) + : null, + examples, + reference: { + javascript: extractReferenceLink(m, kind, contractName), + }, + }; + features[feature] = features[feature] + ? features[feature].concat(example) + : [example]; + } + } + } + }) + .filter((m) => !!m); +}; + +classes.forEach((m) => { + parseMembers(m, "Function", m.name); +}); + +fs.writeFileSync( + `${process.cwd()}/docs/feature_snippets.json`, + JSON.stringify(features, null, 2), +); diff --git a/packages/react/src/hooks/async/claim-conditions.ts b/packages/react/src/hooks/async/claim-conditions.ts index d760cca0869..d266f031261 100644 --- a/packages/react/src/hooks/async/claim-conditions.ts +++ b/packages/react/src/hooks/async/claim-conditions.ts @@ -60,7 +60,7 @@ export type SetClaimConditionsParams = { * @param contract - an instance of a contract that extends the ERC721 or ERC1155 spec and implements the `claimConditions` extension. * @param tokenId - the id of the token to fetch the claim conditions for (if the contract is an ERC1155 contract) * @returns a response object with the currently active claim condition - * + * @twfeature ERC721ClaimableWithConditions | ERC1155ClaimableWithConditions | ERC20ClaimableWithConditions * @beta */ export function useActiveClaimCondition( @@ -113,7 +113,7 @@ export function useActiveClaimCondition( * @param contract - an instance of a contract that extends the ERC721 or ERC1155 spec and implements the `claimConditions` extension. * @param tokenId - the id of the token to fetch the claim conditions for (if the contract is an ERC1155 contract) * @returns a response object with the list of claim conditions - * + * @twfeature ERC721ClaimableWithConditions | ERC1155ClaimableWithConditions | ERC20ClaimableWithConditions * @beta */ export function useClaimConditions( @@ -166,7 +166,7 @@ export function useClaimConditions( * @param eligibilityParams - the parameters for the eligibility check, see: {@link ClaimIneligibilityParams} * @param tokenId - the id of the token to fetch the claim conditions for (if the contract is an ERC1155 contract) * @returns a response object with the resons for the claim ineligibility - * + * @twfeature ERC721ClaimableWithConditions | ERC1155ClaimableWithConditions | ERC20ClaimableWithConditions * @beta */ export function useClaimIneligibilityReasons( @@ -257,6 +257,7 @@ export function useClaimIneligibilityReasons( * * @param contract - an instance of a {@link DropContract} * @returns a mutation object that can be used to set claim conditions + * @twfeature ERC721ClaimableWithConditions | ERC1155ClaimableWithConditions | ERC20ClaimableWithConditions * @beta */ export function useSetClaimConditions( @@ -327,6 +328,7 @@ export function useSetClaimConditions( * * @param contract - an instance of a {@link DropContract} * @returns a mutation object that can be used to reset claim conditions + * @twfeature ERC721ClaimableWithConditions | ERC1155ClaimableWithConditions | ERC20ClaimableWithConditions * @beta */ export function useResetClaimConditions( diff --git a/packages/react/src/hooks/async/contract-settings.ts b/packages/react/src/hooks/async/contract-settings.ts index d9b5dbd20ed..e56d4fd7d09 100644 --- a/packages/react/src/hooks/async/contract-settings.ts +++ b/packages/react/src/hooks/async/contract-settings.ts @@ -24,6 +24,7 @@ import invariant from "tiny-invariant"; * Use this to get the primary sales recipient of your {@link SmartContract} * @param contract - an instance of a {@link SmartContract} * @returns the wallet address of the primary sales recipient + * @twfeature PrimarySale * @beta */ export function usePrimarySaleRecipient( @@ -73,6 +74,7 @@ export function usePrimarySaleRecipient( * * @param contract - an instance of a {@link SmartContract} * @returns a mutation object that can be used to update the primary sales recipient + * @twfeature PrimarySale * @beta */ export function useUpdatePrimarySaleRecipient( @@ -115,6 +117,7 @@ export function useUpdatePrimarySaleRecipient( * * @param contract - an instance of a {@link SmartContract} * @returns an object containing recipient address and the royalty basis points + * @twfeature Royalty * @beta */ export function useRoyaltySettings( @@ -164,6 +167,7 @@ export function useRoyaltySettings( * * @param contract - an instance of a {@link SmartContract} * @returns a mutation object that can be used to update the royalty settings + * @twfeature Royalty * @beta */ export function useUpdateRoyaltySettings( @@ -209,6 +213,7 @@ export function useUpdateRoyaltySettings( * * @param contract - an instance of a {@link SmartContract} * @returns an object containing the platform fee basis points and the fee recipient address + * @twfeature PlatformFee * @beta */ export function usePlatformFees( @@ -257,6 +262,7 @@ export function usePlatformFees( * ``` * @param contract - an instance of a {@link SmartContract} * @returns a mutation object that can be used to update the platform fees settings + * @twfeature PlatformFee * @beta */ export function useUpdatePlatformFees( @@ -302,6 +308,7 @@ export function useUpdatePlatformFees( * * @param contract - an instance of a {@link SmartContract} * @returns a {@link CustomContractMetadata} object containing the metadata + * @twfeature ContractMetadata * @beta */ export function useMetadata(contract: RequiredParam) { @@ -347,6 +354,7 @@ export function useMetadata(contract: RequiredParam) { * ``` * @param contract - an instance of a {@link SmartContract} * @returns a mutation object that can be used to update the metadata + * @twfeature ContractMetadata * @beta */ export function useUpdateMetadata( diff --git a/packages/react/src/hooks/async/contracts.ts b/packages/react/src/hooks/async/contracts.ts index b5e1e3ed2da..17ef6ddffd5 100644 --- a/packages/react/src/hooks/async/contracts.ts +++ b/packages/react/src/hooks/async/contracts.ts @@ -226,6 +226,7 @@ export function useContract< * * @param contract - the {@link ValidContractInstance} instance of the contract to get the metadata for * @returns a response object that includes the contract metadata of the deployed contract + * @twfeature ContractMetadata * @beta */ export function useContractMetadata( diff --git a/packages/react/src/hooks/async/drop.ts b/packages/react/src/hooks/async/drop.ts index 2c0a93850ab..279f007fb9e 100644 --- a/packages/react/src/hooks/async/drop.ts +++ b/packages/react/src/hooks/async/drop.ts @@ -40,6 +40,7 @@ import invariant from "tiny-invariant"; * @param contract - an instance of a contract that extends the Erc721 spec (nft drop, custom contract that follows the Erc721 & drop spec) * @param queryParams - query params to pass to the query for the sake of pagination * @returns a response object that includes an array of NFTs that are unclaimed + * @twfeature ERC721LazyMintable | ERC1155LazyMintable * @beta */ export function useUnclaimedNFTs( @@ -75,6 +76,7 @@ export function useUnclaimedNFTs( * @param contract - an instance of a {@link DropContract} * @param queryParams - query params to pass to the query for the sake of pagination * @returns a response object that includes an array of NFTs that are claimed + * @twfeature ERC721LazyMintable | ERC1155LazyMintable * @beta */ export function useClaimedNFTs( @@ -83,10 +85,12 @@ export function useClaimedNFTs( ) { return useNFTs(contract, queryParams); } + /** * * @param contract - an instance of a {@link NFTDrop} * @returns a response object that includes the number of NFTs that are unclaimed + * @twfeature ERC721LazyMintable | ERC1155LazyMintable */ export function useUnclaimedNFTSupply(contract: RequiredParam) { const contractAddress = contract?.getAddress(); @@ -106,9 +110,11 @@ export function useUnclaimedNFTSupply(contract: RequiredParam) { } /** + * * @param contract - an instance of a {@link DropContract} * @returns a response object that includes the number of NFTs that are claimed + * @twfeature ERC721LazyMintable | ERC1155LazyMintable */ export function useClaimedNFTSupply(contract: RequiredParam) { const contractAddress = contract?.getAddress(); @@ -131,6 +137,7 @@ export function useClaimedNFTSupply(contract: RequiredParam) { * * @param contract - an instance of a {@link RevealableContract} * @returns a response object that gets the batches to still be revealed + * @twfeature ERC721Revealable | ERC1155Revealable */ export function useBatchesToReveal( contract: RequiredParam, @@ -185,6 +192,7 @@ export function useBatchesToReveal( * * @param contract - an instance of a {@link DropContract} * @returns a mutation object that can be used to claim a NFT to the wallet specificed in the params + * @twfeature ERC721Claimable | ERC1155Claimable * @beta */ export function useClaimNFT( @@ -236,6 +244,7 @@ export function useClaimNFT( * @param contract - an instance of a {@link NFTContract} with the drop extension * @param onProgress - an optional callback that will be called with the progress of the upload * @returns a mutation object that can be used to lazy mint a batch of NFTs + * @twfeature ERC721LazyMintable | ERC1155LazyMintable * @beta */ export function useLazyMint( @@ -282,6 +291,7 @@ export function useLazyMint( * @param contract - an instance of a {@link DropContract} * @param onProgress - an optional callback that will be called with the progress of the upload * @returns a mutation object that can be used to lazy mint a batch of NFTs + * @twfeature ERC721Revealable | ERC1155Revealable * @beta */ export function useDelayedRevealLazyMint( @@ -336,6 +346,7 @@ export function useDelayedRevealLazyMint( * * @param contract - an instance of a {@link RevealableContract} * @returns a mutation object that can be used to reveal a batch of delayed reveal NFTs + * @twfeature ERC721Revealable | ERC1155Revealable * @beta */ export function useRevealLazyMint( diff --git a/packages/react/src/hooks/async/nft.ts b/packages/react/src/hooks/async/nft.ts index 2403429f362..a55e40c2802 100644 --- a/packages/react/src/hooks/async/nft.ts +++ b/packages/react/src/hooks/async/nft.ts @@ -75,6 +75,7 @@ export function convertResponseToNFTTypeArray( * @param tokenId - the tokenId to look up * @returns a response object that includes the metadata for the given tokenId * @beta + * @twfeature ERC721 | ERC1155 */ export function useNFT( contract: RequiredParam, @@ -122,6 +123,7 @@ export function useNFT( * @param contract - an instance of a {@link NFTContract} * @param queryParams - query params to pass to the query for the sake of pagination * @returns a response object that includes an array of NFTs + * @twfeature ERC721Supply | ERC1155Enumerable * @beta */ export function useNFTs( @@ -170,6 +172,7 @@ export function useNFTs( * @param contract - an instance of a {@link NFTContract} * @returns a response object that includes the total count of NFTs * @beta + * @twfeature ERC721Supply | ERC1155Enumerable */ export function useTotalCount( contract: RequiredParam, @@ -216,6 +219,7 @@ export function useTotalCount( * @param contract - an instance of a {@link NFTContract} * @returns a response object that incudes the total minted supply * @beta + * @twfeature ERC721Supply | ERC1155Enumerable */ export function useTotalCirculatingSupply( contract: RequiredParam, @@ -264,6 +268,7 @@ export function useTotalCirculatingSupply( * @param ownerWalletAddress - the wallet adress to get owned tokens for * @returns a response object that includes the list of owned tokens * @beta + * @twfeature ERC721Enumerable | ERC1155Enumerable */ export function useOwnedNFTs( contract: RequiredParam, @@ -308,6 +313,7 @@ export function useOwnedNFTs( * @param contract - an instance of a {@link NFTContract} * @param ownerWalletAddress - the wallet adress to check the balance of * @returns a response object that includes the total balance of the owner + * @twfeature ERC721 | ERC1155 * @beta */ export function useNFTBalance( @@ -409,6 +415,7 @@ export function useNFTBalance( * @param contract - an instance of a {@link NFTContract} * @returns a mutation object that can be used to mint a new NFT token to the connected wallet * @beta + * @twfeature ERC721Mintable | ERC1155Mintable */ export function useMintNFT( contract: RequiredParam, @@ -480,6 +487,7 @@ export function useMintNFT( * @param contract - an instance of a {@link Erc1155} * @returns a mutation object that can be used to mint a more supply of a token id to the provided wallet * @beta + * @twfeature ERC1155Mintable */ export function useMintNFTSupply(contract: Erc1155) { const activeChainId = useActiveChainId(); @@ -542,6 +550,7 @@ export function useMintNFTSupply(contract: Erc1155) { * @param contract - an instance of a {@link NFTContract} * @returns a mutation object that can be used to transfer NFTs * @beta + * @twfeature ERC721 | ERC1155 */ export function useTransferNFT( contract: RequiredParam, @@ -636,6 +645,7 @@ export function useTransferNFT( * * @param contract - an instance of a {@link Erc1155} * @returns a mutation object that can be used to transfer batch NFTs + * @twfeature ERC1155 * @beta */ export function useAirdropNFT(contract: Erc1155) { @@ -718,6 +728,7 @@ export function useAirdropNFT(contract: Erc1155) { * * @param contract - an instance of a {@link NFTContract} * @returns a mutation object that can be used to burn an NFT token from the connected wallet + * @twfeature ERC721Burnable | ERC1155Burnable * @beta */ export function useBurnNFT( diff --git a/packages/react/src/hooks/async/roles.ts b/packages/react/src/hooks/async/roles.ts index 202169574db..57109fa58c1 100644 --- a/packages/react/src/hooks/async/roles.ts +++ b/packages/react/src/hooks/async/roles.ts @@ -50,6 +50,7 @@ type GetAllReturnType = Promise< * * @param contract - an instance of a {@link SmartContract} * @returns a list of addresses for all supported roles on the contract. + * @twfeature PermissionsEnumerable * @beta */ export function useAllRoleMembers( @@ -81,6 +82,7 @@ export function useAllRoleMembers( * @param contract - an instance of a {@link SmartContract} * @param role - the role to get the members of, see {@link Role} * @returns a list of addresses that are members of the role + * @twfeature PermissionsEnumerable * @beta */ export function useRoleMembers( @@ -113,6 +115,7 @@ export function useRoleMembers( * @param role - the role to check the member against, see {@link Role} * @param walletAddress - the address to check * @returns true if the address is a member of the role, or false if not + * @twfeature Permissions * @beta */ export function useIsAddressRole( @@ -174,6 +177,7 @@ export function useIsAddressRole( * * @param contract - an instance of a {@link SmartContract} * @returns a mutation object that can be used to overwrite all roles on the contract + * @twfeature PermissionsEnumerable * @beta */ export function useSetAllRoleMembers( @@ -233,6 +237,7 @@ export function useSetAllRoleMembers( * * @param contract - an instance of a {@link SmartContract} * @returns a mutation object that can be used to grant a member of a role on the contract + * @twfeature Permissions * @beta */ export function useGrantRole( @@ -291,6 +296,7 @@ export function useGrantRole( * * @param contract - an instance of a {@link SmartContract} * @returns a mutation object that can be used to revoke a role from a member on the contract + * @twfeature Permissions * @beta */ export function useRevokeRole( diff --git a/packages/react/src/hooks/async/token.ts b/packages/react/src/hooks/async/token.ts index e37a68bb6a8..2a7bcf5e98f 100644 --- a/packages/react/src/hooks/async/token.ts +++ b/packages/react/src/hooks/async/token.ts @@ -29,6 +29,7 @@ import invariant from "tiny-invariant"; * * @param contract - an instance of a ERC20 contract. * @returns a response object that incudes the total minted supply + * @twfeature ERC20 * @beta */ export function useTokenSupply(contract: RequiredParam) { @@ -55,6 +56,7 @@ export function useTokenSupply(contract: RequiredParam) { * * @param contract - an instance of a ERC20 contract. * @returns a response object that includes the balance of the address + * @twfeature ERC20 * @beta */ export function useTokenBalance( @@ -85,6 +87,7 @@ export function useTokenBalance( * * @param contract - an instance of an ERC20 contract. * @returns a response object that includes the decimals of the ERC20 token + * @twfeature ERC20 * @beta */ export function useTokenDecimals(contract: RequiredParam) { @@ -134,6 +137,7 @@ export function useTokenDecimals(contract: RequiredParam) { * * @param contract - an instance of a contract that extends the ERC20 spec (token, token drop, custom contract that follows the ERC20 spec) * @returns a mutation object that can be used to mint new tokens to the connected wallet + * @twfeature ERC20Mintable * @beta */ export function useMintToken(contract: RequiredParam) { @@ -187,6 +191,7 @@ export function useMintToken(contract: RequiredParam) { * * @param contract - an instance of a {@link Erc20} * @returns a mutation object that can be used to tokens to the wallet specificed in the params + * @twfeature ERC20ClaimableWithConditions * @beta */ export function useClaimToken( @@ -246,6 +251,7 @@ export function useClaimToken( * * @param contract - an instance of a contract that extends the ERC20 spec (token, token drop, custom contract that follows the ERC20 spec) * @returns a mutation object that can be used to transfer tokens + * @twfeature ERC20 * @beta */ export function useTransferToken(contract: RequiredParam) { @@ -299,6 +305,7 @@ export function useTransferToken(contract: RequiredParam) { * * @param contract - an instance of a contract that extends the ERC20 spec (token, token drop, custom contract that follows the ERC20 spec) * @returns a mutation object that can be used to transfer batch tokens + * @twfeature ERC20 * @beta */ export function useTransferBatchToken(contract: RequiredParam) { @@ -359,6 +366,7 @@ export function useTransferBatchToken(contract: RequiredParam) { * * @param contract - an instance of a contract that extends the ERC20 spec (token, token drop, custom contract that follows the ERC20 spec) * @returns a mutation object that can be used to burn tokens from the connected wallet + * @twfeature ERC20Burnable * @beta */ export function useBurnToken(contract: RequiredParam) { diff --git a/packages/react/src/hooks/contracts/useEdition.ts b/packages/react/src/hooks/contracts/useEdition.ts index d7b343df5f2..c305c6b0fd7 100644 --- a/packages/react/src/hooks/contracts/useEdition.ts +++ b/packages/react/src/hooks/contracts/useEdition.ts @@ -25,7 +25,7 @@ import { EditionImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts/p * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useEdition(contractAddress?: string) { showDeprecationWarning("useEdition()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useEditionDrop.ts b/packages/react/src/hooks/contracts/useEditionDrop.ts index cac4648a223..3b0204781c4 100644 --- a/packages/react/src/hooks/contracts/useEditionDrop.ts +++ b/packages/react/src/hooks/contracts/useEditionDrop.ts @@ -24,7 +24,7 @@ import { EditionDropImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contrac * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useEditionDrop(contractAddress?: string) { showDeprecationWarning("useEditionDrop()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useMarketplace.ts b/packages/react/src/hooks/contracts/useMarketplace.ts index 13c407cae7c..df7957d4a50 100644 --- a/packages/react/src/hooks/contracts/useMarketplace.ts +++ b/packages/react/src/hooks/contracts/useMarketplace.ts @@ -25,7 +25,7 @@ import { MarketplaceImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contrac * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useMarketplace(contractAddress?: string) { showDeprecationWarning("useMarketplace()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useMultiwrap.ts b/packages/react/src/hooks/contracts/useMultiwrap.ts index e30eed3eef0..1de54389003 100644 --- a/packages/react/src/hooks/contracts/useMultiwrap.ts +++ b/packages/react/src/hooks/contracts/useMultiwrap.ts @@ -24,7 +24,7 @@ import { MultiwrapImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useMultiwrap(contractAddress?: string) { showDeprecationWarning("useMultiwrap()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useNFTCollection.ts b/packages/react/src/hooks/contracts/useNFTCollection.ts index 1119712bad5..cb2ef0732ed 100644 --- a/packages/react/src/hooks/contracts/useNFTCollection.ts +++ b/packages/react/src/hooks/contracts/useNFTCollection.ts @@ -25,7 +25,7 @@ import { NFTCollectionImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contr * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useNFTCollection(contractAddress?: string) { showDeprecationWarning("useNFTCollection()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useNFTDrop.ts b/packages/react/src/hooks/contracts/useNFTDrop.ts index a4197b49fca..27185123b9d 100644 --- a/packages/react/src/hooks/contracts/useNFTDrop.ts +++ b/packages/react/src/hooks/contracts/useNFTDrop.ts @@ -24,7 +24,7 @@ import { NFTDropImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts/p * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useNFTDrop(contractAddress?: string) { showDeprecationWarning("useNFTDrop()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/usePack.ts b/packages/react/src/hooks/contracts/usePack.ts index 99bc370eef0..5aabc84e11d 100644 --- a/packages/react/src/hooks/contracts/usePack.ts +++ b/packages/react/src/hooks/contracts/usePack.ts @@ -25,7 +25,7 @@ import { PackImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts/preb * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function usePack(contractAddress?: string) { showDeprecationWarning("usePack()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useSignatureDrop.ts b/packages/react/src/hooks/contracts/useSignatureDrop.ts index 85f850f52b6..5cbeed66050 100644 --- a/packages/react/src/hooks/contracts/useSignatureDrop.ts +++ b/packages/react/src/hooks/contracts/useSignatureDrop.ts @@ -24,7 +24,7 @@ import { SignatureDropImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contr * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useSignatureDrop(contractAddress?: string) { showDeprecationWarning("useSignatureDrop()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useSplit.ts b/packages/react/src/hooks/contracts/useSplit.ts index c60195c3a3a..31f31fb75a1 100644 --- a/packages/react/src/hooks/contracts/useSplit.ts +++ b/packages/react/src/hooks/contracts/useSplit.ts @@ -25,7 +25,7 @@ import { SplitImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts/pre * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useSplit(contractAddress?: string) { showDeprecationWarning("useSplit()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useToken.ts b/packages/react/src/hooks/contracts/useToken.ts index 7f7354f3e2e..68ef48ebd7d 100644 --- a/packages/react/src/hooks/contracts/useToken.ts +++ b/packages/react/src/hooks/contracts/useToken.ts @@ -25,7 +25,7 @@ import { TokenImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts/pre * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useToken(contractAddress?: string) { showDeprecationWarning("useToken()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useTokenDrop.ts b/packages/react/src/hooks/contracts/useTokenDrop.ts index 62adb0115fb..a098c040a75 100644 --- a/packages/react/src/hooks/contracts/useTokenDrop.ts +++ b/packages/react/src/hooks/contracts/useTokenDrop.ts @@ -25,7 +25,7 @@ import { TokenDropImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useTokenDrop(contractAddress?: string) { showDeprecationWarning("useTokenDrop()", "useContract()"); diff --git a/packages/react/src/hooks/contracts/useVote.ts b/packages/react/src/hooks/contracts/useVote.ts index 4118bd68ba1..dfa836c048a 100644 --- a/packages/react/src/hooks/contracts/useVote.ts +++ b/packages/react/src/hooks/contracts/useVote.ts @@ -25,7 +25,7 @@ import { VoteImpl } from "@thirdweb-dev/sdk/dist/declarations/src/contracts/preb * } * ``` * @public - * @depreated use `useContract()` instead + * @deprecated use `useContract()` instead */ export function useVote(contractAddress?: string) { showDeprecationWarning("useVote()", "useContract()"); diff --git a/packages/react/tsdoc.json b/packages/react/tsdoc.json new file mode 100644 index 00000000000..3fdba5664d7 --- /dev/null +++ b/packages/react/tsdoc.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "extends": ["@microsoft/api-extractor/extends/tsdoc-base.json"], + "tagDefinitions": [ + { + "tagName": "@twfeature", + "syntaxKind": "block" + } + ], + "supportForTags": { + "@twfeature": true + } +}