MCPcopy Create free account
hub / github.com/Effect-TS/effect / define

Method define

packages/effect/src/Codegen.ts:487–496  ·  view source on GitHub ↗

* Registers a binding's declaration fragments and eager initialization dependencies.

(binding: Binding, fragments: ReadonlyArray<Fragment>, dependencies: ReadonlyArray<Binding> = [])

Source from the content-addressed store, hash-verified

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.

Callers 15

Providers.test.tsFile · 0.80
Inspector.test.tsFile · 0.80
Router.tst.tsFile · 0.80
Reports.tst.tsFile · 0.80
Slots.tst.tsFile · 0.80
Providers.tst.tsFile · 0.80
keyedFunction · 0.80
namedFunction · 0.80
Story.tst.tsFile · 0.80
Send.tst.tsFile · 0.80
makeFunction · 0.80
UiAtom.tst.tsFile · 0.80

Calls 2

hasMethod · 0.65
setMethod · 0.65

Tested by 15

makeAppFunction · 0.64
makeWatcherFunction · 0.64
swapFunction · 0.64
makeFunction · 0.64
counterFunction · 0.64
makeAppFunction · 0.64
makeFunction · 0.64
makeSelectionFunction · 0.64
leafFunction · 0.64
holdingFunction · 0.64
makeFormFunction · 0.64
makeSettingsFunction · 0.64