DenoDDeno
Powered by
dan.the.discloserD
Denoβ€’4y agoβ€’
5 replies
dan.the.discloser

OR interfaces?

What should
EITHER
EITHER
mean?

interface ONE {
  one: number;
  i: string;
}
interface TWO {
  two: number;
  j: string;
}

type EITHER = ONE | TWO;
interface ONE {
  one: number;
  i: string;
}
interface TWO {
  two: number;
  j: string;
}

type EITHER = ONE | TWO;


EITHER
EITHER
seems to accept anything that has

* ALL the elements of either
ONE
ONE
or
TWO
TWO
, along with
* zero or more elements of the other.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dynamic interfaces
KayKKay / help
3y ago
Uint8Array or Float32Array
NeTTNNeTT / help
3y ago
Relative import path "ioredis" not prefixed with / or ./ or ../
bajosiBbajosi / help
3y ago