Skip to content

Commit

Permalink
chore: react - export missing types (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysu authored Mar 25, 2024
1 parent 95f361c commit 4183f68
Show file tree
Hide file tree
Showing 25 changed files with 129 additions and 57 deletions.
10 changes: 10 additions & 0 deletions .changeset/three-books-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@lens-protocol/blockchain-bindings": patch
"@lens-protocol/api-bindings": patch
"@lens-protocol/client": patch
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**chore:** exported missing gql types
2 changes: 1 addition & 1 deletion packages/api-bindings/src/lens/ReferenceModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export type ReferencePolicy =
* }
* ```
*
* @param args - The {@link AnyPublication} to resolve {@link ReferencePolicy} from
* @param publication - The {@link AnyPublication} to resolve {@link ReferencePolicy} from
* @returns {@link ReferencePolicy}
*/
export function resolveReferencePolicy(publication: AnyPublication): ReferencePolicy {
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain-bindings/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function encodeData(abi: ModuleParam[], data: ModuleData): Data {
* );
* ```
*/
export function decodeData(abi: ModuleParam[], encoded: string): ModuleData {
export function decodeData(abi: ModuleParam[], calldata: string): ModuleData {
const types = abi.map((param) => {
return ParamType.fromObject({
name: param.name,
Expand All @@ -85,5 +85,5 @@ export function decodeData(abi: ModuleParam[], encoded: string): ModuleData {
});
});

return defaultAbiCoder.decode(types, encoded) as ModuleData;
return defaultAbiCoder.decode(types, calldata) as ModuleData;
}
1 change: 1 addition & 0 deletions packages/client/src/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ export {
LensTransactionFailureType,
LensTransactionStatusType,
LimitType,
ManagedProfileVisibility,
MarketplaceMetadataAttributeDisplayType,
ModuleType,
MomokaValidatorError,
Expand Down
12 changes: 11 additions & 1 deletion packages/react/src/discovery/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ export * from './useRecommendedProfiles';
export * from './useSearchProfiles';
export * from './useSearchPublications';

export type { FeedItem, FeedHighlight, ExplorePublication } from '@lens-protocol/api-bindings';
export type {
ExploreProfilesWhere,
ExplorePublication,
ExplorePublicationsWhere,
FeedHighlight,
FeedHighlightsWhere,
FeedItem,
FeedWhere,
ProfileSearchWhere,
PublicationSearchWhere,
} from '@lens-protocol/api-bindings';
4 changes: 2 additions & 2 deletions packages/react/src/discovery/useFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { FeedItem, FeedRequest, useFeed as useBaseFeedQuery } from '@lens-protoc

import { SessionType, useSession } from '../authentication';
import { useLensApolloClient } from '../helpers/arguments';
import { OmitCursor, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads';
import { PaginatedArgs, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads';
import { useFragmentVariables } from '../helpers/variables';

export type UseFeedArgs = OmitCursor<FeedRequest>;
export type UseFeedArgs = PaginatedArgs<FeedRequest>;

/**
* Fetch a the feed of a given profile and filters.
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/discovery/useFeedHighlights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {

import { SessionType, useSession } from '../authentication';
import { useLensApolloClient } from '../helpers/arguments';
import { OmitCursor, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads';
import { PaginatedArgs, PaginatedReadResult, usePaginatedReadResult } from '../helpers/reads';
import { useFragmentVariables } from '../helpers/variables';

export type UseFeedHighlightsArgs = OmitCursor<FeedHighlightsRequest>;
export type UseFeedHighlightsArgs = PaginatedArgs<FeedHighlightsRequest>;

/**
* Fetch a the highlights of a feed for given profile and filters.
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/discovery/useSearchProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export type UseSearchProfilesArgs = PaginatedArgs<ProfileSearchRequest>;
*
* @category Discovery
* @group Hooks
* @param args - {@link UseSearchProfilesArgs}
*
* @example
* ```tsx
Expand Down
19 changes: 18 additions & 1 deletion packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export type {
CryptoAsset,
CryptoNativeAmount,
CryptoNativeAsset,
Data,
Erc20,
Erc20Amount,
Erc20Info,
Expand Down Expand Up @@ -83,27 +84,39 @@ export * from './helpers/tasks';
/**
* GQL common types
*/
export type { App, OptimisticStatusResult } from '@lens-protocol/api-bindings';
export type {
App,
ImageSizeTransform,
ImageTransform,
NetworkAddress,
OptimisticStatusResult,
} from '@lens-protocol/api-bindings';

// GQL enums
export {
CollectOpenActionModuleType,
CommentRankingFilterType,
ComparisonOperatorConditionType,
CustomFiltersType,
DecryptFailReasonType,
ExploreProfilesOrderByType,
ExplorePublicationsOrderByType,
ExplorePublicationType,
FeedEventItemType,
FollowModuleType,
HiddenCommentsType,
LimitType,
ManagedProfileVisibility,
MarketplaceMetadataAttributeDisplayType,
MetadataAttributeType,
ModuleType,
NftContractType,
NotificationType,
OpenActionCategoryType,
OpenActionModuleType,
ProfileActionHistoryType,
ProfileInterestTypes,
ProfilesOrderBy,
PublicationContentWarningType,
PublicationMetadataLicenseType,
PublicationMetadataMainFocusType,
Expand All @@ -124,14 +137,18 @@ export {
TransactionError,
UserRejectedError,
WalletConnectionError,
TransactionErrorReason,
WalletConnectionErrorReason,
} from '@lens-protocol/domain/entities';
export {
BroadcastingError,
BroadcastingErrorReason,
} from '@lens-protocol/domain/use-cases/transactions';
export { ClaimHandleError } from '@lens-protocol/domain/use-cases/profile';
export {
InsufficientAllowanceError,
InsufficientFundsError,
WalletAlreadyInvitedError,
} from '@lens-protocol/domain/use-cases/wallets';
export { InvariantError } from '@lens-protocol/shared-kernel';
export { NotFoundError } from './NotFoundError';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/misc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export * from './useResolveAddress';
export * from './useValidateHandle';
export * from './useWasWalletInvited';

export type { InvitedResult } from '@lens-protocol/api-bindings';
export type { InvitedResult, ModuleMetadata } from '@lens-protocol/api-bindings';
6 changes: 6 additions & 0 deletions packages/react/src/notifications/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ export type {
FollowNotification,
MentionNotification,
MirrorNotification,
NotificationWhere,
OpenActionProfileActed,
ProfileMirrorResult,
ProfileReactedResult,
QuoteNotification,
ReactedResult,
ReactionEvent,
ReactionNotification,
} from '@lens-protocol/api-bindings';
1 change: 0 additions & 1 deletion packages/react/src/profile/useRecommendProfileToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export type UseRecommendProfileToggleArgs = {
*
* @category Profiles
* @group Hooks
* @param args - {@link UseRecommendProfileToggleArgs}
*/
export function useRecommendProfileToggle(): UseDeferredTask<
void,
Expand Down
49 changes: 49 additions & 0 deletions packages/react/src/publication/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,80 @@ export * from './useWhoReactedToPublication';
*/
export type {
AnyPublication,
ArticleMetadataV3,
Audio,
AudioMetadataV3,
CheckingInMetadataV3,
Comment,
DegreesOfSeparationReferenceModuleSettings,
EmbedMetadataV3,
EncryptableAudio,
EncryptableAudioSet,
EncryptableImage,
EncryptableImageSet,
EncryptableVideo,
EncryptableVideoSet,
EventMetadataV3,
FollowOnlyReferenceModuleSettings,
GeoLocation,
Image,
ImageMetadataV3,
ImageSet,
LegacyAaveFeeCollectModuleSettings,
LegacyDegreesOfSeparationReferenceModuleSettings,
LegacyErc4626FeeCollectModuleSettings,
LegacyFeeCollectModuleSettings,
LegacyFollowOnlyReferenceModuleSettings,
LegacyFreeCollectModuleSettings,
LegacyLimitedFeeCollectModuleSettings,
LegacyLimitedTimedFeeCollectModuleSettings,
LegacyMultirecipientFeeCollectModuleSettings,
LegacyRevertCollectModuleSettings,
LegacySimpleCollectModuleSettings,
LegacyTimedFeeCollectModuleSettings,
LinkMetadataV3,
LiveStreamMetadataV3,
MarketplaceMetadata,
MintMetadataV3,
Mirror,
MomokaInfo,
MultirecipientFeeCollectOpenActionSettings,
OpenActionFilter,
Post,
PrimaryPublication,
ProfileCoverSet,
ProfileMentioned,
ProfileWhoReactedResult,
PublicationBookmarksWhere,
PublicationCommentOn,
PublicationCommentOnRanking,
PublicationMarketplaceMetadataAttribute,
PublicationMetadata,
PublicationMetadataContentWarningFilter,
PublicationMetadataFilters,
PublicationMetadataLitEncryption,
PublicationMetadataMedia,
PublicationMetadataMediaAudio,
PublicationMetadataMediaImage,
PublicationMetadataMediaVideo,
PublicationMetadataTagsFilter,
PublicationOperations,
PublicationStats,
PublicationsWhere,
Quote,
SimpleCollectOpenActionSettings,
SpaceMetadataV3,
StoryMetadataV3,
TextOnlyMetadataV3,
ThreeDMetadataV3,
ThreeDMetadataV3Asset,
TransactionMetadataV3,
UnknownOpenActionModuleSettings,
UnknownReferenceModuleSettings,
Video,
VideoMetadataV3,
WhoActedOnPublicationWhere,
WhoReactedPublicationWhere,
} from '@lens-protocol/api-bindings';

/**
Expand All @@ -65,10 +112,12 @@ export {
} from '@lens-protocol/api-bindings';
export type {
AnyoneReferencePolicy,
CollectFee,
CollectModuleSettings,
CollectPolicy,
DegreesOfSeparationReferencePolicy,
FollowersOnlyReferencePolicy,
MultirecipientCollectFee,
NoReferencePolicy,
ReferenceModule,
ReferencePolicy,
Expand Down
3 changes: 0 additions & 3 deletions packages/react/src/publication/useBookmarkToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export type UseBookmarkToggleArgs = {
publication: AnyPublication;
};

export type BookmarkOperation = UseDeferredTask<void, never, UseBookmarkToggleArgs>;

/**
* `useBookmarkToggle` hook lets the user save or remove a publication from their bookmarks.
*
Expand All @@ -21,7 +19,6 @@ export type BookmarkOperation = UseDeferredTask<void, never, UseBookmarkToggleAr
*
* @category Publications
* @group Hooks
* @param args - {@link UseBookmarkToggleArgs}
*
* @example
* ```tsx
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/publication/useHideCommentToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export type UseHideCommentToggleArgs = {
*
* @category Publications
* @group Hooks
* @param args - {@link UseHideCommentToggleArgs}
*/
export function useHideCommentToggle(): UseDeferredTask<void, never, UseHideCommentToggleArgs> {
const { data: session } = useSession();
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/publication/useHidePublication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export type UseHidePublicationArgs = {
*
* @category Publications
* @group Hooks
* @param args - {@link UseHidePublicationArgs}
*/
export function useHidePublication(): UseDeferredTask<void, never, UseHidePublicationArgs> {
const { data: session } = useSession();
Expand Down
4 changes: 1 addition & 3 deletions packages/react/src/publication/useNotInterestedToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export type UseNotInterestedToggleArgs = {
publication: AnyPublication;
};

export type NotInterestedOperation = UseDeferredTask<void, never, UseNotInterestedToggleArgs>;

/**
* `useNotInterestedToggle` hook let's the active profile toggle the not interested status of a publication.
*
Expand All @@ -37,7 +35,7 @@ export type NotInterestedOperation = UseDeferredTask<void, never, UseNotInterest
* @category Publications
* @group Hooks
*/
export function useNotInterestedToggle(): NotInterestedOperation {
export function useNotInterestedToggle(): UseDeferredTask<void, never, UseNotInterestedToggleArgs> {
const { data: session } = useSession();
const { add, remove } = useNotInterestedController();

Expand Down
27 changes: 12 additions & 15 deletions packages/react/src/transactions/useBlockProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,13 @@ export type BlockProfileArgs = {
sponsored?: boolean;
};

export type BlockOperation = UseDeferredTask<
AsyncTransactionResult<void>,
| BroadcastingError
| InsufficientAllowanceError
| InsufficientFundsError
| InsufficientGasError
| PendingSigningRequestError
| TransactionError
| UserRejectedError
| WalletConnectionError,
BlockProfileArgs
>;

/**
* Block one or many profiles.
*
* You MUST be authenticated via {@link useLogin} to use this hook.
*
* @category Profiles
* @group Hooks
* @param args - {@link BlockProfileArgs}
*
* @example
* ```ts
Expand Down Expand Up @@ -246,7 +232,18 @@ export type BlockOperation = UseDeferredTask<
* whitelisted one (e.g. localhost).
*
*/
export function useBlockProfiles(): BlockOperation {
export function useBlockProfiles(): UseDeferredTask<
AsyncTransactionResult<void>,
| BroadcastingError
| InsufficientAllowanceError
| InsufficientFundsError
| InsufficientGasError
| PendingSigningRequestError
| TransactionError
| UserRejectedError
| WalletConnectionError,
BlockProfileArgs
> {
const { data: session } = useSession();
const blockProfile = useBlockProfilesController();
const configureRequest = useSponsoredConfig();
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/transactions/useLinkHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export type LinkHandleArgs = {
*
* @category Profiles
* @group Hooks
* @param args - {@link LinkHandleArgs}
*
* @example
* ```tsx
Expand Down
Loading

0 comments on commit 4183f68

Please sign in to comment.