link
Call Signature
Section titled “Call Signature”link<
T>(TargetModel):TypeWrapper<InstanceType<T>>
Defined in: .work/repos/edinburgh/src/types.ts:825
Create a link type wrapper for model relationships.
Type Parameters
Section titled “Type Parameters”T extends (…args) => any
The target model class.
Parameters
Section titled “Parameters”TargetModel
Section titled “TargetModel”T
The model class this link points to.
Returns
Section titled “Returns”TypeWrapper<InstanceType<T>>
A link type instance.
Example
Section titled “Example”const Author = E.defineModel("Author", class { id = E.field(E.identifier); posts = E.field(E.array(E.link(() => Book)));}, { pk: "id" });
const Book = E.defineModel("Book", class { id = E.field(E.identifier); author = E.field(E.link(Author));}, { pk: "id" });Call Signature
Section titled “Call Signature”link<
T>(TargetModel):TypeWrapper<InstanceType<T>>
Defined in: .work/repos/edinburgh/src/types.ts:828
Create a link type wrapper for model relationships.
Type Parameters
Section titled “Type Parameters”T extends (…args) => any
The target model class.
Parameters
Section titled “Parameters”TargetModel
Section titled “TargetModel”() => T
The model class this link points to.
Returns
Section titled “Returns”TypeWrapper<InstanceType<T>>
A link type instance.
Example
Section titled “Example”const Author = E.defineModel("Author", class { id = E.field(E.identifier); posts = E.field(E.array(E.link(() => Book)));}, { pk: "id" });
const Book = E.defineModel("Book", class { id = E.field(E.identifier); author = E.field(E.link(Author));}, { pk: "id" });