Makes all propertiesĀ read-onlyĀ (immutable).
type ReadonlyType = Readonly<OriginalType>;
interface ApiConfig{
apiKey: string,
baseURL: string
}
const client: Readonly<ApiConfig> = {
apiKey: process.env.GEMINI_API_KEY,
baseURL: "<https://generativelanguage.googleapis.com/v1beta/openai/>"
};
client.apiKey= "adlasdalsjdwqddqwdjad"; *// ā Error: Cannot assign to '*apiKey*' because it is a read-only property*