typeof
const userAccount = {
name: "Kieron",
id: 0,
};
// You can combine these to make larger, more complex
// data-models.
const pie = {
type: "Apple",
};
const purchaseOrder = {
owner: userAccount,
item: pie,
};
type PurchaseOrder = typeof purchaseOrder;
// Creates a readonly array of purchase orders
const readonlyOrders: readonly PurchaseOrder[] = [purchaseOrder];
// error
readonlyOrders.pop();