Hyperlinkv0.8.0-beta.28

ShardMap

ShardMap.shardMapSpecfunctionsrc/ShardMap.ts:178
<Key extends Schema.Top, Value extends Schema.Top>(schemas: {
  readonly key: Key
  readonly value: Value
  readonly error?: undefined
}): ReturnType<typeof buildShardMapSpec<Key, Value, typeof Schema.Never>>
<
  Key extends Schema.Top,
  Value extends Schema.Top,
  Error extends Schema.Top
>(schemas: {
  readonly key: Key
  readonly value: Value
  readonly error: Error
}): ReturnType<typeof buildShardMapSpec<Key, Value, Error>>

Build a ShardMap instance spec from key/value schemas (failure channel = Never).

constructors
Source src/ShardMap.ts:17837 lines
export function shardMapSpec<Key extends Schema.Top, Value extends Schema.Top>(
  schemas: {
    readonly key: Key;
    readonly value: Value;
    readonly error?: undefined;
  },
): ReturnType<
  typeof buildShardMapSpec<Key, Value, typeof Schema.Never>
>;
/**
 * Build a ShardMap instance spec from key/value/error schemas.
 *
 * @public
 */
export function shardMapSpec<
  Key extends Schema.Top,
  Value extends Schema.Top,
  Error extends Schema.Top,
>(schemas: {
  readonly key: Key;
  readonly value: Value;
  readonly error: Error;
}): ReturnType<typeof buildShardMapSpec<Key, Value, Error>>;
export function shardMapSpec<
  Key extends Schema.Top,
  Value extends Schema.Top,
  Error extends Schema.Top,
>(schemas: {
  readonly key: Key;
  readonly value: Value;
  readonly error?: Error;
}) {
  if (schemas.error === undefined) {
    return buildShardMapSpec(schemas.key, schemas.value, Schema.Never);
  }
  return buildShardMapSpec(schemas.key, schemas.value, schemas.error);
}