Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Substitute

import type { Substitute } from "https://raw.githubusercontent.com/baetheus/fun/main/kind.ts";

Substitute is a substitution type, taking a Kind implementation T and substituting it with types passed in S.

type Substitute<T extends Kind, S extends Substitutions> = T extends {
readonly kind: unknown;
}
? (T & S)["kind"] : {
readonly T: T;
readonly [out]: () => S["out"];
readonly [in]: (_: S["in"]) => void;
readonly [inout]: (_: S["inout"]) => S["inout"];
}
;

§Type Parameters

§
T extends Kind
[src]

§Type

§
T extends {
readonly kind: unknown;
}
? (T & S)["kind"] : {
readonly T: T;
readonly [out]: () => S["out"];
readonly [in]: (_: S["in"]) => void;
readonly [inout]: (_: S["inout"]) => S["inout"];
}
[src]