UNPKG

@nestia/sdk

Version:

Nestia SDK and Swagger generator

23 lines (22 loc) 1.05 kB
import { type Expression, type Identifier, type ParameterDeclaration, type StringLiteral, type Token, type TypeNode } from "@ttsc/factory"; /** * Identifier and member-access helpers. The surface kept here is the subset * nestia generators actually call (`identifier`, `access`, `parameter`). */ export declare namespace IdentifierFactory { /** * Build an identifier or string literal depending on whether `name` is a * valid JavaScript identifier. */ const identifier: (name: string) => Identifier | StringLiteral; /** * Member access on `input` by `key`. Falls back to element access when the * key is not a valid identifier. */ const access: (input: Expression, key: string, chain?: boolean) => Expression; /** * Parameter declaration with default `any` type when the caller omits one. * Passing a `QuestionToken` as `init` marks the parameter optional. */ const parameter: (name: string | Identifier, type?: TypeNode, init?: Expression | Token) => ParameterDeclaration; }