import type { ConfirmOptions, Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature, VersionedTransaction, } from '@solana/web3.js'; export interface BackpackEvent { connect(): void; disconnect(): void; connectionDidChange(): void; } export interface BackpackEventEmitter { on(event: E, listener: BackpackEvent[E], context?: any): void; off(event: E, listener: BackpackEvent[E], context?: any): void; } export interface WindowBackpack extends BackpackEventEmitter { publicKey: PublicKey | undefined; connection: Connection; connect(): Promise; disconnect(): Promise; send( tx: T, signers?: Signer[], options?: SendOptions, connection?: Connection, publicKey?: PublicKey ): Promise; sendAndConfirm( tx: T, signers?: Signer[], options?: ConfirmOptions, connection?: Connection, publicKey?: PublicKey ): Promise; signTransaction(tx: T, publicKey?: PublicKey): Promise; signAllTransactions(txs: T[], publicKey?: PublicKey): Promise; signMessage(msg: Uint8Array, publicKey?: PublicKey): Promise; } export interface BackpackWindow extends Window { backpack: WindowBackpack; }