Skip to content

TypeScript enums聽#277

Closed
appwrite/sdk-generator
#2070
Closed

Description

@osnoser1

馃敄 Enhancement description

Is there a way to, instead of generating enums, generate types and constants, e.g.

馃帳 Pitch

From:

export enum ItemsRunItemOrigin {
  TEMPLATE = 'template',
  CARRYOVER = 'carryover',
  ADHOC = 'adhoc',
}

to

export const ItemsRunItemOrigin = {
  TEMPLATE = 'template',
  CARRYOVER = 'carryover',
  ADHOC = 'adhoc',
} as const;

export type ItemsRunItemOrigin = typeof ItemsRunItemOrigin[keyof typeof ItemsRunItemOrigin];

Thank you very much in advance

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

Activity

  1. ChiragAgg5k commented on Oct 16, 2026

    @ChiragAgg5k
    Member

    Added in 28.7.0 (appwrite/sdk-generator#2070): appwrite types and appwrite generate take --enum-style const, which emits as const objects with matching union types instead of TypeScript enums. The default is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions