Struct: {
<Fields extends Fields, const Records extends readonly [Record, Record]>(
fields: Fields,
...records: Records,
): TypeLiteral<Fields, Records>;
<Fields extends Fields>(fields: Fields): __type<Fields>;
} & {
named: (
identifier: string,
) => <Fields extends Fields>(fields: Fields) => __type<Fields>;
styled: (
identifier: string,
nodeAttributes: NodeAttributesObject,
edgeAttributes?: EdgeAttributesObject,
) => <Fields extends Fields>(fields: Fields) => __type<Fields>;
} = ...
Type declaration
- <Fields extends Fields, const Records extends readonly [Record, Record]>(
fields: Fields,
...records: Records,
): TypeLiteral<Fields, Records> Type Parameters
- Fields extends Fields
- const Records extends readonly [Record, Record]
Parameters
- fields: Fields
- ...records: Records
Returns TypeLiteral<Fields, Records>
- <Fields extends Fields>(fields: Fields): __type<Fields>
Returns __type<Fields>
named: (
identifier: string,
) => <Fields extends Fields>(fields: Fields) => __type<Fields>
styled: (
identifier: string,
nodeAttributes: NodeAttributesObject,
edgeAttributes?: EdgeAttributesObject,
) => <Fields extends Fields>(fields: Fields) => __type<Fields>
Just like Effect/Schema/Struct except has two extra functions under the
named
andstyled
keys. These are syntax sugar for creating a struct and adding the identifier and Graphviz attributes manually.named
- takes as an extra 1st parameter the name of the object type.styles
- takes as an extra 1st parameter the name of the object type, and optional parameters for node and edge GraphViz attributes.