12 lines
No EOL
291 B
TypeScript
12 lines
No EOL
291 B
TypeScript
var x: StringTree;
|
|
if (typeof x !== "string") {
|
|
x[0] = "";
|
|
x[0] = new StringTreeCollection;
|
|
}
|
|
|
|
type StringTree = string | StringTreeCollection;
|
|
class StringTreeCollectionBase {
|
|
[n: number]: StringTree;
|
|
}
|
|
|
|
class StringTreeCollection extends StringTreeCollectionBase { } |