UNPKG

772 BTypeScriptView Raw
1import type { NodePath } from '@babel/traverse';
2import type { ClassMethod, ClassProperty, ObjectMethod, ObjectProperty, ObjectTypeProperty, ObjectTypeSpreadProperty, SpreadElement, TSMethodSignature, TSPropertySignature } from '@babel/types';
3export declare const COMPUTED_PREFIX = "@computed#";
4/**
5 * In an ObjectExpression, the name of a property can either be an identifier
6 * or a literal (or dynamic, but we don't support those). This function simply
7 * returns the value of the literal or name of the identifier.
8 */
9export default function getPropertyName(propertyPath: NodePath<ClassMethod | ClassProperty | ObjectMethod | ObjectProperty | ObjectTypeProperty | ObjectTypeSpreadProperty | SpreadElement | TSMethodSignature | TSPropertySignature>): string | null;