Names

FUNCTION

createType

@skmtc/lang-typescript 0.19.1

Creates a type identifier - a type-level entity that declares with type and imports type-only (import { type Foo }).

Signature

import { createType } from '@skmtc/lang-typescript'

createType(name: string, args?: CreateTypeArgs): TsIdentifier

Parameters

name, string required
args, CreateTypeArgs
exported, boolean

Whether the identifier is exported. Defaults to true.

Example
const userType = createType('User');
// TsDefinition renders: export type User = …;

Returns