Bar.ts
18 lines
| 344 B
| video/mp2t
|
TypeScriptLexer
|
|
r50 | import { Foo } from "./Foo"; | ||
| export class Bar { | ||||
| name = "bar"; | ||||
|
|
r109 | foo: Foo | undefined; | ||
|
|
r50 | |||
|
|
r109 | constructor(_opts?: { foo?: Foo; }) { | ||
|
|
r50 | if (_opts && _opts.foo) | ||
| this.foo = _opts.foo; | ||||
| } | ||||
|
|
r109 | |||
| getFoo() { | ||||
| if (this.foo === undefined) | ||||
| throw new Error("The foo isn't set"); | ||||
| return this.foo; | ||||
| } | ||||
|
|
r50 | } | ||
