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” String A sequence of characters
UUID A universally unique identifier
URL A Uniform Resource Locator (URL)
Email An email address
Employer Tax ID An Employer Identification Number (EIN)
SAM UEI A Unique Entity Identifier (UEI) assigned by the System for Award Management (SAM)
DUNS A Data Universal Numbering System (DUNS) number
Numeric
Section titled “Numeric” Numeric A number with an arbitrary precision and scale
Integer A whole number without decimals
Decimal String A decimal number encoded as a string to preserve scale
Date and time
Section titled “Date and time” ISO Time Time without timezone
ISO Date Calendar date
UTC DateTime Datetime with UTC timezone
Offset DateTime Datetime with local timezone
Calendar Year A calendar year in the format YYYY
Other types
Section titled “Other types” Boolean A true or false value
Array An ordered list of values
Record A collection of key-value pairs
Null A null value
Unknown A 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;}