From 4c3e93fef590423fbe0bc62f183f35cf261627d5 Mon Sep 17 00:00:00 2001 From: ibro Date: Thu, 25 Apr 2024 05:08:50 +0100 Subject: [PATCH] mv types --- packages/types/src/{types.ts => types.d.ts} | 32 ++++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) rename packages/types/src/{types.ts => types.d.ts} (65%) diff --git a/packages/types/src/types.ts b/packages/types/src/types.d.ts similarity index 65% rename from packages/types/src/types.ts rename to packages/types/src/types.d.ts index 0301e76..fcc2226 100644 --- a/packages/types/src/types.ts +++ b/packages/types/src/types.d.ts @@ -36,12 +36,12 @@ export type AccountDataResponse = { export type AccountData = AccountDataError | AccountDataResponse -/* export type Connector = { +export type Connector = { name: string - type: string + type: string icon?: string - // Some other things Config.connect() uses to connect -} & ({[Key in keyof C]: C[Key]}) */ +} & T + export type StateConnected = { activeRequest?: null current: Connector @@ -53,26 +53,30 @@ export type StateDisconnected = { current: null status: 'connecting' | 'disconnected' | 'reconnecting' } + export type State = StateConnected | StateDisconnected + export type ConfigDisconnected = { state: Store> accountData: Store } -export type ConfigConnected = { - state: Store> +export type ConfigConnected = { + state: Store> accountData: Store } -export type Config = { - connectors: readonly Connector[] - connect: (connector: Connector) => Promise /* fix later */ +export type Config = { + connectors: readonly C[] + connect: (connector: C) => Promise /* fix later */ /** * Checks if a connector in the list is already connected * then sets the first one found as the current Connector - * @param {Connector[]} connectors list of Connectors for the given library - * @returns + * @param {C[]} connectors list of Connectors for the given library + * @returns */ - reconnect: (connectors: Connector[]) => Promise - disconnect: (connector?: Connector, opts?: object) => Promise -} & (ConfigDisconnected | ConfigConnected) + reconnect: (connectors: C[]) => Promise + disconnect: (connector?: C, opts?: object) => Promise +} & (ConfigDisconnected | ConfigConnected) + +export {}