From 2fe376915f3a3733c06bb6e61e075e8add9b15fe Mon Sep 17 00:00:00 2001 From: Cesare Naldi Date: Wed, 4 Dec 2024 10:34:38 +0100 Subject: [PATCH] fix: missing use of new config --- packages/client/src/clients.ts | 38 ++-------------------------------- packages/client/src/config.ts | 2 +- packages/client/src/index.ts | 1 + packages/types/src/misc.ts | 11 ++++++++++ 4 files changed, 15 insertions(+), 37 deletions(-) diff --git a/packages/client/src/clients.ts b/packages/client/src/clients.ts index 146d6b910..152dd7e33 100644 --- a/packages/client/src/clients.ts +++ b/packages/client/src/clients.ts @@ -31,6 +31,7 @@ import { type Logger, getLogger } from 'loglevel'; import { type AuthenticatedUser, authenticatedUser } from './AuthenticatedUser'; import { transactionStatus } from './actions'; +import type { ClientConfig } from './config'; import { configureContext } from './context'; import { AuthenticationError, @@ -53,41 +54,6 @@ function takeValue({ return data.value; } -/** - * The options to configure the client. - */ -export type ClientOptions = { - /** - * The environment configuration to use (e.g. `mainnet`, `testnet`). - */ - environment: EnvironmentConfig; - /** - * Whether to enable caching. - * - * @defaultValue `false` - */ - cache?: boolean; - /** - * Whether to enable debug mode. - * - * @defaultValue `false` - */ - debug?: boolean; - /** - * The URL origin of the client. - * - * Use this to set the `Origin` header for requests from non-browser environments. - */ - origin?: string; - - /** - * The storage provider to use. - * - * @defaultValue {@link InMemoryStorageProvider} - */ - storage?: IStorageProvider; -}; - /** * @internal */ @@ -211,7 +177,7 @@ export class PublicClient extends AbstractClient { * @param options - The options to configure the client. * @returns The new instance of the client. */ - static create(options: ClientOptions): PublicClient { + static create(options: ClientConfig): PublicClient { return new PublicClient(configureContext(options)); } diff --git a/packages/client/src/config.ts b/packages/client/src/config.ts index 76f87bde9..2e743c545 100644 --- a/packages/client/src/config.ts +++ b/packages/client/src/config.ts @@ -2,7 +2,7 @@ import type { EnvironmentConfig } from '@lens-protocol/env'; import type { IStorageProvider } from '@lens-protocol/storage'; /** - * The client + * The client configuration. */ export type ClientConfig = { /** diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 753a51112..555c810c8 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -5,4 +5,5 @@ export * from '@lens-protocol/types'; export * from './clients'; export * from './config'; +export type * from './context'; export * from './errors'; diff --git a/packages/types/src/misc.ts b/packages/types/src/misc.ts index de79acc9d..12710dadc 100644 --- a/packages/types/src/misc.ts +++ b/packages/types/src/misc.ts @@ -14,3 +14,14 @@ export type Cursor = Tagged; * A DateTime string in ISO 8601 format. */ export type DateTime = Tagged; + +/** + * Beautify the readout of all of the members of that intersection. + * + * @see https://twitter.com/mattpocockuk/status/1622730173446557697 + * + * @internal + */ +export type Prettify = { + [K in keyof T]: T[K]; +} & {};