Names

FUNCTION

createProperty

@skmtc/lang-typescript 0.19.1

Creates a class property identifier - a member of a class Index (toTsOasOperationIndexBase). Insert it through a projection with toIndex: at the file level it still renders as a member, which is not valid TypeScript there.

Signature

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

createProperty(name: string, args?: CreatePropertyArgs): TsIdentifier

Parameters

name, string required
args, CreatePropertyArgs
typeName, string
Example
const baseUrl = createProperty('baseUrl', { typeName: 'string' });
// TsDefinition renders: baseUrl: string = …;

Returns