Skip to content

Commit b7b73a0

Browse files
feat: export enums as string unions instead of enums
feat: export enums as string unions instead of enums
2 parents dd96ad7 + 23df3a5 commit b7b73a0

File tree

2 files changed

+18
-26
lines changed

2 files changed

+18
-26
lines changed

index.d.ts

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ export declare class Client {
1010
getDeploymentId(clusterIdOrName: string): Promise<string>
1111
}
1212

13-
export declare const enum BindingType {
14-
Loopback = 'Loopback',
15-
AnyInterface = 'AnyInterface',
16-
Specific = 'Specific'
17-
}
13+
export type BindingType = 'Loopback'|
14+
'AnyInterface'|
15+
'Specific';
1816

1917
export interface CreateDeploymentOptions {
2018
name?: string
@@ -41,12 +39,10 @@ export interface CreationSource {
4139
source: string
4240
}
4341

44-
export declare const enum CreationSourceType {
45-
AtlasCLI = 'AtlasCLI',
46-
Container = 'Container',
47-
MCPServer = 'MCPServer',
48-
Other = 'Other'
49-
}
42+
export type CreationSourceType = 'AtlasCLI'|
43+
'Container'|
44+
'MCPServer'|
45+
'Other';
5046

5147
export interface Deployment {
5248
containerId: string
@@ -74,17 +70,13 @@ export interface MongoDbPortBinding {
7470
port?: number
7571
}
7672

77-
export declare const enum MongodbType {
78-
Community = 'Community',
79-
Enterprise = 'Enterprise'
80-
}
73+
export type MongodbType = 'Community'|
74+
'Enterprise';
8175

82-
export declare const enum State {
83-
Created = 'Created',
84-
Dead = 'Dead',
85-
Exited = 'Exited',
86-
Paused = 'Paused',
87-
Removing = 'Removing',
88-
Restarting = 'Restarting',
89-
Running = 'Running'
90-
}
76+
export type State = 'Created'|
77+
'Dead'|
78+
'Exited'|
79+
'Paused'|
80+
'Removing'|
81+
'Restarting'|
82+
'Running';

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"scripts": {
4545
"artifacts": "napi artifacts",
4646
"bench": "node --import @oxc-node/core/register benchmark/bench.ts",
47-
"build": "napi build --platform --release",
48-
"build:debug": "napi build --platform",
47+
"build": "napi build --platform --release --no-const-enum",
48+
"build:debug": "napi build --platform --no-const-enum",
4949
"format": "run-p format:prettier format:rs format:toml",
5050
"format:prettier": "prettier . -w",
5151
"format:toml": "taplo format",

0 commit comments

Comments
 (0)