NonComposite
On this page

NonComposite

Type in Types

Maps a composite key to never and passes every other key through.

import type { NonComposite } from 'typeshade'
import type { NonComposite } from 'typeshade/core/ir'

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

Syntax

type NonComposite<K extends string> = K extends `vec${string}` | `mat${string}` ? never : K;

Description

Used as the this: bound of the scalar-only methods, so a vector receiver is rejected while a scalar receiver, and the widened ReadonlyNode<string>, stay usable. string is not a union, so the conditional does not distribute and passes it through unchanged.

Source

src/core/ir/node.ts, line 73, at commit af54ddad5

Edit this page Report a problem