Remote / foldkit-remote-domain/imported

Imported

namespace · packages/remote-domain/src/imported/index.ts:11

const Imported = { mutation, describe, show }

What a Domain Api imports into Remote, beyond the Writes the page declares: mutation declares a command the author wrote no Write for, describe lists what the Api's bindings import with each command's footprint, and show writes that as Markdown.

In the guides

Members

Imported.mutation

function · packages/remote-domain/src/imported/mutation.ts:54

mutation<
  A extends AnyApi,
  const Name extends CommandNameOf<A>,
  E extends AnyEntity,
  Refused = never,
>(
  api: A,
  name: Name,
  config: ImportedConfig<E, Refused>,
): ImportedMutation<A, Name, Refused>

Declares the command name of api as a mutation named after it, with { target, input } as its input and the command's reply as its output. Throws, naming it, for a command the Api does not serve and for a Declared footprint of another Entity or naming a field entity lacks. It makes no binding: DomainRemote.command takes the mutation to bind it.

Imported.describe

function · packages/remote-domain/src/imported/describe.ts:106

describe<A extends AnyApi>(
  api: A,
  config: DescribeConfig<A>,
): ImportedDescription

Describes the Views and commands api has bound, sorted by id so a list reordered in the source is no change to the text. Throws, naming it, for a binding of another Api.

Imported.show

function · packages/remote-domain/src/imported/show.ts:68

show(description: ImportedDescription): string

The Markdown of description: one section per command and one line per View. It holds no time and no path, so the same Api writes the same text.