Skip to content

[F] getLibraryName

function getLibraryName(
context,
type,
scope?): string;

Get the library name of a property / parameter / operation / model / enum. Takes projections into account

Returns name in the following order of priority

  1. language emitter name, i.e. @clientName(“csharpSpecificName”, “csharp”) => “csharpSpecificName”
  2. client name, i.e. @clientName(""clientName”) => “clientName”
  3. deprecated projected name
  4. friendly name, i.e. @friendlyName(“friendlyName”) => “friendlyName”
  5. name in typespec
ParameterTypeDescription
contextTCGCContext
typeType & object
scope?string | typeof AllScopes-

string

the library name for a typespec type