mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
21 lines
440 B
TypeScript
21 lines
440 B
TypeScript
// Exported classes and a registry of class VALUES crossing module lines.
|
|
export class Shape {
|
|
sides = 0;
|
|
constructor() {}
|
|
label(): string {
|
|
return "shape";
|
|
}
|
|
static family = "geometry";
|
|
}
|
|
export class Hexagon extends Shape {
|
|
constructor() {
|
|
super();
|
|
this.sides = 6;
|
|
}
|
|
label(): string {
|
|
return "hexagon";
|
|
}
|
|
}
|
|
export const registry: (typeof Shape)[] = [Hexagon, Shape];
|
|
export const DefaultShape = Hexagon;
|