-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Labels
CLIThis issue/PR is related to or requires the implementation of the CLI toolThis issue/PR is related to or requires the implementation of the CLI tool
Description
Hi
Would it be possible to also generate an index.ts inside the bindings directory?
example
When I have the following structs:
#[derive(Serialize, Debug, TS)]
#[ts(
export,
export_to = "bindings/admin/login-response.ts",
rename = "AdminLoginResponse"
)]
struct LoginResponse {
access_token: String,
expires_in: i64,
token_type: String,
}
#[derive(Deserialize, Validate, Debug, TS)]
#[ts(
export,
export_to = "bindings/admin/login-request.ts",
rename = "AdminLoginRequest"
)]
struct LoginRequest {
#[validate(email(message = "invalid email"))]
email: String,
#[validate(length(min = 8))]
password: String,
}I would like to have a index.ts generated inside the bindings directory, that looks like:
export * from './admin/login-request';
export * from './admin/login-response';So I could add the following configuration to my tsconfig.json:
{
...
"compilerOptions": {
...
"paths": {
"@my-project/backend": ["backend/bindings/index.ts"],
}
}
}this allows me to import all the exported types in my typescript code like this:
import { AdminLoginRequest, AdminLoginResponse } from '@my-project/backend';Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CLIThis issue/PR is related to or requires the implementation of the CLI toolThis issue/PR is related to or requires the implementation of the CLI tool