Overview
The CommonGrants.Types namespace contains a standard set of types that are used to build more complex models.
Learn more about the standard types defined by the CommonGrants protocol:
String
Section titled “String”StringA sequence of characters
UUIDA universally unique identifier
URLA Uniform Resource Locator (URL)
EmailAn email address
Employer Tax IDAn Employer Identification Number (EIN)
SAM UEIA Unique Entity Identifier (UEI) assigned by the System for Award Management (SAM)
DUNSA Data Universal Numbering System (DUNS) number
Numeric
Section titled “Numeric”NumericA number with an arbitrary precision and scale
IntegerA whole number without decimals
Decimal StringA decimal number encoded as a string to preserve scale
Date and time
Section titled “Date and time”ISO TimeTime without timezone
ISO DateCalendar date
UTC DateTimeDatetime with UTC timezone
Offset DateTimeDatetime with local timezone
Calendar YearA calendar year in the format YYYY
Other types
Section titled “Other types”BooleanA true or false value
ArrayAn ordered list of values
RecordA collection of key-value pairs
NullA null value
UnknownA value of with any type
You can use the types listed above to define custom models in your TypeSpec project.
import "@common-grants/core"
// Exposes the `Types` namespace so that it can be accessed// without a `CommonGrants` prefixusing CommonGrants;
model MyModel { id: Types.uuid; // CommonGrants-defined type description: string; // Standard TypeSpec type tags: Array<string>; // A templated type createdAt: utcDateTime;}