Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts: add missing types for conditional exports #1137

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -28,6 +28,7 @@ incremented for features.
* ts: Add better error msgs in the ts client if something wrong (i.e. not a pubkey or a string) is passed in as an account in an instruction accounts object ([#1098](https://github.com/project-serum/anchor/pull/1098)).
* ts: Add inputs `postInstructions` and `preInstructions` as a replacement for (the now deprecated) `instructions` ([#1007](https://github.com/project-serum/anchor/pull/1007)).
* ts: Add `getAccountInfo` helper method to account namespace/client ([#1084](https://github.com/project-serum/anchor/pull/1084)).
* ts: Add type declarations for conditional `workspace` and `Wallet` exports ([#1137](https://github.com/project-serum/anchor/pull/1137)).
fanatid marked this conversation as resolved.
Show resolved Hide resolved

### Breaking

Expand Down
3 changes: 3 additions & 0 deletions ts/src/index.ts
Expand Up @@ -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;
Expand Down