Visual Studio Code and typescript seemingly have issues when trying to use type information from my libary.
The class method i'm calling has id on the interface it returns but typescript is adamant that it doesn't and intelisense seems to think the method is returning the same class despite also telling me it's the correct interface
Test code:
import { assert, expect, test, describe } from 'vitest'
import { HCB } from '../../src';
describe('Single Org ID tests', () => {
const hcb = new HCB();
test('GIVEN hq THEN returns correct org id', async () => {
const org = await hcb.organization.singleOrganization({
id: "hq"
});
expect(org.id).equals("org_a29uVj");
})
});
The interface:
import type { HCB_User } from "./user";
export interface HCB_Organization {
id: string;
object: string;
href: string;
name: string;
slug: string;
category: "hackathon" | "high_school_hackathon" | "event" | "hack_club" | "nonprofit" | "robotics_team" | "hardware_grant" | "hack_club_hq";
transparent: boolean;
demo_mode: boolean;
logo: string;
public_message: string;
balances: {
balance_cents: number;
fee_balance_cents: number;
incoming_balance_cents: number;
};
created_at: string;
users: HCB_User[];
}