Using Okai and with shared types

I am testing developing with Okai. I have 2 typescript schemas definitions that share a common typescript Definition

export enum ApiEnvironment {
    Production,
    Staging,
    Development,
}

How do I reference that in my both definition files so both will use the same enum?

There’s no explicit support for it but if okai can’t find the Type it assumes it exists elsewhere, so the ApiEnvironment only needs to be defined in one of the schemas, or you can move the common C# Enum Type in an existing .cs with in an accessible namespace.

We’d likely need to add explicit support for it, something like an @extern or @partial attribute.

Great. Thank you. I defined the Enum in C# and it works fine.

1 Like