Socket
Socket
Sign inDemoInstall

@lens-protocol/react

Package Overview
Dependencies
473
Maintainers
9
Versions
93
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-alpha.35 to 2.0.0-alpha.36

dist/declarations/src/transactions/publications/IUploader.d.ts

46

dist/declarations/src/helpers/tasks.d.ts
import { IEquatableError, PromiseResult } from '@lens-protocol/shared-kernel';
/**
* An deferrable task is a function that can be executed multiple times and that can be in a pending state.
*
* @internal
*/
export type DeferrableTask<TData, TError extends IEquatableError = never, TInput = void> = (input: TInput) => PromiseResult<TData, TError>;
export type DeferrableTask<TValue, TError extends IEquatableError = never, TInput = void> = (input: TInput) => PromiseResult<TValue, TError>;
/**

@@ -10,3 +12,3 @@ * The initial state of a deferred task.

export type DeferredTaskIdle = {
called: false;
called: boolean;
loading: false;

@@ -17,21 +19,11 @@ data: undefined;

/**
* The state of a deferred task during the first call.
* The state of a deferred task during the loading.
*/
export type DeferredTaskFirstCall = {
export type DeferredTaskLoading<TData> = {
called: true;
loading: true;
data: undefined;
data: TData | undefined;
error: undefined;
};
/**
* The state of a deferred task during the n-th call
* with data from the previous successful call.
*/
export type DeferredTaskNthCall<TData> = {
called: true;
loading: true;
data: TData;
error: undefined;
};
/**
* The state of a deferred task after a successful call.

@@ -55,15 +47,21 @@ */

/**
* @deprecated Use DeferredTaskLoading instead. Removal slated for v2.0.0.
*/
export type DeferredTaskFirstCall = DeferredTaskLoading<unknown>;
/**
* @deprecated Use DeferredTaskLoading instead. Removal slated for v2.0.0.
*/
export type DeferredTaskNthCall<TData> = DeferredTaskLoading<TData>;
/**
* The possible statuses of a deferred task.
*/
export type DeferredTaskState<TData, TError extends IEquatableError> = DeferredTaskIdle | DeferredTaskFirstCall | DeferredTaskNthCall<TData> | DeferredTaskSuccess<TData> | DeferredTaskFailed<TError>;
export type DeferredTaskState<TData, TError extends IEquatableError> = DeferredTaskIdle | DeferredTaskLoading<TData> | DeferredTaskSuccess<TData> | DeferredTaskFailed<TError>;
/**
* An deferred task React Hook is a tiny wrapper around an asynchronous function
* that provides a way to determine when the task is running and also provide access
* the last error that occurred during the execution of the task.
* A deferred task React Hook is a lightweight wrapper for an asynchronous function.
* It allows tracking of the task's execution status and provides access to the
* last error that occurred during the task's execution, if any.
*
* It provides a type-safe way to consume the state of the task.
* ```ts
* const { called, loading, data, error, execute }: UseDeferredTask<TData, TError, TInput> = useAnyDeferredTask();
*
*
* if (!called) {

@@ -88,8 +86,10 @@ * // data === undefined

*
* // called === true
* // data === TData
* // error === undefined
* return <p>Task completed: {data}</p>;
* ```
*/
export type UseDeferredTask<TData = void, TError extends IEquatableError = never, TInput = void> = DeferredTaskState<TData, TError> & {
execute: DeferrableTask<TData, TError, TInput>;
export type UseDeferredTask<TData = void, TError extends IEquatableError = never, TInput = void, TResultValue = TData> = DeferredTaskState<TData, TError> & {
execute: DeferrableTask<TResultValue, TError, TInput>;
};

@@ -96,0 +96,0 @@ /**

@@ -31,3 +31,3 @@ import { UnspecifiedError } from '@lens-protocol/api-bindings';

* ```ts
* const { called, error, loading, execute } = useValidateHandle();
* const { called, error, loading, execute } = useValidateHandle();
* ```

@@ -34,0 +34,0 @@ *

@@ -23,3 +23,3 @@ /**

*/
export { isPostPublication, isCommentPublication, isMirrorPublication, isQuotePublication, isPrimaryPublication, findCollectModuleSettings, isCollectModuleSettings, resolveReferencePolicy, } from '@lens-protocol/api-bindings';
export type { CollectModuleSettings, ReferenceModule, ReferencePolicy, FollowersOnlyReferencePolicy, DegreesOfSeparationReferencePolicy, NoReferencePolicy, AnyoneReferencePolicy, UnknownReferencePolicy, } from '@lens-protocol/api-bindings';
export { findCollectModuleSettings, isCollectModuleSettings, isCommentPublication, isMirrorPublication, isMultirecipientCollectFee, isPostPublication, isPrimaryPublication, isQuotePublication, resolveCollectPolicy, resolveReferencePolicy, } from '@lens-protocol/api-bindings';
export type { AnyoneReferencePolicy, CollectModuleSettings, CollectPolicy, DegreesOfSeparationReferencePolicy, FollowersOnlyReferencePolicy, NoReferencePolicy, ReferenceModule, ReferencePolicy, UnknownReferencePolicy, } from '@lens-protocol/api-bindings';

@@ -5,1 +5,3 @@ export * from "./useCreateComment.js";

export * from "./useCreateQuote.js";
export * from "./useOptimisticCreatePost.js";
export * from "./IUploader.js";

@@ -9,2 +9,3 @@ /**

export * from "./useProfilesManaged.js";
export type { ClaimableProfilesResult, HandleInfo } from '@lens-protocol/api-bindings';
export * from "./useRateLimits.js";
export type { ClaimableProfilesResult, HandleInfo, UserCurrentRateLimit, UserCurrentRateLimitResult, } from '@lens-protocol/api-bindings';
{
"name": "@lens-protocol/react",
"version": "2.0.0-alpha.35",
"version": "2.0.0-alpha.36",
"description": "Interacting with the Lens Protocol API using React.",

@@ -55,7 +55,7 @@ "main": "dist/lens-protocol-react.cjs.js",

"zod": "^3.22.4",
"@lens-protocol/blockchain-bindings": "0.10.0-alpha.25",
"@lens-protocol/domain": "0.11.0-alpha.24",
"@lens-protocol/api-bindings": "0.11.0-alpha.31",
"@lens-protocol/storage": "0.8.0-alpha.10",
"@lens-protocol/shared-kernel": "0.11.0-alpha.11"
"@lens-protocol/api-bindings": "0.11.0-alpha.32",
"@lens-protocol/blockchain-bindings": "0.10.0-alpha.26",
"@lens-protocol/domain": "0.11.0-alpha.25",
"@lens-protocol/shared-kernel": "0.11.0-alpha.12",
"@lens-protocol/storage": "0.8.0-alpha.11"
},

@@ -71,2 +71,3 @@ "devDependencies": {

"@faker-js/faker": "^7.6.0",
"@lens-protocol/metadata": "^1.0.6",
"@testing-library/react": "^13.4.0",

@@ -98,2 +99,3 @@ "@types/jest": "^29.5.10",

"peerDependencies": {
"@lens-protocol/metadata": "^1.0.0",
"@types/react": "^18.0.0",

@@ -103,2 +105,5 @@ "react": "^18.2.0"

"peerDependenciesMeta": {
"@lens-protocol/metadata": {
"optional": true
},
"@types/react": {

@@ -105,0 +110,0 @@ "optional": true

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc