crouter
PluginReference

Output fields

Declaring the fields a leaf returns, and the object type they add up to.

Exports of @crouter/plugin, read from the TypeScript compiler at build time. Types re-exported from @crouter/api are documented with that package.

ArrayField

type declared in fields.ts

An array field with a typed element, as returned by field.array(field.…).

Prop

Type

EnumField

type declared in fields.ts

A field restricted to fixed values, as returned by field.enum([…]).

Prop

Type

field

variable declared in fields.ts

The output-field builders. Fields are required unless { required: false } is passed.

Prop

Type

FileField

interface declared in fields.ts

A file, as returned by field.file. The same descriptor declares a flat file parameter (placed in a leaf's params) or the leaf's one top-level file output (placed in output).

Prop

Type

FileOutputValue

interface declared in fields.ts

What a leaf returns in a file output: the upload it PUT its bytes to, named by the Crtr-Upload-Id request header, with the byte count and the hex SHA-256 digest. The runtime replaces it with the path of the fetched file before the caller sees the result.

Prop

Type

ObjectField

type declared in fields.ts

An object field with typed members, as returned by field.object({ … }).

Prop

Type

OutField

interface declared in fields.ts

One declared field of a leaf's result, as returned by a field.* builder.

Prop

Type

Output

type declared in fields.ts

The result type inferred from a leaf's output object: required fields present, the rest optional, and each value typed from its field's manifest type.

{ [K in keyof O as O[K] extends { required: true; } ? K : never]: FieldValue<O[K]>; } & { [K in keyof O as O[K] extends { required: true; } ? never : K]?: FieldValue<O[K]> | undefined; }

On this page