UNPKG

@storm-stack/core

Version:

A build toolkit and runtime used by Storm Software in TypeScript applications

50 lines (47 loc) 2 kB
import { ReflectionProperty, ReflectionParameter, Type, TypeString, TypeNumber, ReflectionKind } from '@deepkit/type'; /** * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation. * * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify. * @param value - The value to stringify. * @returns A string representation of the value. */ declare function stringifyDefaultValue(property: ReflectionProperty | ReflectionParameter, value?: any): string; /** * Stringifies a value as a string. * * @param value - The value to stringify. * @returns A string representation of the value. */ declare function stringifyStringValue(value: any): string; /** * Converts any {@link Type}'s actual value to string representation. * * @param type - The {@link Type} of the value to stringify. * @param value - The value to stringify. * @returns A string representation of the value. */ declare function stringifyValue(type: Type, value: any): string; /** * Converts a {@link TypeEnum} to its underlying primitive type representation. * * @param type - The {@link TypeEnum} to evaluate. * @returns A string representation of the primitive type. */ declare function getEnumType(type: Type): TypeString | TypeNumber; /** * Converts a {@link TypeUnion} to its underlying primitive type representation. * * @param type - The {@link TypeUnion} to evaluate. * @returns A string representation of the primitive type. */ declare function getUnionTypes(type: Type): Type[]; declare function isStringUnion(type: Type): boolean; /** * Converts a ReflectionKind to its string representation. * * @param kind - The {@link ReflectionKind} to convert. * @returns A string representation of the kind. */ declare function kindToName(kind: ReflectionKind): string; export { getEnumType, getUnionTypes, isStringUnion, kindToName, stringifyDefaultValue, stringifyStringValue, stringifyValue };