From 6f4fe1dd11c868ef9982cb31147673cec8b8b779 Mon Sep 17 00:00:00 2001 From: Dominic Lee <34794189+dominictwlee@users.noreply.github.com> Date: Mon, 3 Jan 2022 10:51:27 +0000 Subject: [PATCH] ts: add missing types for conditional exports (#1137) --- CHANGELOG.md | 1 + ts/src/index.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d99bb96e..67193f9cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ incremented for features. ### Fixes +* ts: Add type declarations for conditional `workspace` and `Wallet` exports ([#1137](https://github.com/project-serum/anchor/pull/1137)). * ts: Change commitment message `recent` to `processed` and `max` to `finalized` ([#1128](https://github.com/project-serum/anchor/pull/1128)) * ts: fix `translateAddress` which currently leads to failing browser code. Now uses `PublicKey` constructor instead of prototype chain constructor name checking which doesn't work in the presence of code minifying/mangling([#1138](https://github.com/project-serum/anchor/pull/1138)) * lang: add missing check that verifies that account is ATA when using `init_if_needed` and init is not needed([#1221](https://github.com/project-serum/anchor/pull/1221)) diff --git a/ts/src/index.ts b/ts/src/index.ts index 0e6b5f225..35fc903fc 100644 --- a/ts/src/index.ts +++ b/ts/src/index.ts @@ -18,6 +18,9 @@ export { Idl } from "./idl.js"; export * as utils from "./utils/index.js"; export * from "./program/index.js"; +export declare const workspace: any; +export declare const Wallet: import("./nodewallet").default; + if (!isBrowser) { exports.workspace = require("./workspace.js").default; exports.Wallet = require("./nodewallet.js").default;