Skip to content

Identifiers

Identifiers are used to name models, enums, properties, and other entities in TypeSpec. An identifier is a sequence of one or more characters that must start with a letter, emoji, underscore, or dollar sign, and be followed by letters, numbers, emoji, underscores, or dollar signs. TypeSpec implements UAX31-R1b stable identifiers with the emoji profile.

Examples:

  • โœ… cat
  • โœ… Dog
  • โœ… _Item2
  • โœ… $money$
  • โœ… ๐ŸŽ‰
  • โœ… ๐Ÿš€
  • โŒ 1cat
  • โŒ *dog

All keywords are reserved identifiers in TypeSpec. However they can still be used when escaping with wrapping with ``` characters.

model `enum` {}