* Registers a binding's declaration fragments and eager initialization dependencies.
(binding: Binding, fragments: ReadonlyArray<Fragment>, dependencies: ReadonlyArray<Binding> = [])
| 485 | * Registers a binding's declaration fragments and eager initialization dependencies. |
| 486 | */ |
| 487 | define(binding: Binding, fragments: ReadonlyArray<Fragment>, dependencies: ReadonlyArray<Binding> = []): this { |
| 488 | if (!this.#bindings.has(binding)) { |
| 489 | throw new Error("Expected a declaration binding owned by this module") |
| 490 | } |
| 491 | if (this.#declarations.has(binding)) { |
| 492 | throw new Error(`Duplicate definition: ${binding.preferredName}`) |
| 493 | } |
| 494 | this.#declarations.set(binding, { binding, fragments, dependencies }) |
| 495 | return this |
| 496 | } |
| 497 | |
| 498 | /** |
| 499 | * Adds named schema representations to a module and returns their declaration bindings by requested name. |