Repository: alloy-framework/alloy (ts)

Issue:
readonly attribute ignored for indexer InterfaceMember
```ts
   <ts.InterfaceMember
          readonly
          indexer="key: string"
          type="unknwown"
        />
```

produce 
```ts
  [key: string]: unknown;
```

Pull request description:
Readonly indexers
Fixes #139 

Patch:
diff --git a/.chronus/changes/readonly-indexers-2025-4-1-11-23-58.md b/.chronus/changes/readonly-indexers-2025-4-1-11-23-58.md
new file mode 100644
index 0000000..3750578
--- /dev/null
+++ b/.chronus/changes/readonly-indexers-2025-4-1-11-23-58.md
@@ -0,0 +1,7 @@
+---
+changeKind: fix
+packages:
+  - "@alloy-js/typescript"
+---
+
+Include readonly for indexers
\ No newline at end of file
diff --git a/packages/typescript/src/components/Interface.tsx b/packages/typescript/src/components/Interface.tsx
index b1ae0f6..3261c08 100644
--- a/packages/typescript/src/components/Interface.tsx
+++ b/packages/typescript/src/components/Interface.tsx
@@ -106,7 +106,7 @@ export function InterfaceMember(props: InterfaceMemberProps) {
   if (props.indexer) {
     return (
       <>
-        [{props.indexer}]: {type}
+        {readonly}[{props.indexer}]: {type}
       </>
     );
   } else {


Test patch:
diff --git a/packages/typescript/test/interface.test.tsx b/packages/typescript/test/interface.test.tsx
index 75fa527..22ec7c6 100644
--- a/packages/typescript/test/interface.test.tsx
+++ b/packages/typescript/test/interface.test.tsx
@@ -95,7 +95,7 @@ it("can create readonly members", () => {
           name="circular"
           type={<Reference refkey={refkey("Foo")} />}
         />
-        <ts.InterfaceMember indexer="str: string" type="number" />
+        <ts.InterfaceMember readonly indexer="str: string" type="number" />
       </StatementList>
     </ts.InterfaceDeclaration>,
   );
@@ -104,7 +104,7 @@ it("can create readonly members", () => {
     interface Foo {
       readonly member: string;
       circular: Foo;
-      [str: string]: number;
+      readonly [str: string]: number;
     }
   `);
 });