# ClassDeclaration

Create a TypeScript class declaration.

* jsx

  ```tsx
  import { ClassDeclaration } from "@alloy-js/typescript";


  <ClassDeclaration extends={Children} implements={Children[]} />
  ```

* stc

  ```ts
  import { ClassDeclaration } from "@alloy-js/typescript/stc";


  ClassDeclaration({
    extends: Children,
    implements: Children[],
  }).children(children)
  ```

## Props

|            |                                                      |   |
| ---------- | ---------------------------------------------------- | - |
| extends    | optional[Children](../../../core/types/children/)    |   |
| implements | optional[Children](../../../core/types/children/)\[] |   |

## Remarks

## Example

```tsx
const myPetRefkey = refkey();
const Animal = refkey();
const staticMember = refkey();
const instanceMember = refkey();

<ClassDeclaration name="Animal" refkey={Animal}>
  <ClassMember public static name="something" type="string" refkey={staticMember}>
    "hello"
  </ClassMember>
  <ClassMember public name="kind" type="string" />
  <ClassMember public name="name" type="string" refkey={instanceMember} />
  <ClassConstructor parameters="name: string">
    this.name = name;
  </ClassConstructor>
</ClassDeclaration>

<VarDeclaration const name="myPet" refkey={myPetRefkey}>
  new {Animal}();
</VarDeclaration>

{staticMember}; // Animal.something
<MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name
{memberRefkey(myPetRefkey, instanceMember)}
```
